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

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

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