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 / WebinarFeedbackFormTemplate.php

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

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