PluginProbe
The Innovative Form Builder – IvyForms / 1.1.1
The Innovative Form Builder – IvyForms v1.1.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 / WorkshopFeedbackFormTemplate.php

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

301 lines 9.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 WorkshopFeedbackFormTemplate
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' => 'workshop_feedback_form',
18 'name' => BackendStrings::getTemplateStrings()['workshop_feedback_form'],
19 'description' => BackendStrings::getTemplateStrings()['workshop_feedback_form_desc'],
20 'category' => 'feedback-forms',
21 'subcategory' => 'event-feedback-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'workshop-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()['workshop_feedback_form'],
39 'published' => 1,
40 'showTitle' => 1,
41 'storeEntries' => 1,
42 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
43 'fields' => array_merge(
44 self::getWorkshopDateField(),
45 self::getFormatEffectivenessRadioField(),
46 self::getContentRelevanceRatingField(),
47 self::getInstructorEffectivenessRatingField(),
48 self::getWhatWorkedCheckboxField(),
49 self::getSuggestionsTextareaField()
50 ),
51 'settings' => []
52 ]
53 ]
54 );
55 }
56
57 /**
58 * Date: Workshop date
59 *
60 * @return array<int, array<string, mixed>>
61 */
62 private static function getWorkshopDateField(): array
63 {
64 return [[
65 'id' => 1,
66 'fieldIndex' => 1,
67 'type' => 'date',
68 'label' => BackendStrings::getTemplateStrings()['workshop_date'],
69 'placeholder' => BackendStrings::getNewFormStrings()['enter_date'],
70 'required' => true,
71 'parentId' => null,
72 'defaultValue' => '',
73 'position' => 1,
74 'dateFieldType' => 'picker',
75 'dateFormat' => 'MM/DD/YYYY',
76 ]];
77 }
78
79 /**
80 * Radio: Workshop format effectiveness
81 *
82 * @return array<int, array<string, mixed>>
83 */
84 private static function getFormatEffectivenessRadioField(): array
85 {
86 return [[
87 'id' => 6,
88 'fieldIndex' => 2,
89 'type' => 'radio',
90 'label' => BackendStrings::getTemplateStrings()['workshop_format_effectiveness'],
91 'required' => true,
92 'parentId' => null,
93 'defaultValue' => '',
94 'placeholder' => '',
95 'position' => 2,
96 'fieldOptions' => [
97 [
98 'id' => 2,
99 'label' => BackendStrings::getTemplateStrings()['workshop_format_very_effective'],
100 'value' => 'very_effective',
101 'isDefault' => false,
102 'position' => 1,
103 ],
104 [
105 'id' => 3,
106 'label' => BackendStrings::getTemplateStrings()['workshop_format_effective'],
107 'value' => 'effective',
108 'isDefault' => false,
109 'position' => 2,
110 ],
111 [
112 'id' => 4,
113 'label' => BackendStrings::getTemplateStrings()['workshop_format_neutral'],
114 'value' => 'neutral',
115 'isDefault' => false,
116 'position' => 3,
117 ],
118 [
119 'id' => 5,
120 'label' => BackendStrings::getTemplateStrings()['workshop_format_ineffective'],
121 'value' => 'ineffective',
122 'isDefault' => false,
123 'position' => 4,
124 ],
125 ]
126 ]];
127 }
128
129 /**
130 * Rating: Content relevance
131 *
132 * @return array<int, array<string, mixed>>
133 */
134 private static function getContentRelevanceRatingField(): array
135 {
136 return [[
137 'id' => 7,
138 'fieldIndex' => 3,
139 'type' => 'rating',
140 'label' => BackendStrings::getTemplateStrings()['content_relevance'],
141 'required' => true,
142 'defaultValue' => '',
143 'placeholder' => '',
144 'position' => 3,
145 'labelPosition' => 'default',
146 'ratingIcon' => 'star',
147 'fieldOptions' => self::getStandardRatingOptions(5),
148 'showValues' => false,
149 'showRatingText' => true,
150 ]];
151 }
152
153 /**
154 * Rating: Instructor effectiveness
155 *
156 * @return array<int, array<string, mixed>>
157 */
158 private static function getInstructorEffectivenessRatingField(): array
159 {
160 return [[
161 'id' => 8,
162 'fieldIndex' => 4,
163 'type' => 'rating',
164 'label' => BackendStrings::getTemplateStrings()['instructor_effectiveness'],
165 'required' => true,
166 'defaultValue' => '',
167 'placeholder' => '',
168 'position' => 4,
169 'labelPosition' => 'default',
170 'ratingIcon' => 'star',
171 'fieldOptions' => self::getStandardRatingOptions(10),
172 'showValues' => false,
173 'showRatingText' => true,
174 ]];
175 }
176
177 /**
178 * Checkbox: What worked well?
179 *
180 * @return array<int, array<string, mixed>>
181 */
182 private static function getWhatWorkedCheckboxField(): array
183 {
184 return [[
185 'id' => 14,
186 'fieldIndex' => 5,
187 'type' => 'checkbox',
188 'label' => BackendStrings::getTemplateStrings()['what_worked_well'],
189 'required' => false,
190 'parentId' => null,
191 'defaultValue' => '',
192 'placeholder' => '',
193 'position' => 5,
194 'fieldOptions' => [
195 [
196 'id' => 9,
197 'label' => BackendStrings::getTemplateStrings()['practical_exercises'],
198 'value' => 'practical_exercises',
199 'isDefault' => false,
200 'position' => 1,
201 ],
202 [
203 'id' => 10,
204 'label' => BackendStrings::getTemplateStrings()['instructor_explanations'],
205 'value' => 'instructor_explanations',
206 'isDefault' => false,
207 'position' => 2,
208 ],
209 [
210 'id' => 11,
211 'label' => BackendStrings::getTemplateStrings()['materials_provided'],
212 'value' => 'materials_provided',
213 'isDefault' => false,
214 'position' => 3,
215 ],
216 [
217 'id' => 12,
218 'label' => BackendStrings::getTemplateStrings()['pace_of_workshop'],
219 'value' => 'pace_of_workshop',
220 'isDefault' => false,
221 'position' => 4,
222 ],
223 [
224 'id' => 13,
225 'label' => BackendStrings::getTemplateStrings()['group_interaction'],
226 'value' => 'group_interaction',
227 'isDefault' => false,
228 'position' => 5,
229 ],
230 ]
231 ]];
232 }
233
234 /**
235 * Paragraph: Suggestions for improvement
236 *
237 * @return array<int, array<string, mixed>>
238 */
239 private static function getSuggestionsTextareaField(): array
240 {
241 return [[
242 'id' => 15,
243 'fieldIndex' => 6,
244 'type' => 'textarea',
245 'label' => BackendStrings::getTemplateStrings()['suggestions_for_improvement'],
246 'placeholder' => BackendStrings::getTemplateStrings()['share_suggestions_for_workshop'],
247 'required' => false,
248 'parentId' => null,
249 'defaultValue' => '',
250 'position' => 6,
251 'labelPosition' => 'default',
252 ]];
253 }
254
255 /**
256 * Standard rating options (1-5)
257 *
258 * @return array<int, array<string, mixed>>
259 */
260 private static function getStandardRatingOptions(int $startId): array
261 {
262 return [
263 [
264 'id' => $startId,
265 'label' => BackendStrings::getNewFormStrings()['good'],
266 'value' => '1',
267 'isDefault' => false,
268 'position' => 1,
269 ],
270 [
271 'id' => $startId + 1,
272 'label' => BackendStrings::getNewFormStrings()['nice'],
273 'value' => '2',
274 'isDefault' => false,
275 'position' => 2,
276 ],
277 [
278 'id' => $startId + 2,
279 'label' => BackendStrings::getNewFormStrings()['very_good'],
280 'value' => '3',
281 'isDefault' => false,
282 'position' => 3,
283 ],
284 [
285 'id' => $startId + 3,
286 'label' => BackendStrings::getNewFormStrings()['awesome'],
287 'value' => '4',
288 'isDefault' => false,
289 'position' => 4,
290 ],
291 [
292 'id' => $startId + 4,
293 'label' => BackendStrings::getNewFormStrings()['amazing'],
294 'value' => '5',
295 'isDefault' => false,
296 'position' => 5,
297 ],
298 ];
299 }
300 }
301