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

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

294 lines 9.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 NetworkingEventFeedbackFormTemplate
8 {
9 /**
10 * Get the Networking Event Feedback Form template
11 *
12 * @return array<string, mixed>
13 */
14 public static function getTemplate(): array
15 {
16 return [
17 'id' => 'networking_event_feedback_form',
18 'name' => BackendStrings::getTemplateStrings()['networking_event_feedback_form'],
19 'description' => BackendStrings::getTemplateStrings()['networking_event_feedback_form_desc'],
20 'category' => 'feedback-forms',
21 'subcategory' => 'event-feedback-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'networking-event-feedback-form.svg',
24 'form_data' => [
25 'name' => BackendStrings::getTemplateStrings()['networking_event_feedback_form'],
26 'published' => 1,
27 'showTitle' => 1,
28 'storeEntries' => 1,
29 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
30 'fields' => array_merge(
31 self::getConnectionsRadioField(),
32 self::getNetworkingValueRatingField(),
33 self::getWhatHelpedCheckboxField(),
34 self::getImprovementTextareaField(),
35 self::getNameField()
36 ),
37 'settings' => []
38 ]
39 ];
40 }
41
42 /**
43 * Radio: Did you make valuable connections?
44 *
45 * @return array<int, array<string, mixed>>
46 */
47 private static function getConnectionsRadioField(): array
48 {
49 return [[
50 'id' => 5,
51 'fieldIndex' => 1,
52 'type' => 'radio',
53 'label' => BackendStrings::getTemplateStrings()['did_make_valuable_connections'],
54 'required' => true,
55 'parentId' => null,
56 'defaultValue' => '',
57 'placeholder' => '',
58 'position' => 1,
59 'fieldOptions' => [
60 [
61 'id' => 1,
62 'label' => BackendStrings::getTemplateStrings()['yes_many'],
63 'value' => 'yes_many',
64 'isDefault' => false,
65 'position' => 1
66 ],
67 [
68 'id' => 2,
69 'label' => BackendStrings::getTemplateStrings()['yes_a_few'],
70 'value' => 'yes_few',
71 'isDefault' => false,
72 'position' => 2
73 ],
74 [
75 'id' => 3,
76 'label' => BackendStrings::getTemplateStrings()['not_really'],
77 'value' => 'not_really',
78 'isDefault' => false,
79 'position' => 3
80 ],
81 [
82 'id' => 4,
83 'label' => BackendStrings::getTemplateStrings()['no_connections'],
84 'value' => 'no',
85 'isDefault' => false,
86 'position' => 4
87 ],
88 ]
89 ]];
90 }
91
92 /**
93 * Rating: Networking value
94 *
95 * @return array<int, array<string, mixed>>
96 */
97 private static function getNetworkingValueRatingField(): array
98 {
99 return [[
100 'id' => 6,
101 'fieldIndex' => 2,
102 'type' => 'rating',
103 'label' => BackendStrings::getTemplateStrings()['networking_value'],
104 'required' => true,
105 'defaultValue' => '',
106 'placeholder' => '',
107 'position' => 2,
108 'labelPosition' => 'default',
109 'ratingIcon' => 'star',
110 'fieldOptions' => self::getStandardRatingOptions(5),
111 'showValues' => false,
112 'showRatingText' => true,
113 ]];
114 }
115
116 /**
117 * Checkbox: What helped with networking?
118 *
119 * @return array<int, array<string, mixed>>
120 */
121 private static function getWhatHelpedCheckboxField(): array
122 {
123 return [[
124 'id' => 12,
125 'fieldIndex' => 3,
126 'type' => 'checkbox',
127 'label' => BackendStrings::getTemplateStrings()['what_helped_with_networking'],
128 'required' => false,
129 'parentId' => null,
130 'defaultValue' => '',
131 'placeholder' => '',
132 'position' => 3,
133 'fieldOptions' => [
134 [
135 'id' => 7,
136 'label' => BackendStrings::getTemplateStrings()['event_format'],
137 'value' => 'event_format',
138 'isDefault' => false,
139 'position' => 1
140 ],
141 [
142 'id' => 8,
143 'label' => BackendStrings::getTemplateStrings()['attendee_quality'],
144 'value' => 'attendee_quality',
145 'isDefault' => false,
146 'position' => 2
147 ],
148 [
149 'id' => 9,
150 'label' => BackendStrings::getTemplateStrings()['structured_activities'],
151 'value' => 'structured_activities',
152 'isDefault' => false,
153 'position' => 3
154 ],
155 [
156 'id' => 10,
157 'label' => BackendStrings::getTemplateStrings()['open_networking_time'],
158 'value' => 'open_networking_time',
159 'isDefault' => false,
160 'position' => 4
161 ],
162 [
163 'id' => 11,
164 'label' => BackendStrings::getTemplateStrings()['venue_or_atmosphere'],
165 'value' => 'venue_atmosphere',
166 'isDefault' => false,
167 'position' => 5
168 ],
169 ]
170 ]];
171 }
172
173 /**
174 * Paragraph: How could networking be improved?
175 *
176 * @return array<int, array<string, mixed>>
177 */
178 private static function getImprovementTextareaField(): array
179 {
180 return [[
181 'id' => 13,
182 'fieldIndex' => 4,
183 'type' => 'textarea',
184 'label' => BackendStrings::getTemplateStrings()['how_could_networking_be_improved'],
185 'placeholder' => BackendStrings::getTemplateStrings()['share_suggestions_to_improve_networking'],
186 'required' => false,
187 'parentId' => null,
188 'defaultValue' => '',
189 'position' => 4,
190 'labelPosition' => 'default',
191 ]];
192 }
193
194 /**
195 * Name field (optional)
196 *
197 * @return array<int, array<string, mixed>>
198 */
199 private static function getNameField(): array
200 {
201 return [
202 // Parent Name field
203 [
204 'id' => 14,
205 'fieldIndex' => 5,
206 'type' => 'name',
207 'label' => BackendStrings::getTemplateStrings()['full_name'],
208 'parentId' => null,
209 'defaultValue' => '',
210 'placeholder' => '',
211 'required' => false,
212 'readonly' => false,
213 'position' => 5,
214 ],
215 // First name - child
216 [
217 'id' => 15,
218 'type' => 'text',
219 'label' => BackendStrings::getNewFormStrings()['first_name'],
220 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_first_name'],
221 'required' => false,
222 'parentId' => 5,
223 'fieldIndex' => 5,
224 'defaultValue' => '',
225 'position' => 1,
226 'optionHide' => false,
227 'description' => '',
228 'settings' => json_encode(['nameFieldType' => 'nameField1']),
229 ],
230 // Last name - child
231 [
232 'id' => 16,
233 'type' => 'text',
234 'label' => BackendStrings::getNewFormStrings()['last_name'],
235 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_last_name'],
236 'required' => false,
237 'parentId' => 5,
238 'fieldIndex' => 5,
239 'defaultValue' => '',
240 'position' => 2,
241 'optionHide' => false,
242 'description' => '',
243 'settings' => json_encode(['nameFieldType' => 'nameField2']),
244 ],
245 ];
246 }
247
248 /**
249 * Standard rating options (1-5)
250 *
251 * @return array<int, array<string, mixed>>
252 */
253 private static function getStandardRatingOptions(int $startId): array
254 {
255 return [
256 [
257 'id' => $startId,
258 'label' => BackendStrings::getNewFormStrings()['good'],
259 'value' => '1',
260 'isDefault' => false,
261 'position' => 1
262 ],
263 [
264 'id' => $startId + 1,
265 'label' => BackendStrings::getNewFormStrings()['nice'],
266 'value' => '2',
267 'isDefault' => false,
268 'position' => 2
269 ],
270 [
271 'id' => $startId + 2,
272 'label' => BackendStrings::getNewFormStrings()['very_good'],
273 'value' => '3',
274 'isDefault' => false,
275 'position' => 3
276 ],
277 [
278 'id' => $startId + 3,
279 'label' => BackendStrings::getNewFormStrings()['awesome'],
280 'value' => '4',
281 'isDefault' => false,
282 'position' => 4
283 ],
284 [
285 'id' => $startId + 4,
286 'label' => BackendStrings::getNewFormStrings()['amazing'],
287 'value' => '5',
288 'isDefault' => false,
289 'position' => 5
290 ],
291 ];
292 }
293 }
294