PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.6.26
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.6.26
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / includes / templates / class-template-admission-form.php

class-template-admission-form.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.6.26, at includes/templates/class-template-admission-form.php

139 lines 5.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Blank form template
5 */
6 class WeForms_Template_Admission_Form extends WeForms_Form_Template {
7
8 public function __construct() {
9 parent::__construct();
10
11 $this->enabled = class_exists( 'WeForms_Pro' );
12 $this->title = __( 'Admissions Form', 'weforms' );
13 $this->description = __( 'A sample admissions and registration form for your educational institution on this multi-page admissions form to ask for user details and an application fee.', 'weforms' );
14 $this->image = WEFORMS_ASSET_URI . '/images/form-template/admission_form.png';
15 $this->category = 'registration';
16 }
17
18 /**
19 * Get the form fields
20 *
21 * @return array
22 */
23 public function get_form_fields() {
24 $all_fields = $this->get_available_fields();
25
26 $form_fields = [
27 array_merge( $all_fields['name_field']->get_field_props(), [
28 'required' => 'yes',
29 'format' => 'first-middle-last',
30
31 'first_name' => [
32 'placeholder' => '',
33 'default' => '',
34 'sub' => __( 'First', 'weforms' ),
35 ],
36
37 'middle_name' => [
38 'placeholder' => '',
39 'default' => '',
40 'sub' => __( 'Middle', 'weforms' ),
41 ],
42 'last_name' => [
43 'placeholder' => '',
44 'default' => '',
45 'sub' => __( 'Last', 'weforms' ),
46 ],
47 'hide_subs' => false,
48 'name' => 'format',
49 ] ),
50
51 array_merge( $all_fields['date_field']->get_field_props(), [
52 'required' => 'yes',
53 'label' => __( 'Birth Date', 'weforms' ),
54 'name' => 'birth_date',
55 ] ),
56
57 array_merge( $all_fields['radio_field']->get_field_props(), [
58 'required' => 'yes',
59 'label' => __( 'Gender', 'weforms' ),
60 'name' => 'gender',
61 'options' => [
62 'male' => 'Male',
63 'female' => 'Female',
64 'decline_to_answer' => 'Decline to Answer',
65 ],
66 ] ),
67
68 array_merge( $all_fields['radio_field']->get_field_props(), [
69 'required' => 'yes',
70 'label' => __( 'Are you Hispanic or Latino?', 'weforms' ),
71 'name' => 'latino',
72 'options' => [
73 'yes' => 'Yes',
74 'no' => 'No',
75 'decline_to_answer' => 'Decline to Answer',
76 ],
77 ] ),
78
79 array_merge( $all_fields['checkbox_field']->get_field_props(), [
80 'required' => 'yes',
81 'label' => __( 'Race:', 'weforms' ),
82 'name' => 'race',
83 'options' => [
84 'american' => 'American Indian/Alaskan Native ',
85 'asian' => 'Asian',
86 'black' => 'Black',
87 'native_hawaiian' => 'Native Hawaiian/Other Pacific Islander',
88 'white' => 'White',
89 'decline_to_answer' => 'Decline to Answer',
90 ],
91 ] ),
92
93 array_merge( $all_fields['numeric_text_field']->get_field_props(), [
94 'required' => 'yes',
95 'label' => __( 'Phone Number', 'weforms' ),
96 'name' => 'phone_number',
97 ] ),
98
99 array_merge( $all_fields['email_address']->get_field_props(), [
100 'required' => 'yes',
101 'label' => __( 'Email Address', 'weforms' ),
102 'name' => 'email_address',
103 ] ),
104
105 array_merge( $all_fields['address_field']->get_field_props(), [
106 'required' => 'yes',
107 'label' => __( 'Mailing Address', 'weforms' ),
108 'name' => 'mailing_address',
109 ] ),
110
111 array_merge( $all_fields['checkbox_field']->get_field_props(), [
112 'required' => 'yes',
113 'label' => __( 'Payment Method', 'weforms' ),
114 'name' => 'payment_method',
115 'options' => [
116 'credit_card' => 'Credit Card',
117 'mail_a_check' => 'Mail a Check',
118 'in_person' => 'In Person at School',
119 ],
120 ] ),
121 ];
122
123 return $form_fields;
124 }
125
126 /**
127 * Get the form settings
128 *
129 * @return array
130 */
131 public function get_form_settings() {
132 $defaults = $this->get_default_settings();
133
134 return array_merge( $defaults, [
135 'submit_text' => __( 'Submit', 'weforms' ),
136 ] );
137 }
138 }
139