PluginProbe
The Innovative Form Builder – IvyForms / trunk
The Innovative Form Builder – IvyForms vtrunk
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 / GardenWeddingRSVPFormTemplate.php

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

403 lines 14.4 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 GardenWeddingRSVPFormTemplate
8 {
9 /**
10 * Garden Wedding RSVP Form Template
11 */
12 /**
13 * Get template metadata (without form_data)
14 *
15 * @return array<string, mixed>
16 */
17 public static function getTemplateMeta(): array
18 {
19 return [
20 'id' => 'garden_wedding_rsvp_form',
21 'name' => BackendStrings::getTemplateStrings()['garden_wedding_rsvp_form'],
22 'description' => BackendStrings::getTemplateStrings()[
23 'garden_wedding_rsvp_form_description'
24 ],
25 'category' => 'event-registration-forms',
26 'subcategory' => 'wedding-forms',
27 'is_pro' => false,
28 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'garden-wedding-rsvp-form.svg'
29 ];
30 }
31
32 /**
33 * Get the full template including form data
34 *
35 * @return array<string, mixed>
36 */
37 public static function getTemplate(): array
38 {
39 return array_merge(
40 self::getTemplateMeta(),
41 [
42 'form_data' => [
43 'name' => BackendStrings::getTemplateStrings()['garden_wedding_rsvp_form'],
44 'published' => 1,
45 'showTitle' => 1,
46 'storeEntries' => 1,
47 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
48 'fields' => array_merge(
49 self::getPersonalInformationFields(),
50 self::getAttendanceFields(),
51 self::getMealPreferencesFields(),
52 self::getAdditionalInformationFields()
53 ),
54 'settings' => []
55 ]
56 ]
57 );
58 }
59
60 /**
61 * Personal information fields (name, email, phone, relationship)
62 *
63 * @return array<int, array<string, mixed>>
64 */
65 private static function getPersonalInformationFields(): array
66 {
67 return [
68 // Full Name
69 [
70 'id' => 1,
71 'fieldIndex' => 1,
72 'type' => 'name',
73 'label' => BackendStrings::getTemplateStrings()['full_name'],
74 'parentId' => null,
75 'defaultValue' => '',
76 'placeholder' => '',
77 'required' => true,
78 'readonly' => false,
79 'position' => 1,
80 ],
81 // First Name - Child of Name Field
82 [
83 'id' => 2,
84 'type' => 'text',
85 'label' => BackendStrings::getTemplateStrings()['first_name'],
86 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_first_name'],
87 'required' => true,
88 'parentId' => 1,
89 'fieldIndex' => 1,
90 'defaultValue' => '',
91 'position' => 1,
92 'optionHide' => false,
93 'description' => '',
94 'settings' => json_encode(['nameFieldType' => 'nameField1']),
95 ],
96 // Last Name - Child of Name Field
97 [
98 'id' => 3,
99 'type' => 'text',
100 'label' => BackendStrings::getTemplateStrings()['last_name'],
101 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_last_name'],
102 'required' => true,
103 'parentId' => 1,
104 'fieldIndex' => 1,
105 'defaultValue' => '',
106 'position' => 2,
107 'optionHide' => false,
108 'description' => '',
109 'settings' => json_encode(['nameFieldType' => 'nameField2']),
110 ],
111 // Email Address
112 [
113 'id' => 4,
114 'fieldIndex' => 2,
115 'type' => 'email',
116 'label' => BackendStrings::getTemplateStrings()['email_address'],
117 'placeholder' => BackendStrings::getTemplateStrings()['email_placeholder'],
118 'required' => true,
119 'parentId' => null,
120 'defaultValue' => '',
121 'position' => 3,
122 ],
123 // Phone Number
124 [
125 'id' => 5,
126 'fieldIndex' => 3,
127 'type' => 'phone',
128 'label' => BackendStrings::getTemplateStrings()['phone_number'],
129 'placeholder' => BackendStrings::getTemplateStrings()['phone_placeholder'],
130 'required' => false,
131 'parentId' => null,
132 'defaultValue' => '',
133 'position' => 4,
134 ],
135 // Relationship to Couple
136 [
137 'id' => 10,
138 'fieldIndex' => 4,
139 'type' => 'select',
140 'label' => BackendStrings::getTemplateStrings()['relationship_to_couple'],
141 'placeholder' => BackendStrings::getTemplateStrings()['select_relationship_to_couple'],
142 'required' => true,
143 'parentId' => null,
144 'defaultValue' => '',
145 'position' => 5,
146 'fieldOptions' => [
147 [
148 'id' => 6,
149 'label' => BackendStrings::getTemplateStrings()['family'],
150 'value' => 'family',
151 'isDefault' => false,
152 'position' => 1
153 ],
154 [
155 'id' => 7,
156 'label' => BackendStrings::getTemplateStrings()['friend'],
157 'value' => 'friend',
158 'isDefault' => false,
159 'position' => 2
160 ],
161 [
162 'id' => 8,
163 'label' => BackendStrings::getTemplateStrings()['colleague'],
164 'value' => 'colleague',
165 'isDefault' => false,
166 'position' => 3
167 ],
168 [
169 'id' => 9,
170 'label' => BackendStrings::getTemplateStrings()['other'],
171 'value' => 'other',
172 'isDefault' => false,
173 'position' => 4
174 ],
175 ]
176 ],
177 ];
178 }
179
180 /**
181 * Attendance fields (will you attend, number of guests, event date)
182 *
183 * @return array<int, array<string, mixed>>
184 */
185 private static function getAttendanceFields(): array
186 {
187 return [
188 // Will you attend?
189 [
190 'id' => 13,
191 'fieldIndex' => 5,
192 'type' => 'radio',
193 'label' => BackendStrings::getTemplateStrings()['will_you_attend'],
194 'placeholder' => '',
195 'required' => true,
196 'parentId' => null,
197 'defaultValue' => '',
198 'position' => 6,
199 'fieldOptions' => [
200 [
201 'id' => 11,
202 'label' => BackendStrings::getTemplateStrings()['yes'],
203 'value' => 'yes',
204 'isDefault' => false,
205 'position' => 1
206 ],
207 [
208 'id' => 12,
209 'label' => BackendStrings::getTemplateStrings()['no'],
210 'value' => 'no',
211 'isDefault' => false,
212 'position' => 2
213 ],
214 ]
215 ],
216 // Number of Guests
217 [
218 'id' => 14,
219 'fieldIndex' => 6,
220 'type' => 'number',
221 'label' => BackendStrings::getTemplateStrings()['number_of_guests'],
222 'placeholder' => BackendStrings::getTemplateStrings()['enter_number_of_attendees'],
223 'required' => true,
224 'parentId' => null,
225 'defaultValue' => '',
226 'position' => 7,
227 ],
228 // Event Date
229 [
230 'id' => 15,
231 'fieldIndex' => 7,
232 'type' => 'date',
233 'label' => BackendStrings::getTemplateStrings()['event_date'],
234 'placeholder' => BackendStrings::getTemplateStrings()['enter_event_date'],
235 'required' => true,
236 'parentId' => null,
237 'defaultValue' => '',
238 'position' => 8,
239 'dateFieldType' => 'picker',
240 'dateFormat' => 'MM/DD/YYYY',
241 ],
242 ];
243 }
244
245 /**
246 * Meal preferences fields (meal preference, dietary restrictions)
247 *
248 * @return array<int, array<string, mixed>>
249 */
250 private static function getMealPreferencesFields(): array
251 {
252 return [
253 // Meal Preference
254 [
255 'id' => 22,
256 'fieldIndex' => 8,
257 'type' => 'select',
258 'label' => BackendStrings::getTemplateStrings()['meal_preference'],
259 'placeholder' => BackendStrings::getTemplateStrings()['select_meal_preference'],
260 'required' => true,
261 'parentId' => null,
262 'defaultValue' => '',
263 'position' => 9,
264 'fieldOptions' => [
265 [
266 'id' => 16,
267 'label' => BackendStrings::getTemplateStrings()['beef'],
268 'value' => 'beef',
269 'isDefault' => false,
270 'position' => 1
271 ],
272 [
273 'id' => 17,
274 'label' => BackendStrings::getTemplateStrings()['chicken'],
275 'value' => 'chicken',
276 'isDefault' => false,
277 'position' => 2
278 ],
279 [
280 'id' => 18,
281 'label' => BackendStrings::getTemplateStrings()['fish'],
282 'value' => 'fish',
283 'isDefault' => false,
284 'position' => 3
285 ],
286 [
287 'id' => 19,
288 'label' => BackendStrings::getTemplateStrings()['vegetarian'],
289 'value' => 'vegetarian',
290 'isDefault' => false,
291 'position' => 4
292 ],
293 [
294 'id' => 20,
295 'label' => BackendStrings::getTemplateStrings()['vegan'],
296 'value' => 'vegan',
297 'isDefault' => false,
298 'position' => 5
299 ],
300 [
301 'id' => 21,
302 'label' => BackendStrings::getTemplateStrings()['other'],
303 'value' => 'other',
304 'isDefault' => false,
305 'position' => 6
306 ],
307 ]
308 ],
309 // Dietary Restrictions or Notes
310 [
311 'id' => 23,
312 'fieldIndex' => 9,
313 'type' => 'textarea',
314 'label' => BackendStrings::getTemplateStrings()['dietary_restrictions_or_notes'],
315 'placeholder' => BackendStrings::getTemplateStrings()['specify_allergies_or_special_requests'],
316 'required' => false,
317 'parentId' => null,
318 'defaultValue' => '',
319 'position' => 10,
320 ],
321 ];
322 }
323
324 /**
325 * Additional information fields (garden tour, bring guests, special messages)
326 *
327 * @return array<int, array<string, mixed>>
328 */
329 private static function getAdditionalInformationFields(): array
330 {
331 return [
332 // Join Garden Tour?
333 [
334 'id' => 26,
335 'fieldIndex' => 10,
336 'type' => 'radio',
337 'label' => BackendStrings::getTemplateStrings()['join_garden_tour'],
338 'placeholder' => '',
339 'required' => false,
340 'parentId' => null,
341 'defaultValue' => '',
342 'position' => 11,
343 'fieldOptions' => [
344 [
345 'id' => 24,
346 'label' => BackendStrings::getTemplateStrings()['yes'],
347 'value' => 'yes',
348 'isDefault' => false,
349 'position' => 1
350 ],
351 [
352 'id' => 25,
353 'label' => BackendStrings::getTemplateStrings()['no'],
354 'value' => 'no',
355 'isDefault' => false,
356 'position' => 2
357 ],
358 ]
359 ],
360 // Bring Guests?
361 [
362 'id' => 29,
363 'fieldIndex' => 11,
364 'type' => 'radio',
365 'label' => BackendStrings::getTemplateStrings()['bring_guests'],
366 'placeholder' => '',
367 'required' => false,
368 'parentId' => null,
369 'defaultValue' => '',
370 'position' => 12,
371 'fieldOptions' => [
372 [
373 'id' => 27,
374 'label' => BackendStrings::getTemplateStrings()['yes'],
375 'value' => 'yes',
376 'isDefault' => false,
377 'position' => 1
378 ],
379 [
380 'id' => 28,
381 'label' => BackendStrings::getTemplateStrings()['no'],
382 'value' => 'no',
383 'isDefault' => false,
384 'position' => 2
385 ],
386 ]
387 ],
388 // Special Messages or Wishes
389 [
390 'id' => 30,
391 'fieldIndex' => 12,
392 'type' => 'textarea',
393 'label' => BackendStrings::getTemplateStrings()['special_messages_or_wishes'],
394 'placeholder' => BackendStrings::getTemplateStrings()['enter_any_additional_notes'],
395 'required' => false,
396 'parentId' => null,
397 'defaultValue' => '',
398 'position' => 13,
399 ],
400 ];
401 }
402 }
403