PluginProbe
The Innovative Form Builder – IvyForms / 0.8.1
The Innovative Form Builder – IvyForms v0.8.1
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 / TechConferenceRegistrationFormTemplate.php

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

247 lines 8.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 // 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 class TechConferenceRegistrationFormTemplate
13 {
14 /**
15 * Get the tech conference registration form template
16 *
17 * @return array<string, mixed>
18 */
19 public static function getTemplate(): array
20 {
21 return [
22 'id' => 'tech_conference_registration_form',
23 'name' => BackendStrings::getTemplateStrings()['tech_conference_registration_form'],
24 'description' => BackendStrings::getTemplateStrings()['tech_conference_registration_form_desc'],
25 'category' => 'event-registration-forms',
26 'subcategory' => 'conference-registration-forms',
27 'is_pro' => false,
28 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'tech-conference-registration-form.svg',
29 'form_data' => [
30 'name' => BackendStrings::getTemplateStrings()['tech_conference_registration_form'],
31 'published' => 1,
32 'showTitle' => 1,
33 'storeEntries' => 1,
34 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
35 'fields' => array_merge(
36 self::getParticipantInformationFields(),
37 self::getTechPreferencesFields(),
38 self::getAdditionalInformationFields()
39 ),
40 'settings' => []
41 ]
42 ];
43 }
44
45 /**
46 * Get participant information fields
47 *
48 * @return array<int, array<string, mixed>>
49 */
50 private static function getParticipantInformationFields(): array
51 {
52 return [
53 // Full Name
54 [
55 'id' => 0,
56 'fieldIndex' => 1,
57 'type' => 'text',
58 'label' => BackendStrings::getTemplateStrings()['full_name'],
59 'placeholder' => BackendStrings::getTemplateStrings()['enter_full_name'] ?? 'Enter your full name',
60 'required' => true,
61 'parentId' => null,
62 'defaultValue' => '',
63 'position' => 1,
64 'validation' => [
65 'required' => true,
66 ],
67 ],
68 // Email Address
69 [
70 'id' => 0,
71 'fieldIndex' => 2,
72 'type' => 'email',
73 'label' => BackendStrings::getTemplateStrings()['email_address'],
74 'placeholder' => '[email protected]',
75 'required' => true,
76 'parentId' => null,
77 'defaultValue' => '',
78 'position' => 2,
79 'validation' => [
80 'required' => true,
81 'email' => true
82 ],
83 ],
84 // Phone Number
85 [
86 'id' => 0,
87 'fieldIndex' => 3,
88 'type' => 'phone',
89 'label' => BackendStrings::getTemplateStrings()['phone_number'],
90 'placeholder' => '+1 (_) _-_',
91 'required' => false,
92 'parentId' => null,
93 'defaultValue' => '',
94 'position' => 3,
95 'phoneAutoDetect' => true,
96 ],
97 ];
98 }
99
100 /**
101 * Get tech preferences fields
102 *
103 * @return array<int, array<string, mixed>>
104 */
105 private static function getTechPreferencesFields(): array
106 {
107 return [
108 // Conference Track Dropdown
109 [
110 'id' => 0,
111 'fieldIndex' => 4,
112 'type' => 'select',
113 'label' => BackendStrings::getTemplateStrings()['conference_track'],
114 'placeholder' => BackendStrings::getTemplateStrings()['select_conference_track'],
115 'required' => true,
116 'parentId' => null,
117 'defaultValue' => '',
118 'position' => 4,
119 'fieldOptions' => [
120 [
121 'id' => 0,
122 'label' => BackendStrings::getTemplateStrings()['ai_machine_learning'],
123 'value' => 'ai_machine_learning',
124 'isDefault' => false,
125 'position' => 1,
126 ],
127 [
128 'id' => 0,
129 'label' => BackendStrings::getTemplateStrings()['software_development'],
130 'value' => 'software_development',
131 'isDefault' => false,
132 'position' => 2,
133 ],
134 [
135 'id' => 0,
136 'label' => BackendStrings::getTemplateStrings()['cybersecurity'],
137 'value' => 'cybersecurity',
138 'isDefault' => false,
139 'position' => 3,
140 ],
141 [
142 'id' => 0,
143 'label' => BackendStrings::getTemplateStrings()['cloud_computing'],
144 'value' => 'cloud_computing',
145 'isDefault' => false,
146 'position' => 4,
147 ],
148 ],
149 ],
150 // Sessions to Attend (Checkbox)
151 [
152 'id' => 0,
153 'fieldIndex' => 5,
154 'type' => 'checkbox',
155 'label' => BackendStrings::getTemplateStrings()['sessions_to_attend'],
156 'placeholder' => '',
157 'required' => false,
158 'parentId' => null,
159 'defaultValue' => '',
160 'position' => 5,
161 'fieldOptions' => [
162 [
163 'id' => 0,
164 'label' => BackendStrings::getTemplateStrings()['session_1'],
165 'value' => 'session_1',
166 'isDefault' => false,
167 'position' => 1,
168 ],
169 [
170 'id' => 0,
171 'label' => BackendStrings::getTemplateStrings()['session_2'],
172 'value' => 'session_2',
173 'isDefault' => false,
174 'position' => 2,
175 ],
176 [
177 'id' => 0,
178 'label' => BackendStrings::getTemplateStrings()['session_3'],
179 'value' => 'session_3',
180 'isDefault' => false,
181 'position' => 3,
182 ],
183 [
184 'id' => 0,
185 'label' => BackendStrings::getTemplateStrings()['session_4'],
186 'value' => 'session_4',
187 'isDefault' => false,
188 'position' => 4,
189 ],
190 ],
191 ],
192 // Participation Type (Radio)
193 [
194 'id' => 0,
195 'fieldIndex' => 6,
196 'type' => 'radio',
197 'label' => BackendStrings::getTemplateStrings()['participation_type'],
198 'placeholder' => '',
199 'required' => true,
200 'parentId' => null,
201 'defaultValue' => '',
202 'position' => 6,
203 'fieldOptions' => [
204 [
205 'id' => 0,
206 'label' => BackendStrings::getTemplateStrings()['in_person'],
207 'value' => 'in_person',
208 'isDefault' => false,
209 'position' => 1,
210 ],
211 [
212 'id' => 0,
213 'label' => BackendStrings::getTemplateStrings()['virtual'],
214 'value' => 'virtual',
215 'isDefault' => false,
216 'position' => 2,
217 ],
218 ],
219 ],
220 ];
221 }
222
223 /**
224 * Get additional information fields
225 *
226 * @return array<int, array<string, mixed>>
227 */
228 private static function getAdditionalInformationFields(): array
229 {
230 return [
231 // Additional Notes
232 [
233 'id' => 0,
234 'fieldIndex' => 7,
235 'type' => 'textarea',
236 'label' => BackendStrings::getTemplateStrings()['additional_notes'],
237 'placeholder' => BackendStrings::getTemplateStrings()['write_additional_notes'],
238 'required' => false,
239 'parentId' => null,
240 'defaultValue' => '',
241 'position' => 7,
242 'rows' => 4,
243 ],
244 ];
245 }
246 }
247