PluginProbe
The Innovative Form Builder – IvyForms / 0.8.2
The Innovative Form Builder – IvyForms v0.8.2
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 / EducationConferenceRegistrationFormTemplate.php

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

234 lines 8.3 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 EducationConferenceRegistrationFormTemplate
13 {
14 /**
15 * Get the education conference registration form template
16 *
17 * @return array<string, mixed>
18 */
19 public static function getTemplate(): array
20 {
21 return [
22 'id' => 'education_conference_registration_form',
23 'name' => BackendStrings::getTemplateStrings()['education_conference_registration_form'],
24 'description' => BackendStrings::getTemplateStrings()['education_conference_registration_form_desc'],
25 'category' => 'event-registration-forms',
26 'subcategory' => 'conference-registration-forms',
27 'is_pro' => false,
28 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'education-conference-registration-form.svg',
29 'form_data' => [
30 'name' => BackendStrings::getTemplateStrings()['education_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::getConferencePreferencesFields(),
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_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 ];
85 }
86
87 /**
88 * Get conference preferences fields
89 *
90 * @return array<int, array<string, mixed>>
91 */
92 private static function getConferencePreferencesFields(): array
93 {
94 return [
95 // Role Dropdown
96 [
97 'id' => 0,
98 'fieldIndex' => 3,
99 'type' => 'select',
100 'label' => BackendStrings::getTemplateStrings()['role'],
101 'placeholder' => BackendStrings::getTemplateStrings()['select_role'],
102 'required' => true,
103 'parentId' => null,
104 'defaultValue' => '',
105 'position' => 3,
106 'fieldOptions' => [
107 [
108 'id' => 0,
109 'label' => BackendStrings::getTemplateStrings()['teacher'],
110 'value' => 'teacher',
111 'isDefault' => false,
112 'position' => 1,
113 ],
114 [
115 'id' => 0,
116 'label' => BackendStrings::getTemplateStrings()['principal'],
117 'value' => 'principal',
118 'isDefault' => false,
119 'position' => 2,
120 ],
121 [
122 'id' => 0,
123 'label' => BackendStrings::getTemplateStrings()['researcher'],
124 'value' => 'researcher',
125 'isDefault' => false,
126 'position' => 3,
127 ],
128 [
129 'id' => 0,
130 'label' => BackendStrings::getTemplateStrings()['student'],
131 'value' => 'student',
132 'isDefault' => false,
133 'position' => 4,
134 ],
135 [
136 'id' => 0,
137 'label' => BackendStrings::getTemplateStrings()['other'],
138 'value' => 'other',
139 'isDefault' => false,
140 'position' => 5,
141 ],
142 ],
143 ],
144 // Sessions to Attend (Multidropdown)
145 [
146 'id' => 0,
147 'fieldIndex' => 4,
148 'type' => 'multi-select',
149 'label' => BackendStrings::getTemplateStrings()['sessions_to_attend'],
150 'placeholder' => BackendStrings::getTemplateStrings()['select_sessions'],
151 'required' => false,
152 'parentId' => null,
153 'defaultValue' => '',
154 'position' => 4,
155 'fieldOptions' => [
156 [
157 'id' => 0,
158 'label' => BackendStrings::getTemplateStrings()['session_1'],
159 'value' => 'session_1',
160 'isDefault' => false,
161 'position' => 1,
162 ],
163 [
164 'id' => 0,
165 'label' => BackendStrings::getTemplateStrings()['session_2'],
166 'value' => 'session_2',
167 'isDefault' => false,
168 'position' => 2,
169 ],
170 [
171 'id' => 0,
172 'label' => BackendStrings::getTemplateStrings()['session_3'],
173 'value' => 'session_3',
174 'isDefault' => false,
175 'position' => 3,
176 ],
177 ],
178 ],
179 // Participation Type (Radio)
180 [
181 'id' => 0,
182 'fieldIndex' => 5,
183 'type' => 'radio',
184 'label' => BackendStrings::getTemplateStrings()['participation_type'],
185 'placeholder' => '',
186 'required' => true,
187 'parentId' => null,
188 'defaultValue' => '',
189 'position' => 5,
190 'fieldOptions' => [
191 [
192 'id' => 0,
193 'label' => BackendStrings::getTemplateStrings()['in_person'],
194 'value' => 'in_person',
195 'isDefault' => false,
196 'position' => 1,
197 ],
198 [
199 'id' => 0,
200 'label' => BackendStrings::getTemplateStrings()['virtual'],
201 'value' => 'virtual',
202 'isDefault' => false,
203 'position' => 2,
204 ],
205 ],
206 ],
207 ];
208 }
209
210 /**
211 * Get additional information fields
212 *
213 * @return array<int, array<string, mixed>>
214 */
215 private static function getAdditionalInformationFields(): array
216 {
217 return [
218 // Questions or Comments
219 [
220 'id' => 0,
221 'fieldIndex' => 6,
222 'type' => 'textarea',
223 'label' => BackendStrings::getTemplateStrings()['questions_or_comments'],
224 'placeholder' => BackendStrings::getTemplateStrings()['write_questions_or_comments_for_organizers'],
225 'required' => false,
226 'parentId' => null,
227 'defaultValue' => '',
228 'position' => 6,
229 'rows' => 4,
230 ],
231 ];
232 }
233 }
234