PluginProbe
The Innovative Form Builder – IvyForms / 1.5
The Innovative Form Builder – IvyForms v1.5
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 / WebinarFeedbackFormTemplate.php

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

337 lines 11.0 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 WebinarFeedbackFormTemplate
8 {
9 /**
10 * Get template metadata (without form_data)
11 *
12 * @return array<string, mixed>
13 */
14 public static function getTemplateMeta(): array
15 {
16 return [
17 'id' => 'webinar_feedback_form',
18 'name' => BackendStrings::getTemplateStrings()['webinar_feedback_form'],
19 'description' => BackendStrings::getTemplateStrings()['webinar_feedback_form_desc'],
20 'category' => 'feedback-forms',
21 'subcategory' => 'event-feedback-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'webinar-feedback-form.svg',
24 ];
25 }
26
27 /**
28 * Get the full template including form data
29 *
30 * @return array<string, mixed>
31 */
32 public static function getTemplate(): array
33 {
34 return array_merge(
35 self::getTemplateMeta(),
36 [
37 'form_data' => [
38 'name' => BackendStrings::getTemplateStrings()['webinar_feedback_form'],
39 'published' => 1,
40 'showTitle' => 1,
41 'storeEntries' => 1,
42 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
43 'fields' => array_merge(
44 self::getWebinarPlatformDropdownField(),
45 self::getAudioVideoQualityRadioField(),
46 self::getOverallExperienceRatingField(),
47 self::getContentValueRatingField(),
48 self::getTechnicalIssuesCheckboxField(),
49 self::getAdditionalFeedbackTextareaField()
50 ),
51 'settings' => []
52 ]
53 ]
54 );
55 }
56
57 /**
58 * Dropdown: Webinar platform
59 *
60 * @return array<int, array<string, mixed>>
61 */
62 private static function getWebinarPlatformDropdownField(): array
63 {
64 return [[
65 'id' => 6,
66 'fieldIndex' => 1,
67 'type' => 'select',
68 'label' => BackendStrings::getTemplateStrings()['webinar_platform'],
69 'placeholder' => BackendStrings::getTemplateStrings()['select_webinar_platform'],
70 'required' => true,
71 'parentId' => null,
72 'defaultValue' => '',
73 'position' => 1,
74 'fieldOptions' => [
75 [
76 'id' => 1, 'label' => BackendStrings::getTemplateStrings()['platform_zoom'],
77 'value' => 'zoom',
78 'isDefault' => false,
79 'position' => 1
80 ],
81 [
82 'id' => 2, 'label' => BackendStrings::getTemplateStrings()['platform_google_meet'],
83 'value' => 'google_meet',
84 'isDefault' => false,
85 'position' => 2
86 ],
87 [
88 'id' => 3,
89 'label' => BackendStrings::getTemplateStrings()['platform_ms_teams'],
90 'value' => 'ms_teams',
91 'isDefault' => false,
92 'position' => 3
93 ],
94 [
95 'id' => 4,
96 'label' => BackendStrings::getTemplateStrings()['platform_webex'],
97 'value' => 'webex',
98 'isDefault' => false,
99 'position' => 4
100 ],
101 [
102 'id' => 5,
103 'label' => BackendStrings::getTemplateStrings()['platform_other'],
104 'value' => 'other',
105 'isDefault' => false,
106 'position' => 5
107 ],
108 ]
109 ]];
110 }
111
112 /**
113 * Rating: Audio & video quality
114 *
115 * @return array<int, array<string, mixed>>
116 */
117 private static function getAudioVideoQualityRadioField(): array
118 {
119 return [[
120 'id' => 11,
121 'fieldIndex' => 2,
122 'type' => 'rating',
123 'label' => BackendStrings::getTemplateStrings()['audio_video_quality'],
124 'required' => true,
125 'parentId' => null,
126 'defaultValue' => '',
127 'placeholder' => '',
128 'position' => 2,
129 'labelPosition' => 'default',
130 'ratingIcon' => 'star',
131 'fieldOptions' => [
132 [
133 'id' => 7,
134 'label' => BackendStrings::getTemplateStrings()['audio_quality_poor'],
135 'value' => 'poor',
136 'isDefault' => false,
137 'position' => 1
138 ],
139 [
140 'id' => 8,
141 'label' => BackendStrings::getTemplateStrings()['audio_quality_fair'],
142 'value' => 'fair',
143 'isDefault' => false,
144 'position' => 2
145 ],
146 [
147 'id' => 9,
148 'label' => BackendStrings::getTemplateStrings()['audio_quality_good'],
149 'value' => 'good',
150 'isDefault' => false,
151 'position' => 3
152 ],
153 [
154 'id' => 10,
155 'label' => BackendStrings::getTemplateStrings()['audio_quality_excellent'],
156 'value' => 'excellent',
157 'isDefault' => false,
158 'position' => 4
159 ],
160 ],
161 'showValues' => false,
162 'showRatingText' => true,
163 ]];
164 }
165
166 /**
167 * Rating: Overall webinar experience
168 *
169 * @return array<int, array<string, mixed>>
170 */
171 private static function getOverallExperienceRatingField(): array
172 {
173 return [[
174 'id' => 12,
175 'fieldIndex' => 3,
176 'type' => 'rating',
177 'label' => BackendStrings::getTemplateStrings()['overall_webinar_experience'],
178 'required' => true,
179 'defaultValue' => '',
180 'placeholder' => '',
181 'position' => 3,
182 'labelPosition' => 'default',
183 'ratingIcon' => 'star',
184 'fieldOptions' => self::getStandardRatingOptions(10),
185 'showValues' => false,
186 'showRatingText' => true,
187 ]];
188 }
189
190 /**
191 * Rating: Content value
192 *
193 * @return array<int, array<string, mixed>>
194 */
195 private static function getContentValueRatingField(): array
196 {
197 return [[
198 'id' => 13,
199 'fieldIndex' => 4,
200 'type' => 'rating',
201 'label' => BackendStrings::getTemplateStrings()['content_value'],
202 'required' => true,
203 'defaultValue' => '',
204 'placeholder' => '',
205 'position' => 4,
206 'labelPosition' => 'default',
207 'ratingIcon' => 'star',
208 'fieldOptions' => self::getStandardRatingOptions(15),
209 'showValues' => false,
210 'showRatingText' => true,
211 ]];
212 }
213
214 /**
215 * Checkbox: Technical issues experienced
216 *
217 * @return array<int, array<string, mixed>>
218 */
219 private static function getTechnicalIssuesCheckboxField(): array
220 {
221 return [[
222 'id' => 19,
223 'fieldIndex' => 5,
224 'type' => 'checkbox',
225 'label' => BackendStrings::getTemplateStrings()['technical_issues_experienced'],
226 'required' => false,
227 'parentId' => null,
228 'defaultValue' => '',
229 'placeholder' => '',
230 'position' => 5,
231 'fieldOptions' => [
232 [
233 'id' => 14,
234 'label' => BackendStrings::getTemplateStrings()['audio_issues'],
235 'value' => 'audio_issues',
236 'isDefault' => false,
237 'position' => 1
238 ],
239 [
240 'id' => 15,
241 'label' => BackendStrings::getTemplateStrings()['video_issues'],
242 'value' => 'video_issues',
243 'isDefault' => false,
244 'position' => 2
245 ],
246 [
247 'id' => 16,
248 'label' => BackendStrings::getTemplateStrings()['connectivity_problems'],
249 'value' => 'connectivity_problems',
250 'isDefault' => false,
251 'position' => 3
252 ],
253 [
254 'id' => 17,
255 'label' => BackendStrings::getTemplateStrings()['screen_sharing_issues'],
256 'value' => 'screen_sharing_issues',
257 'isDefault' => false,
258 'position' => 4
259 ],
260 [
261 'id' => 18,
262 'label' => BackendStrings::getTemplateStrings()['no_issues'],
263 'value' => 'no_issues',
264 'isDefault' => false,
265 'position' => 5
266 ],
267 ]
268 ]];
269 }
270
271 /**
272 * Paragraph: Additional feedback
273 *
274 * @return array<int, array<string, mixed>>
275 */
276 private static function getAdditionalFeedbackTextareaField(): array
277 {
278 return [[
279 'id' => 20,
280 'fieldIndex' => 6,
281 'type' => 'textarea',
282 'label' => BackendStrings::getTemplateStrings()['additional_feedback'],
283 'placeholder' => BackendStrings::getTemplateStrings()['share_additional_feedback'],
284 'required' => false,
285 'parentId' => null,
286 'defaultValue' => '',
287 'position' => 6,
288 'labelPosition' => 'default',
289 ]];
290 }
291
292 /**
293 * Standard rating options (1-5)
294 *
295 * @return array<int, array<string, mixed>>
296 */
297 private static function getStandardRatingOptions(int $startId): array
298 {
299 return [
300 [
301 'id' => $startId, 'label' => BackendStrings::getNewFormStrings()['good'],
302 'value' => '1',
303 'isDefault' => false,
304 'position' => 1
305 ],
306 [
307 'id' => $startId + 1,
308 'label' => BackendStrings::getNewFormStrings()['nice'],
309 'value' => '2',
310 'isDefault' => false,
311 'position' => 2
312 ],
313 [
314 'id' => $startId + 2,
315 'label' => BackendStrings::getNewFormStrings()['very_good'],
316 'value' => '3',
317 'isDefault' => false,
318 'position' => 3
319 ],
320 [
321 'id' => $startId + 3,
322 'label' => BackendStrings::getNewFormStrings()['awesome'],
323 'value' => '4',
324 'isDefault' => false,
325 'position' => 4
326 ],
327 [
328 'id' => $startId + 4,
329 'label' => BackendStrings::getNewFormStrings()['amazing'],
330 'value' => '5',
331 'isDefault' => false,
332 'position' => 5
333 ],
334 ];
335 }
336 }
337