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

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

382 lines 12.5 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 ClientLoyaltyTestimonialReadinessFormTemplate
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' => 'client_loyalty_testimonial_readiness_form',
18 'name' => BackendStrings::getTemplateStrings()['client_loyalty_testimonial_readiness_form'],
19 'description' => BackendStrings::getTemplateStrings()['client_loyalty_testimonial_readiness_form_desc'],
20 'category' => 'feedback-forms',
21 'subcategory' => 'client-feedback-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'client-loyalty-testimonial-readiness-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()['client_loyalty_testimonial_readiness_form'],
39 'published' => 1,
40 'showTitle' => 1,
41 'storeEntries' => 1,
42 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
43 'fields' => array_merge(
44 self::getLoyaltyLikelihoodRatingField(),
45 self::getOverallExperienceRatingField(),
46 self::getRecommendRadioField(),
47 self::getValueMostCheckboxField(),
48 self::getLoyaltyParagraphField(),
49 self::getTestimonialCheckboxField()
50 ),
51 'settings' => []
52 ]
53 ]
54 );
55 }
56
57 /**
58 * Likelihood to continue working rating
59 *
60 * @return array<int, array<string, mixed>>
61 */
62 private static function getLoyaltyLikelihoodRatingField(): array
63 {
64 return [[
65 'id' => 1,
66 'fieldIndex' => 1,
67 'type' => 'rating',
68 'label' => BackendStrings::getTemplateStrings()['likelihood_continue_working'],
69 'required' => true,
70 'defaultValue' => '',
71 'placeholder' => '',
72 'position' => 1,
73 'labelPosition' => 'default',
74 'ratingIcon' => 'star',
75 'fieldOptions' => self::getLoyaltyRatingOptions(1),
76 'showValues' => false,
77 'showRatingText' => true,
78 ]];
79 }
80
81 /**
82 * Overall experience rating
83 *
84 * @return array<int, array<string, mixed>>
85 */
86 private static function getOverallExperienceRatingField(): array
87 {
88 return [[
89 'id' => 2,
90 'fieldIndex' => 2,
91 'type' => 'rating',
92 'label' => BackendStrings::getTemplateStrings()['overall_experience'],
93 'required' => true,
94 'defaultValue' => '',
95 'placeholder' => '',
96 'position' => 2,
97 'labelPosition' => 'default',
98 'ratingIcon' => 'star',
99 'fieldOptions' => self::getStandardRatingOptions(6),
100 'showValues' => false,
101 'showRatingText' => true,
102 ]];
103 }
104
105 /**
106 * Recommendation radio field
107 *
108 * @return array<int, array<string, mixed>>
109 */
110 private static function getRecommendRadioField(): array
111 {
112 return [[
113 'id' => 8,
114 'fieldIndex' => 3,
115 'type' => 'radio',
116 'label' => BackendStrings::getTemplateStrings()['would_you_recommend_us'],
117 'required' => true,
118 'parentId' => null,
119 'defaultValue' => '',
120 'placeholder' => '',
121 'position' => 3,
122 'fieldOptions' => [
123 [
124 'id' => 3,
125 'label' => BackendStrings::getTemplateStrings()['definitely'],
126 'value' => 'definitely',
127 'isDefault' => false,
128 'position' => 1
129 ],
130 [
131 'id' => 4,
132 'label' => BackendStrings::getTemplateStrings()['probably'],
133 'value' => 'probably',
134 'isDefault' => false,
135 'position' => 2
136 ],
137 [
138 'id' => 5,
139 'label' => BackendStrings::getTemplateStrings()['not_sure'],
140 'value' => 'not_sure',
141 'isDefault' => false,
142 'position' => 3
143 ],
144 [
145 'id' => 6,
146 'label' => BackendStrings::getTemplateStrings()['probably_not'],
147 'value' => 'probably_not',
148 'isDefault' => false,
149 'position' => 4
150 ],
151 [
152 'id' => 7,
153 'label' => BackendStrings::getTemplateStrings()['definitely_not'],
154 'value' => 'definitely_not',
155 'isDefault' => false,
156 'position' => 5
157 ],
158 ]
159 ]];
160 }
161
162 /**
163 * Value most checkbox field
164 *
165 * @return array<int, array<string, mixed>>
166 */
167 private static function getValueMostCheckboxField(): array
168 {
169 return [[
170 'id' => 14,
171 'fieldIndex' => 4,
172 'type' => 'checkbox',
173 'label' => BackendStrings::getTemplateStrings()['value_most_about_working'],
174 'required' => false,
175 'parentId' => null,
176 'defaultValue' => '',
177 'placeholder' => '',
178 'position' => 4,
179 'fieldOptions' => [
180 [
181 'id' => 9,
182 'label' => BackendStrings::getTemplateStrings()['quality_of_work'],
183 'value' => 'quality_of_work',
184 'isDefault' => false,
185 'position' => 1
186 ],
187 [
188 'id' => 10,
189 'label' => BackendStrings::getTemplateStrings()['reliability'],
190 'value' => 'reliability',
191 'isDefault' => false,
192 'position' => 2
193 ],
194 [
195 'id' => 11,
196 'label' => BackendStrings::getTemplateStrings()['communication'],
197 'value' => 'communication',
198 'isDefault' => false,
199 'position' => 3
200 ],
201 [
202 'id' => 12,
203 'label' => BackendStrings::getTemplateStrings()['expertise'],
204 'value' => 'expertise',
205 'isDefault' => false,
206 'position' => 4
207 ],
208 [
209 'id' => 13,
210 'label' => BackendStrings::getTemplateStrings()['results'],
211 'value' => 'results',
212 'isDefault' => false,
213 'position' => 5
214 ],
215 ]
216 ]];
217 }
218
219 /**
220 * Loyalty improvement paragraph
221 *
222 * @return array<int, array<string, mixed>>
223 */
224 private static function getLoyaltyParagraphField(): array
225 {
226 return [[
227 'id' => 15,
228 'fieldIndex' => 5,
229 'type' => 'textarea',
230 'label' => BackendStrings::getTemplateStrings()['what_could_make_you_more_loyal'],
231 'placeholder' => BackendStrings::getTemplateStrings()['what_could_make_you_more_loyal_placeholder'],
232 'required' => false,
233 'parentId' => null,
234 'defaultValue' => '',
235 'position' => 5,
236 'labelPosition' => 'default',
237 ]];
238 }
239
240 /**
241 * Testimonial readiness checkbox field
242 *
243 * @return array<int, array<string, mixed>>
244 */
245 private static function getTestimonialCheckboxField(): array
246 {
247 return [[
248 'id' => 20,
249 'fieldIndex' => 6,
250 'type' => 'checkbox',
251 'label' => BackendStrings::getTemplateStrings()['open_to_providing_testimonial'],
252 'required' => false,
253 'parentId' => null,
254 'defaultValue' => '',
255 'placeholder' => '',
256 'position' => 6,
257 'fieldOptions' => [
258 [
259 'id' => 16,
260 'label' => BackendStrings::getTemplateStrings()['yes_written_testimonial'],
261 'value' => 'yes_written_testimonial',
262 'isDefault' => false,
263 'position' => 1
264 ],
265 [
266 'id' => 17,
267 'label' => BackendStrings::getTemplateStrings()['yes_video_testimonial'],
268 'value' => 'yes_video_testimonial',
269 'isDefault' => false,
270 'position' => 2
271 ],
272 [
273 'id' => 18,
274 'label' => BackendStrings::getTemplateStrings()['yes_case_study'],
275 'value' => 'yes_case_study',
276 'isDefault' => false,
277 'position' => 3
278 ],
279 [
280 'id' => 19,
281 'label' => BackendStrings::getTemplateStrings()['not_at_this_time'],
282 'value' => 'not_at_this_time',
283 'isDefault' => false,
284 'position' => 4
285 ],
286 ]
287 ]];
288 }
289
290 /**
291 * Likelihood rating options (Very unlikely is 1 star)
292 *
293 * @return array<int, array<string, mixed>>
294 */
295 private static function getLoyaltyRatingOptions(int $startId): array
296 {
297 return [
298 [
299 'id' => $startId,
300 'label' => BackendStrings::getTemplateStrings()['very_unlikely'],
301 'value' => 'very_unlikely',
302 'isDefault' => false,
303 'position' => 1
304 ],
305 [
306 'id' => $startId + 1,
307 'label' => BackendStrings::getTemplateStrings()['unlikely'],
308 'value' => 'unlikely',
309 'isDefault' => false,
310 'position' => 2
311 ],
312 [
313 'id' => $startId + 2,
314 'label' => BackendStrings::getTemplateStrings()['not_sure'],
315 'value' => 'not_sure',
316 'isDefault' => false,
317 'position' => 3
318 ],
319 [
320 'id' => $startId + 3,
321 'label' => BackendStrings::getTemplateStrings()['likely'],
322 'value' => 'likely',
323 'isDefault' => false,
324 'position' => 4
325 ],
326 [
327 'id' => $startId + 4,
328 'label' => BackendStrings::getTemplateStrings()['very_likely'],
329 'value' => 'very_likely',
330 'isDefault' => false,
331 'position' => 5
332 ],
333 ];
334 }
335
336 /**
337 * Standard rating options
338 *
339 * @return array<int, array<string, mixed>>
340 */
341 private static function getStandardRatingOptions(int $startId): array
342 {
343 return [
344 [
345 'id' => $startId,
346 'label' => BackendStrings::getNewFormStrings()['good'],
347 'value' => '1',
348 'isDefault' => false,
349 'position' => 1
350 ],
351 [
352 'id' => $startId + 1,
353 'label' => BackendStrings::getNewFormStrings()['nice'],
354 'value' => '2',
355 'isDefault' => false,
356 'position' => 2
357 ],
358 [
359 'id' => $startId + 2,
360 'label' => BackendStrings::getNewFormStrings()['very_good'],
361 'value' => '3',
362 'isDefault' => false,
363 'position' => 3
364 ],
365 [
366 'id' => $startId + 3,
367 'label' => BackendStrings::getNewFormStrings()['awesome'],
368 'value' => '4',
369 'isDefault' => false,
370 'position' => 4
371 ],
372 [
373 'id' => $startId + 4,
374 'label' => BackendStrings::getNewFormStrings()['amazing'],
375 'value' => '5',
376 'isDefault' => false,
377 'position' => 5
378 ],
379 ];
380 }
381 }
382