PluginProbe
The Innovative Form Builder – IvyForms / 1.0
The Innovative Form Builder – IvyForms v1.0
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 / EventFeedbackFormTemplate.php

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

327 lines 10.9 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 EventFeedbackFormTemplate
8 {
9 /**
10 * Get the Event Feedback Form template
11 *
12 * @return array<string, mixed>
13 */
14 public static function getTemplate(): array
15 {
16 return [
17 'id' => 'event_feedback_form',
18 'name' => BackendStrings::getTemplateStrings()['event_feedback_form'],
19 'description' => BackendStrings::getTemplateStrings()['event_feedback_form_desc'],
20 'category' => 'feedback-forms',
21 'subcategory' => 'event-feedback-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'event-feedback-form.svg',
24 'form_data' => [
25 'name' => BackendStrings::getTemplateStrings()['event_feedback_form'],
26 'published' => 1,
27 'showTitle' => 1,
28 'storeEntries' => 1,
29 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
30 'fields' => array_merge(
31 self::getEventTypeDropdownField(),
32 self::getExpectationsRadioField(),
33 self::getOverallSatisfactionRatingField(),
34 self::getAspectsCheckboxField(),
35 self::getAdditionalCommentsTextareaField(),
36 self::getEmailField()
37 ),
38 'settings' => []
39 ]
40 ];
41 }
42
43 /**
44 * Event type dropdown field
45 *
46 * @return array<int, array<string, mixed>>
47 */
48 private static function getEventTypeDropdownField(): array
49 {
50 return [[
51 'id' => 7,
52 'fieldIndex' => 1,
53 'type' => 'select',
54 'label' => BackendStrings::getTemplateStrings()['event_type'],
55 'placeholder' => BackendStrings::getTemplateStrings()['select_event_type'],
56 'required' => true,
57 'parentId' => null,
58 'defaultValue' => '',
59 'position' => 1,
60 'fieldOptions' => [
61 [
62 'id' => 1,
63 'label' => BackendStrings::getTemplateStrings()['conference'],
64 'value' => 'conference',
65 'isDefault' => false,
66 'position' => 1,
67 ],
68 [
69 'id' => 2,
70 'label' => BackendStrings::getTemplateStrings()['workshop'],
71 'value' => 'workshop',
72 'isDefault' => false,
73 'position' => 2,
74 ],
75 [
76 'id' => 3,
77 'label' => BackendStrings::getTemplateStrings()['webinar'],
78 'value' => 'webinar',
79 'isDefault' => false,
80 'position' => 3,
81 ],
82 [
83 'id' => 4,
84 'label' => BackendStrings::getTemplateStrings()['networking_event'],
85 'value' => 'networking_event',
86 'isDefault' => false,
87 'position' => 4,
88 ],
89 [
90 'id' => 5,
91 'label' => BackendStrings::getTemplateStrings()['training'],
92 'value' => 'training',
93 'isDefault' => false,
94 'position' => 5,
95 ],
96 [
97 'id' => 6,
98 'label' => BackendStrings::getTemplateStrings()['other'],
99 'value' => 'other',
100 'isDefault' => false,
101 'position' => 6,
102 ],
103 ]
104 ]];
105 }
106
107 /**
108 * Expectations radio field
109 *
110 * @return array<int, array<string, mixed>>
111 */
112 private static function getExpectationsRadioField(): array
113 {
114 return [[
115 'id' => 12,
116 'fieldIndex' => 2,
117 'type' => 'radio',
118 'label' => BackendStrings::getTemplateStrings()['did_meet_expectations'],
119 'required' => true,
120 'parentId' => null,
121 'defaultValue' => '',
122 'placeholder' => '',
123 'position' => 2,
124 'fieldOptions' => [
125 [
126 'id' => 8,
127 'label' => BackendStrings::getTemplateStrings()['exceeded_expectations'],
128 'value' => 'exceeded_expectations',
129 'isDefault' => false,
130 'position' => 1,
131 ],
132 [
133 'id' => 9,
134 'label' => BackendStrings::getTemplateStrings()['met_expectations'],
135 'value' => 'met_expectations',
136 'isDefault' => false,
137 'position' => 2,
138 ],
139 [
140 'id' => 10,
141 'label' => BackendStrings::getTemplateStrings()['partially_met_expectations'],
142 'value' => 'partially_met_expectations',
143 'isDefault' => false,
144 'position' => 3,
145 ],
146 [
147 'id' => 11,
148 'label' => BackendStrings::getTemplateStrings()['did_not_meet_expectations'],
149 'value' => 'did_not_meet_expectations',
150 'isDefault' => false,
151 'position' => 4,
152 ],
153 ]
154 ]];
155 }
156
157 /**
158 * Overall satisfaction rating field
159 *
160 * @return array<int, array<string, mixed>>
161 */
162 private static function getOverallSatisfactionRatingField(): array
163 {
164 return [[
165 'id' => 13,
166 'fieldIndex' => 3,
167 'type' => 'rating',
168 'label' => BackendStrings::getTemplateStrings()['overall_event_satisfaction'],
169 'description' => '',
170 'required' => true,
171 'defaultValue' => '',
172 'placeholder' => '',
173 'position' => 3,
174 'labelPosition' => 'default',
175 'ratingIcon' => 'star',
176 'fieldOptions' => self::getStandardRatingOptions(11),
177 'showValues' => false,
178 'showRatingText' => true,
179 ]];
180 }
181
182 /**
183 * Aspects checkbox field
184 *
185 * @return array<int, array<string, mixed>>
186 */
187 private static function getAspectsCheckboxField(): array
188 {
189 return [[
190 'id' => 19,
191 'fieldIndex' => 4,
192 'type' => 'checkbox',
193 'label' => BackendStrings::getTemplateStrings()['aspects_stood_out'],
194 'required' => false,
195 'parentId' => null,
196 'defaultValue' => '',
197 'placeholder' => '',
198 'position' => 4,
199 'fieldOptions' => [
200 [
201 'id' => 14,
202 'label' => BackendStrings::getTemplateStrings()['content_quality'],
203 'value' => 'content_quality',
204 'isDefault' => false,
205 'position' => 1,
206 ],
207 [
208 'id' => 15,
209 'label' => BackendStrings::getTemplateStrings()['speakers_or_hosts'],
210 'value' => 'speakers_or_hosts',
211 'isDefault' => false,
212 'position' => 2,
213 ],
214 [
215 'id' => 16,
216 'label' => BackendStrings::getTemplateStrings()['organization'],
217 'value' => 'organization',
218 'isDefault' => false,
219 'position' => 3,
220 ],
221 [
222 'id' => 17,
223 'label' => BackendStrings::getTemplateStrings()['venue_or_platform'],
224 'value' => 'venue_or_platform',
225 'isDefault' => false,
226 'position' => 4,
227 ],
228 [
229 'id' => 18,
230 'label' => BackendStrings::getTemplateStrings()['networking_opportunities'],
231 'value' => 'networking_opportunities',
232 'isDefault' => false,
233 'position' => 5,
234 ],
235 ]
236 ]];
237 }
238
239 /**
240 * Additional comments textarea field
241 *
242 * @return array<int, array<string, mixed>>
243 */
244 private static function getAdditionalCommentsTextareaField(): array
245 {
246 return [[
247 'id' => 20,
248 'fieldIndex' => 5,
249 'type' => 'textarea',
250 'label' => BackendStrings::getTemplateStrings()['additional_comments'],
251 'placeholder' => BackendStrings::getTemplateStrings()['share_thoughts_about_event'],
252 'required' => false,
253 'parentId' => null,
254 'defaultValue' => '',
255 'position' => 5,
256 'labelPosition' => 'default',
257 ]];
258 }
259
260 /**
261 * Email field
262 *
263 * @return array<int, array<string, mixed>>
264 */
265 private static function getEmailField(): array
266 {
267 return [[
268 'id' => 21,
269 'fieldIndex' => 6,
270 'type' => 'email',
271 'label' => BackendStrings::getTemplateStrings()['email_address'],
272 'placeholder' => '[email protected]',
273 'required' => false,
274 'parentId' => null,
275 'defaultValue' => '',
276 'position' => 6,
277 'description' => BackendStrings::getTemplateStrings()['follow_up_email_description'],
278 ]];
279 }
280
281 /**
282 * Standard rating options (1-5)
283 *
284 * @return array<int, array<string, mixed>>
285 */
286 private static function getStandardRatingOptions(int $startId): array
287 {
288 return [
289 [
290 'id' => $startId,
291 'label' => BackendStrings::getNewFormStrings()['good'],
292 'value' => '1',
293 'isDefault' => false,
294 'position' => 1,
295 ],
296 [
297 'id' => $startId + 1,
298 'label' => BackendStrings::getNewFormStrings()['nice'],
299 'value' => '2',
300 'isDefault' => false,
301 'position' => 2,
302 ],
303 [
304 'id' => $startId + 2,
305 'label' => BackendStrings::getNewFormStrings()['very_good'],
306 'value' => '3',
307 'isDefault' => false,
308 'position' => 3,
309 ],
310 [
311 'id' => $startId + 3,
312 'label' => BackendStrings::getNewFormStrings()['awesome'],
313 'value' => '4',
314 'isDefault' => false,
315 'position' => 4,
316 ],
317 [
318 'id' => $startId + 4,
319 'label' => BackendStrings::getNewFormStrings()['amazing'],
320 'value' => '5',
321 'isDefault' => false,
322 'position' => 5,
323 ],
324 ];
325 }
326 }
327