PluginProbe
The Innovative Form Builder – IvyForms / 1.5
The Innovative Form Builder – IvyForms v1.5
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Services / Template / MedicalConferenceRegistrationFormTemplate.php

MedicalConferenceRegistrationFormTemplate.php in The Innovative Form Builder – IvyForms 1.5, at backend/src/Services/Template/MedicalConferenceRegistrationFormTemplate.php

228 lines 7.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IvyForms\Services\Template;
4
5 use IvyForms\Services\Translations\BackendStrings;
6
7 class MedicalConferenceRegistrationFormTemplate
8 {
9 /**
10 * Get template metadata (without form_data)
11 *
12 * @return array<string, mixed>
13 */
14 public static function getTemplateMeta(): array
15 {
16 return [
17 'id' => 'medical_conference_registration_form',
18 'name' => BackendStrings::getTemplateStrings()['medical_conference_registration_form'],
19 'description' => BackendStrings::getTemplateStrings()['medical_conference_registration_form_desc'],
20 'category' => 'event-registration-forms',
21 'subcategory' => 'conference-registration-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'medical-conference-registration-form.svg'
24 ];
25 }
26
27 /**
28 * Get the full template including form data
29 *
30 * @return array<string, mixed>
31 */
32 public static function getTemplate(): array
33 {
34 return array_merge(
35 self::getTemplateMeta(),
36 [
37 'form_data' => [
38 'name' => BackendStrings::getTemplateStrings()['medical_conference_registration_form'],
39 'published' => 1,
40 'showTitle' => 1,
41 'storeEntries' => 1,
42 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
43 'fields' => array_merge(
44 self::getParticipantInformationFields(),
45 self::getMedicalPreferencesFields(),
46 self::getAdditionalInformationFields()
47 ),
48 'settings' => []
49 ]
50 ]
51 );
52 }
53
54 /**
55 * Get participant information fields
56 *
57 * @return array<int, array<string, mixed>>
58 */
59 private static function getParticipantInformationFields(): array
60 {
61 return [
62 // Full Name
63 [
64 'id' => 1,
65 'fieldIndex' => 1,
66 'type' => 'text',
67 'label' => BackendStrings::getTemplateStrings()['full_name'],
68 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_full_name'],
69 'required' => true,
70 'parentId' => null,
71 'defaultValue' => '',
72 'position' => 1,
73 'validation' => [
74 'required' => true,
75 ],
76 ],
77 // Email Address
78 [
79 'id' => 2,
80 'fieldIndex' => 2,
81 'type' => 'email',
82 'label' => BackendStrings::getTemplateStrings()['email_address'],
83 'placeholder' => '[email protected]',
84 'required' => true,
85 'parentId' => null,
86 'defaultValue' => '',
87 'position' => 2,
88 'validation' => [
89 'required' => true,
90 'email' => true
91 ],
92 ],
93 // Phone Number
94 [
95 'id' => 3,
96 'fieldIndex' => 3,
97 'type' => 'phone',
98 'label' => BackendStrings::getTemplateStrings()['phone_number'],
99 'placeholder' => '+1 (_) _-_',
100 'required' => false,
101 'parentId' => null,
102 'defaultValue' => '',
103 'position' => 3,
104 'phoneAutoDetect' => true,
105 ],
106 ];
107 }
108
109 /**
110 * Get medical preferences fields
111 *
112 * @return array<int, array<string, mixed>>
113 */
114 private static function getMedicalPreferencesFields(): array
115 {
116 return [
117 // Specialization Dropdown
118 [
119 'id' => 9,
120 'fieldIndex' => 4,
121 'type' => 'select',
122 'label' => BackendStrings::getTemplateStrings()['specialization'],
123 'placeholder' => BackendStrings::getTemplateStrings()['select_specialization'],
124 'required' => true,
125 'parentId' => null,
126 'defaultValue' => '',
127 'position' => 4,
128 'fieldOptions' => [
129 [
130 'id' => 4,
131 'label' => BackendStrings::getTemplateStrings()['cardiology'],
132 'value' => 'cardiology',
133 'isDefault' => false,
134 'position' => 1,
135 ],
136 [
137 'id' => 5,
138 'label' => BackendStrings::getTemplateStrings()['neurology'],
139 'value' => 'neurology',
140 'isDefault' => false,
141 'position' => 2,
142 ],
143 [
144 'id' => 6,
145 'label' => BackendStrings::getTemplateStrings()['pediatrics'],
146 'value' => 'pediatrics',
147 'isDefault' => false,
148 'position' => 3,
149 ],
150 [
151 'id' => 7,
152 'label' => BackendStrings::getTemplateStrings()['oncology'],
153 'value' => 'oncology',
154 'isDefault' => false,
155 'position' => 4,
156 ],
157 [
158 'id' => 8,
159 'label' => BackendStrings::getTemplateStrings()['other'],
160 'value' => 'other',
161 'isDefault' => false,
162 'position' => 5,
163 ],
164 ],
165 ],
166 // Seminars to Attend (Checkbox)
167 [
168 'id' => 13,
169 'fieldIndex' => 5,
170 'type' => 'checkbox',
171 'label' => BackendStrings::getTemplateStrings()['seminars_to_attend'],
172 'placeholder' => '',
173 'required' => false,
174 'parentId' => null,
175 'defaultValue' => '',
176 'position' => 5,
177 'fieldOptions' => [
178 [
179 'id' => 10,
180 'label' => BackendStrings::getTemplateStrings()['seminar_1'],
181 'value' => 'seminar_1',
182 'isDefault' => false,
183 'position' => 1,
184 ],
185 [
186 'id' => 11,
187 'label' => BackendStrings::getTemplateStrings()['seminar_2'],
188 'value' => 'seminar_2',
189 'isDefault' => false,
190 'position' => 2,
191 ],
192 [
193 'id' => 12,
194 'label' => BackendStrings::getTemplateStrings()['seminar_3'],
195 'value' => 'seminar_3',
196 'isDefault' => false,
197 'position' => 3,
198 ],
199 ],
200 ],
201 ];
202 }
203
204 /**
205 * Get additional information fields
206 *
207 * @return array<int, array<string, mixed>>
208 */
209 private static function getAdditionalInformationFields(): array
210 {
211 return [
212 // Additional Notes
213 [
214 'id' => 14,
215 'fieldIndex' => 6,
216 'type' => 'textarea',
217 'label' => BackendStrings::getTemplateStrings()['additional_notes'],
218 'placeholder' => BackendStrings::getTemplateStrings()['write_additional_notes'],
219 'required' => false,
220 'parentId' => null,
221 'defaultValue' => '',
222 'position' => 6,
223 'rows' => 4,
224 ],
225 ];
226 }
227 }
228