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

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

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