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

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

268 lines 8.8 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 ConferenceFeedbackFormTemplate
8 {
9 /**
10 * Get the Conference Feedback Form template
11 *
12 * @return array<string, mixed>
13 */
14 public static function getTemplate(): array
15 {
16 return [
17 'id' => 'conference_feedback_form',
18 'name' => BackendStrings::getTemplateStrings()['conference_feedback_form'],
19 'description' => BackendStrings::getTemplateStrings()['conference_feedback_form_desc'],
20 'category' => 'feedback-forms',
21 'subcategory' => 'event-feedback-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'conference-feedback-form.svg',
24 'form_data' => [
25 'name' => BackendStrings::getTemplateStrings()['conference_feedback_form'],
26 'published' => 1,
27 'showTitle' => 1,
28 'storeEntries' => 1,
29 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
30 'fields' => array_merge(
31 self::getSessionsAttendedField(),
32 self::getSpeakerQualityRatingField(),
33 self::getVenueLogisticsRatingField(),
34 self::getOverallOrganizationDropdownField(),
35 self::getImprovementTextareaField()
36 ),
37 'settings' => []
38 ]
39 ];
40 }
41
42 /**
43 * Checkbox: Sessions attended
44 *
45 * @return array<int, array<string, mixed>>
46 */
47 private static function getSessionsAttendedField(): array
48 {
49 return [[
50 'id' => 6,
51 'fieldIndex' => 1,
52 'type' => 'checkbox',
53 'label' => BackendStrings::getTemplateStrings()['sessions_attended'],
54 'required' => true,
55 'parentId' => null,
56 'defaultValue' => '',
57 'placeholder' => '',
58 'position' => 1,
59 'fieldOptions' => [
60 [
61 'id' => 1,
62 'label' => BackendStrings::getTemplateStrings()['keynote_sessions'],
63 'value' => 'keynote_sessions',
64 'isDefault' => false,
65 'position' => 1,
66 ],
67 [
68 'id' => 2,
69 'label' => BackendStrings::getTemplateStrings()['technical_sessions'],
70 'value' => 'technical_sessions',
71 'isDefault' => false,
72 'position' => 2,
73 ],
74 [
75 'id' => 3,
76 'label' => BackendStrings::getTemplateStrings()['panel_discussions'],
77 'value' => 'panel_discussions',
78 'isDefault' => false,
79 'position' => 3,
80 ],
81 [
82 'id' => 4,
83 'label' => BackendStrings::getTemplateStrings()['workshops_sessions'],
84 'value' => 'workshops',
85 'isDefault' => false,
86 'position' => 4,
87 ],
88 [
89 'id' => 5,
90 'label' => BackendStrings::getTemplateStrings()['networking_sessions'],
91 'value' => 'networking_sessions',
92 'isDefault' => false,
93 'position' => 5,
94 ],
95 ]
96 ]];
97 }
98
99 /**
100 * Rating: Speaker quality
101 *
102 * @return array<int, array<string, mixed>>
103 */
104 private static function getSpeakerQualityRatingField(): array
105 {
106 return [[
107 'id' => 7,
108 'fieldIndex' => 2,
109 'type' => 'rating',
110 'label' => BackendStrings::getTemplateStrings()['speaker_quality'],
111 'required' => true,
112 'defaultValue' => '',
113 'placeholder' => '',
114 'position' => 2,
115 'labelPosition' => 'default',
116 'ratingIcon' => 'star',
117 'fieldOptions' => self::getStandardRatingOptions(1),
118 'showValues' => false,
119 'showRatingText' => true,
120 ]];
121 }
122
123 /**
124 * Rating: Venue & logistics
125 *
126 * @return array<int, array<string, mixed>>
127 */
128 private static function getVenueLogisticsRatingField(): array
129 {
130 return [[
131 'id' => 8,
132 'fieldIndex' => 3,
133 'type' => 'rating',
134 'label' => BackendStrings::getTemplateStrings()['venue_and_logistics'],
135 'required' => true,
136 'defaultValue' => '',
137 'placeholder' => '',
138 'position' => 3,
139 'labelPosition' => 'default',
140 'ratingIcon' => 'star',
141 'fieldOptions' => self::getStandardRatingOptions(6),
142 'showValues' => false,
143 'showRatingText' => true,
144 ]];
145 }
146
147 /**
148 * Rating: Overall conference organization
149 *
150 * @return array<int, array<string, mixed>>
151 */
152 private static function getOverallOrganizationDropdownField(): array
153 {
154 return [[
155 'id' => 13,
156 'fieldIndex' => 4,
157 'type' => 'rating',
158 'label' => BackendStrings::getTemplateStrings()['overall_conference_organization'],
159 'required' => true,
160 'parentId' => null,
161 'defaultValue' => '',
162 'placeholder' => '',
163 'position' => 4,
164 'labelPosition' => 'default',
165 'ratingIcon' => 'star',
166 'fieldOptions' => [
167 [
168 'id' => 9,
169 'label' => BackendStrings::getTemplateStrings()['organization_poor'],
170 'value' => 'poor',
171 'isDefault' => false,
172 'position' => 1,
173 ],
174 [
175 'id' => 10,
176 'label' => BackendStrings::getTemplateStrings()['organization_average'],
177 'value' => 'average',
178 'isDefault' => false,
179 'position' => 2,
180 ],
181 [
182 'id' => 11,
183 'label' => BackendStrings::getTemplateStrings()['organization_good'],
184 'value' => 'good',
185 'isDefault' => false,
186 'position' => 3,
187 ],
188 [
189 'id' => 12,
190 'label' => BackendStrings::getTemplateStrings()['organization_excellent'],
191 'value' => 'excellent',
192 'isDefault' => false,
193 'position' => 4,
194 ],
195 ],
196 'showValues' => false,
197 'showRatingText' => true,
198 ]];
199 }
200
201 /**
202 * Paragraph: What could be improved?
203 *
204 * @return array<int, array<string, mixed>>
205 */
206 private static function getImprovementTextareaField(): array
207 {
208 return [[
209 'id' => 14,
210 'fieldIndex' => 5,
211 'type' => 'textarea',
212 'label' => BackendStrings::getTemplateStrings()['what_could_be_improved'],
213 'placeholder' => BackendStrings::getTemplateStrings()['share_what_could_be_improved'],
214 'required' => false,
215 'parentId' => null,
216 'defaultValue' => '',
217 'position' => 5,
218 'labelPosition' => 'default',
219 ]];
220 }
221
222 /**
223 * Standard rating options (1-5)
224 *
225 * @return array<int, array<string, mixed>>
226 */
227 private static function getStandardRatingOptions(int $startId): array
228 {
229 return [
230 [
231 'id' => $startId,
232 'label' => BackendStrings::getNewFormStrings()['good'],
233 'value' => '1',
234 'isDefault' => false,
235 'position' => 1,
236 ],
237 [
238 'id' => $startId + 1,
239 'label' => BackendStrings::getNewFormStrings()['nice'],
240 'value' => '2',
241 'isDefault' => false,
242 'position' => 2,
243 ],
244 [
245 'id' => $startId + 2,
246 'label' => BackendStrings::getNewFormStrings()['very_good'],
247 'value' => '3',
248 'isDefault' => false,
249 'position' => 3,
250 ],
251 [
252 'id' => $startId + 3,
253 'label' => BackendStrings::getNewFormStrings()['awesome'],
254 'value' => '4',
255 'isDefault' => false,
256 'position' => 4,
257 ],
258 [
259 'id' => $startId + 4,
260 'label' => BackendStrings::getNewFormStrings()['amazing'],
261 'value' => '5',
262 'isDefault' => false,
263 'position' => 5,
264 ],
265 ];
266 }
267 }
268