PluginProbe
The Innovative Form Builder – IvyForms / 0.9
The Innovative Form Builder – IvyForms v0.9
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 / DestinationWeddingRSVPFormTemplate.php

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

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