PluginProbe
The Innovative Form Builder – IvyForms / 0.9
The Innovative Form Builder – IvyForms v0.9
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 0.9, at backend/src/Services/Template/ClientLoyaltyTestimonialReadinessFormTemplate.php

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