PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.9.1
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.9.1
2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 All 80 releases
ablocks / includes / blocks / form-builder / attributes.php

attributes.php in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.9.1, at includes/blocks/form-builder/attributes.php

573 lines 11.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace ABlocks\Blocks\FormBuilder;
3
4 use ABlocks\Controls\Alignment;
5 use ABlocks\Controls\Typography;
6 use ABlocks\Controls\Range;
7 use ABlocks\Controls\Border;
8 use ABlocks\Controls\Dimensions;
9 use ABlocks\Controls\Link;
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit;
13 }
14
15 $attributes = [
16 'block_id' => array(
17 'type' => 'string',
18 'default' => ''
19 ),
20 'variationSelected' => [
21 'type' => 'boolean',
22 'default' => true,
23 ],
24 'postId' => [
25 'type' => 'number',
26 'default' => '',
27 ],
28 'showLabels' => [
29 'type' => 'boolean',
30 'default' => true
31 ],
32 'loginRedirect' => [
33 'type' => 'boolean',
34 'default' => false
35 ],
36 'registerRedirect' => [
37 'type' => 'boolean',
38 'default' => false
39 ],
40 'navigatorAccess' => [
41 'type' => 'boolean',
42 'default' => false
43 ],
44 'formName' => array(
45 'type' => 'string',
46 'default' => ''
47 ),
48 'formType' => array(
49 'type' => 'string',
50 'default' => ''
51 ),
52 'formActions' => array(
53 'type' => 'array',
54 'default' => []
55 ),
56 'childDetails' => array(
57 'type' => 'array',
58 'default' => []
59 ),
60 'labelColor' => [
61 'type' => 'string',
62 'default' => '#000000'
63 ],
64 'helperTextColor' => [
65 'type' => 'string',
66 'default' => ''
67 ],
68 'customForm' => [
69 'type' => 'boolean',
70 'default' => false
71 ],
72 'inputColor' => [
73 'type' => 'string',
74 'default' => ''
75 ],
76 'inputBgColor' => [
77 'type' => 'string',
78 'default' => 'white'
79 ],
80 'inputPlaceholderColor' => [
81 'type' => 'string',
82 'default' => ''
83 ],
84 'buttonSize' => [
85 'type' => 'string',
86 'default' => 'full-width'
87 ],
88 'buttonColor' => [
89 'type' => 'string',
90 'default' => ''
91 ],
92 'buttonBgColor' => [
93 'type' => 'string',
94 'default' => ''
95 ],
96 'buttonHColor' => [
97 'type' => 'string',
98 'default' => ''
99 ],
100 'buttonBgHColor' => [
101 'type' => 'string',
102 'default' => ''
103 ],
104 'buttonText' => [
105 'type' => 'string',
106 'default' => 'Submit Here',
107 ],
108 // email One settings
109 'emailOneTo' => [
110 'type' => 'string',
111 'default' => 'someone@example.com'
112 ],
113 'emailOneSubject' => [
114 'type' => 'string',
115 'default' => 'New message'
116 ],
117 'emailOneMessage' => [
118 'type' => 'string',
119 'default' => '{all-fields}'
120 ],
121 'emailOneFormEmail' => [
122 'type' => 'string',
123 'default' => 'someone@example.com'
124 ],
125 'emailOneFormName' => [
126 'type' => 'string',
127 'default' => 'Local Name'
128 ],
129 'emailOneReplyTo' => [
130 'type' => 'string',
131 'default' => 'someone@example.com'
132 ],
133 'emailOneCc' => [
134 'type' => 'string',
135 'default' => ''
136 ],
137 'emailOneBcc' => [
138 'type' => 'string',
139 'default' => ''
140 ],
141 'emailOneType' => [
142 'type' => 'string',
143 'default' => 'HTML'
144 ],
145 // email two settings
146 'emailTwoTo' => [
147 'type' => 'string',
148 'default' => 'someone@example.com'
149 ],
150 'emailTwoSubject' => [
151 'type' => 'string',
152 'default' => 'New message'
153 ],
154 'emailTwoMessage' => [
155 'type' => 'string',
156 'default' => '{all-fields}'
157 ],
158 'emailTwoFormEmail' => [
159 'type' => 'string',
160 'default' => 'someone@example.com'
161 ],
162 'emailTwoFormName' => [
163 'type' => 'string',
164 'default' => 'Local Name'
165 ],
166 'emailTwoReplyTo' => [
167 'type' => 'string',
168 'default' => 'someone@example.com'
169 ],
170 'emailTwoCc' => [
171 'type' => 'string',
172 'default' => ''
173 ],
174 'emailTwoBcc' => [
175 'type' => 'string',
176 'default' => ''
177 ],
178 'emailTwoType' => [
179 'type' => 'string',
180 'default' => 'HTML'
181 ],
182 // mailchimp
183 'mailchimpOption' => [
184 'type' => 'string',
185 'default' => 'default'
186 ],
187
188 'mailchimpApiKey' => [
189 'type' => 'string',
190 'default' => ''
191 ],
192 'mailchimpValidateApi' => [
193 'type' => 'boolean',
194 'default' => false,
195 ],
196 'mailchimpListIdOptions' => [
197 'type' => 'array',
198 'default' => [
199 [
200 'label' => 'select options',
201 'value' => 'default',
202 ]
203 ]
204 ],
205 'mailchimpMapFields' => [
206 'type' => 'array',
207 'default' => []
208 ],
209 'mailchimpMapSelects' => [
210 'type' => 'object',
211 ],
212 'mailchimpListId' => [
213 'type' => 'string',
214 'default' => 'default'
215 ],
216 'mailchimpgroupsOptions' => [
217 'type' => 'array',
218 'default' => []
219 ],
220 'mailchimpgroupSelects' => [
221 'type' => 'array',
222 'default' => []
223 ],
224 'mailchimpTags' => [
225 'type' => 'string',
226 'default' => ''
227 ],
228 'mapEmailOptions' => [
229 'type' => 'array',
230 'default' => [
231 [
232 'label' => 'None',
233 'value' => 'default'
234 ]
235 ]
236 ],
237 'mailchimpEmailSelects' => [
238 'type' => 'string',
239 'default' => 'default'
240 ],
241 'mapOtherOptions' => [
242 'type' => 'array',
243 'default' => [
244 [
245 'label' => 'None',
246 'value' => 'default'
247 ]
248 ]
249 ],
250 'showDoubleOpt' => [
251 'type' => 'boolean',
252 'default' => false
253 ],
254 'mailchimpStatus' => [
255 'type' => 'string',
256 'default' => ''
257 ],
258
259 // mailerlite attributes
260 'mailerliteOption' => [
261 'type' => 'string',
262 'default' => 'default'
263 ],
264
265 'mailerliteApiKey' => [
266 'type' => 'string',
267 'default' => ''
268 ],
269 'mailerliteValidateApi' => [
270 'type' => 'boolean',
271 'default' => false,
272 ],
273 'mailerliteGroupId' => [
274 'type' => 'string',
275 'default' => 'default'
276 ],
277 'mailerliteGroupIdOptions' => [
278 'type' => 'array',
279 'default' => [
280 [
281 'label' => 'select options',
282 'value' => 'default',
283 ]
284 ]
285 ],
286 'mailerliteMapFields' => [
287 'type' => 'array',
288 'default' => []
289 ],
290 'mailerliteMapSelects' => [
291 'type' => 'object'
292 ],
293 'allowReSubscribe' => [
294 'type' => 'boolean',
295 'default' => false
296 ],
297
298 // drip attributes
299 'dripOption' => [
300 'type' => 'string',
301 'default' => 'default'
302 ],
303
304 'dripApiKey' => [
305 'type' => 'string',
306 'default' => ''
307 ],
308 'dripValidateApi' => [
309 'type' => 'boolean',
310 'default' => false,
311 ],
312 'dripAccountIdOptions' => [
313 'type' => 'array',
314 'default' => [
315 [
316 'label' => 'select options',
317 'value' => 'default'
318 ]
319 ]
320 ],
321 'dripAccountId' => [
322 'type' => 'string',
323 'default' => 'default'
324 ],
325 'dripMapFields' => [
326 'type' => 'array',
327 'default' => []
328 ],
329 'dripMapSelects' => [
330 'type' => 'object'
331 ],
332 'dripEmailSelects' => [
333 'type' => 'string',
334 'default' => 'default'
335 ],
336 'dripTags' => [
337 'type' => 'string',
338 'default' => ''
339 ],
340 'showFormFields' => [
341 'type' => 'boolean',
342 'default' => false
343 ],
344
345 // getResponse attributes
346 'getResponseOption' => [
347 'type' => 'string',
348 'default' => 'default'
349 ],
350
351 'getResponseApiKey' => [
352 'type' => 'string',
353 'default' => ''
354 ],
355 'getResponseValidateApi' => [
356 'type' => 'boolean',
357 'default' => false,
358 ],
359 'getResponseListId' => [
360 'type' => 'string',
361 'default' => 'default'
362 ],
363 'getResponseListIdOptions' => [
364 'type' => 'array',
365 'default' => [
366 [
367 'label' => 'select options',
368 'value' => 'default'
369 ]
370 ]
371 ],
372 'getResponseMapFields' => [
373 'type' => 'array',
374 'default' => []
375 ],
376 'getResponseMapSelects' => [
377 'type' => 'object'
378 ],
379 'getResponseDayCycle' => [
380 'type' => 'number',
381 'default' => 1,
382 ],
383
384
385
386 // getResponse attributes
387 'convertkitOption' => [
388 'type' => 'string',
389 'default' => 'default'
390 ],
391
392 'convertkitApiKey' => [
393 'type' => 'string',
394 'default' => ''
395 ],
396 'convertkitValidateApi' => [
397 'type' => 'boolean',
398 'default' => false,
399 ],
400 'convertkitFormId' => [
401 'type' => 'string',
402 'default' => 'default'
403 ],
404 'convertkitFormIdOptions' => [
405 'type' => 'array',
406 'default' => [
407 [
408 'label' => 'select options',
409 'value' => 'default',
410 ]
411 ]
412 ],
413 'convertkitMapFields' => [
414 'type' => 'array',
415 'default' => []
416 ],
417 'convertkitMapSelects' => [
418 'type' => 'object'
419 ],
420 'convertkitEmailSelects' => [
421 'type' => 'string',
422 'default' => 'default'
423 ],
424 'convertkitFirstNameSelects' => [
425 'type' => 'string',
426 'default' => 'default'
427 ],
428 'convertkitTagsOptions' => [
429 'type' => 'array',
430 'default' => []
431 ],
432 'convertkitTagsSelects' => [
433 'type' => 'array',
434 'default' => []
435 ],
436 'emailVerification' => [
437 'type' => 'boolean',
438 'default' => false
439 ],
440 'submissionMetaData' => [
441 'type' => 'array',
442 'default' => []
443 ],
444 'navigatorColor' => [
445 'type' => 'string',
446 'default' => '#74777C'
447 ],
448 'navigatorIcon' => [
449 'type' => 'object',
450 'default' => [
451 'viewBox' => '0 0 448 512',
452 'path' => 'M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z'
453 ],
454 ],
455 'navigatorIconShow' => [
456 'type' => 'boolean',
457 'default' => true
458 ],
459 'forgetPasswordLabel' => array(
460 'type' => 'string',
461 'default' => 'Lost Your Password',
462 ),
463 'loginLabel' => array(
464 'type' => 'string',
465 'default' => 'Log in',
466 ),
467 'registerLabel' => array(
468 'type' => 'string',
469 'default' => 'Register',
470 ),
471 'homeLabel' => array(
472 'type' => 'string',
473 'default' => 'Go to home',
474 ),
475 'errorBackground' => array(
476 'type' => 'string',
477 'default' => '#D03739'
478 ),
479 'errorColor' => array(
480 'type' => 'string',
481 'default' => '#ffffff'
482 ),
483 'successColor' => array(
484 'type' => 'string',
485 'default' => '#fffff'
486 ),
487 'successBackground' => array(
488 'type' => 'string',
489 'default' => '#00935B'
490 ),
491 'showErrorDemo' => [
492 'type' => 'boolean',
493 'default' => false,
494 ],
495 'showSuccessDemo' => [
496 'type' => 'boolean',
497 'default' => false,
498 ],
499 'userRoles' => [
500 'type' => 'array',
501 'default' => []
502 ],
503 'roleSlug' => [
504 'type' => 'string',
505 'default' => '',
506 ]
507 ];
508
509 $attributes = array_merge(
510 $attributes,
511 Alignment::get_attribute( 'labelAlignment', true, [ 'value' => 'left' ] ),
512 Alignment::get_attribute( 'inputAlignment', true, [ 'value' => 'left' ] ),
513 Alignment::get_attribute( 'buttonTextAlignment', true, [ 'value' => 'center' ] ),
514 Alignment::get_attribute( 'navigatorAlignment', true, [ 'value' => 'left' ] ),
515 Alignment::get_attribute( 'buttonAlignment', true, [ 'value' => 'flex-end' ] ),
516 Alignment::get_attribute( 'successErrorAlignment', true, [ 'value' => 'center' ] ),
517 Range::get_attribute( [
518 'attributeName' => 'rowsSpacing',
519 'attributeObjectKey' => 'value',
520 'isResponsive' => true,
521 'defaultValue' => 0,
522 ] ),
523 Range::get_attribute( [
524 'attributeName' => 'buttonHeight',
525 'attributeObjectKey' => 'value',
526 'isResponsive' => true,
527 'defaultValue' => 0,
528 'hasUnit' => true,
529 'unitDefaultValue' => 'px',
530 ] ),
531 Range::get_attribute( [
532 'attributeName' => 'labelSpacing',
533 'attributeObjectKey' => 'value',
534 'isResponsive' => true,
535 'defaultValue' => 10,
536 ] ),
537 Range::get_attribute( [
538 'attributeName' => 'helperTextSpacing',
539 'attributeObjectKey' => 'value',
540 'isResponsive' => true,
541 'defaultValue' => 10,
542 ] ),
543 Range::get_attribute( [
544 'attributeName' => 'inputIconPosition',
545 'attributeObjectKey' => 'value',
546 'isResponsive' => false,
547 'defaultValue' => 60,
548 ] ),
549 Range::get_attribute( [
550 'attributeName' => 'navigatorSpacing',
551 'attributeObjectKey' => 'value',
552 'isResponsive' => false,
553 'defaultValue' => 10,
554 ] ),
555 Link::get_attribute( 'link' ),
556 Link::get_attribute( 'webhookLink' ),
557 Typography::get_attribute( 'labelTypography', true ),
558 Typography::get_attribute( 'helperTextTypography', true ),
559 Typography::get_attribute( 'inputTypography', true ),
560 Typography::get_attribute( 'buttonTypography', true ),
561 Typography::get_attribute( 'navigatorTypography', true ),
562 Typography::get_attribute( 'successErrorTypography', true ),
563 Border::get_attribute( 'inputBorder', true ),
564 Border::get_attribute( 'buttonBorder', true ),
565 Dimensions::get_attribute( 'inputPadding', true ),
566 Dimensions::get_attribute( 'navigatorPadding', true ),
567 Dimensions::get_attribute( 'successErrorPadding', true ),
568 Dimensions::get_attribute( 'buttonPadding', true ),
569 );
570
571 return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() );
572
573