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

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

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