PluginProbe
The Innovative Form Builder – IvyForms / 0.9.1
The Innovative Form Builder – IvyForms v0.9.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 / WebinarFeedbackFormTemplate.php

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

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