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

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

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