PluginProbe
WPBot – ChatBot Conversational Forms / 1.4.7
WPBot – ChatBot Conversational Forms v1.4.7
1.5.0 1.4.8 1.4.7 trunk 0.9.2 0.9.3 0.9.5 0.9.6 0.9.7 0.9.8 0.9.9 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.6 1.1.7 1.1.8 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 All 36 releases
conversational-forms / classes / fields.php

fields.php in WPBot – ChatBot Conversational Forms 1.4.7, at classes/fields.php

652 lines 24.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Access to field definitions
4 *
5 * @package Caldera_Forms Modified by QuantumCloud
6 * @author Josh Pollock <Josh@CalderaWP.com>
7 * @license GPL-2.0+
8 * @link
9 * @copyright 2016 CalderaWP LLC
10 */
11 class Qcformbuilder_Forms_Fields {
12
13 /**
14 * Get all field definitions
15 *
16 * @since 1.5.0
17 *
18 * @return array
19 */
20 public static function get_all() {
21
22 /**
23 * Register or remove field types
24 *
25 * @since unknown
26 *
27 * @param array $field_types Field types
28 */
29 $field_types = apply_filters( 'qcformbuilder_forms_get_field_types', self::internal_types() );
30
31
32 if ( ! empty( $field_types ) ) {
33 foreach ( $field_types as $fieldType => $fieldConfig ) {
34 // check for a viewer
35 if ( isset( $fieldConfig[ 'viewer' ] ) ) {
36 add_filter( 'qcformbuilder_forms_view_field_' . $fieldType, $fieldConfig[ 'viewer' ], 10, 3 );
37 }
38 }
39 }
40
41 return $field_types;
42
43 }
44
45 /**
46 * Get definition of one field
47 *
48 * @since 1.5.0
49 *
50 * @param string $type Field type
51 *
52 * @return array
53 */
54 public static function definition( $type ){
55 $fields = self::get_all();
56 if( array_key_exists( $type, $fields ) ){
57 return $fields[ $type ];
58 }
59
60 return array();
61
62 }
63
64 /**
65 * Check if a field definition has defined a specific "not support" argument
66 *
67 * Use to check if field of $type does $not_support
68 *
69 * @since 1.5.0
70 *
71 * @param string $type The field type
72 * @param string $not_support The not support argument, for example "entry_list"
73 *
74 * @return bool|null True if not supported, false if not not supported. Null if invalid field type
75 */
76 public static function not_support( $type, $not_support ){
77 $field = self::definition( $type );
78 if( ! empty( $field ) ){
79 if( ! isset( $field[ 'setup' ], $field[ 'setup' ][ 'not_supported' ] ) ){
80 return false;
81 }
82 if( ! empty( $field[ 'setup' ][ 'not_supported' ] ) && in_array( $not_support, $field[ 'setup' ][ 'not_supported' ] ) ){
83 return true;
84 }
85
86 return false;
87 }
88
89 return null;
90
91 }
92
93 /**
94 * Get internal field types without filter
95 *
96 * @since 1.5.0
97 *
98 * @return array
99 */
100 public static function internal_types() {
101 $deprecated = __( 'Discontinued', 'qcformbuilder-forms' );
102 $internal_fields = array(
103 //basic
104 'text' => array(
105 "field" => __( 'Simple Text', 'qcformbuilder-forms' ),
106 "description" => __( 'Simple Text Input Field', 'qcformbuilder-forms' ),
107 "file" => WFBCORE_PATH . "fields/generic-input.php",
108 "category" => __( 'Basic', 'qcformbuilder-forms' ),
109 "setup" => array(
110 "template" => WFBCORE_PATH . "fields/text/config.php",
111 "preview" => WFBCORE_PATH . "fields/text/preview.php"
112 ),
113
114 ),
115 /*
116 'hidden' => array(
117 "field" => __( 'Hidden', 'qcformbuilder-forms' ),
118 "description" => __( 'Hidden', 'qcformbuilder-forms' ),
119 "file" => WFBCORE_PATH . "fields/hidden/field.php",
120 "category" => __( 'Basic', 'qcformbuilder-forms' ),
121 "static" => true,
122 "setup" => array(
123 "preview" => WFBCORE_PATH . "fields/hidden/preview.php",
124 "template" => WFBCORE_PATH . "fields/hidden/setup.php",
125 "not_supported" => array(
126 'hide_label',
127 'caption',
128 'required',
129 )
130 )
131 ),
132
133 'email' => array(
134 "field" => __( 'Email Address', 'qcformbuilder-forms' ),
135 "description" => __( 'Email Address', 'qcformbuilder-forms' ),
136 'icon' => WFBCORE_URL . 'assets/build/images/envelope-o.svg',
137 "file" => WFBCORE_PATH . "fields/generic-input.php",
138 "category" => __( 'Basic', 'qcformbuilder-forms' ),
139 "setup" => array(
140 "preview" => WFBCORE_PATH . "fields/email/preview.php",
141 "template" => WFBCORE_PATH . "fields/email/config.php"
142 )
143 ),
144
145 'button' => array(
146 "field" => __( 'Button', 'qcformbuilder-forms' ),
147 "description" => __( 'Button, Submit and Reset types', 'qcformbuilder-forms' ),
148 "file" => WFBCORE_PATH . "fields/button/field.php",
149 "category" => __( 'Basic', 'qcformbuilder-forms' ),
150 "capture" => false,
151 "setup" => array(
152 "template" => WFBCORE_PATH . "fields/button/config_template.php",
153 "preview" => WFBCORE_PATH . "fields/button/preview.php",
154 "default" => array(
155 'class' => 'btn btn-default',
156 'type' => 'submit'
157 ),
158 "not_supported" => array(
159 'hide_label',
160 'caption',
161 'required',
162 'entry_list'
163 )
164 )
165 ),
166 'phone_better' => array(
167 "field" => __( 'Phone Number (Better)', 'qcformbuilder-forms' ),
168 "description" => __( 'Phone number with advanced options and international formatting', 'qcformbuilder-forms' ),
169 "file" => WFBCORE_PATH . "fields/generic-input.php",
170 "category" => __( 'Basic', 'qcformbuilder-forms' ),
171 'icon' => WFBCORE_URL . 'assets/build/images/mobile.svg',
172 "setup" => array(
173 "template" => WFBCORE_PATH . "fields/phone_better/config.php",
174 "preview" => WFBCORE_PATH . "fields/phone_better/preview.php",
175 "default" => array(
176 'default' => '',
177
178 )
179 ),
180 "scripts" => array(
181 WFBCORE_URL . 'fields/phone_better/assets/js/intlTelInput.min.js',
182 ),
183 "styles" => array(
184 WFBCORE_URL . 'fields/phone_better/assets/css/intlTelInput.css'
185 ),
186 ),
187
188 'number' => array(
189 "field" => __( 'Number', 'qcformbuilder-forms' ),
190 "description" => __( 'Number', 'qcformbuilder-forms' ),
191 "file" => WFBCORE_PATH . "fields/generic-input.php",
192 "category" => __( 'Basic', 'qcformbuilder-forms' ),
193 "setup" => array(
194 "preview" => WFBCORE_PATH . "fields/number/preview.php",
195 "template" => WFBCORE_PATH . "fields/number/config.php"
196 )
197 ),
198 'phone' => array(
199 "field" => __( 'Phone Number (Basic)', 'qcformbuilder-forms' ),
200 "description" => __( 'Phone number with masking', 'qcformbuilder-forms' ),
201 'icon' => WFBCORE_URL . 'assets/build/images/volume-control-phone.svg',
202 "file" => WFBCORE_PATH . "fields/generic-input.php",
203 "category" => __( 'Basic', 'qcformbuilder-forms' ),
204 "setup" => array(
205 "template" => WFBCORE_PATH . "fields/phone/config.php",
206 "preview" => WFBCORE_PATH . "fields/phone/preview.php",
207 "default" => array(
208 'default' => '',
209 'type' => 'local',
210 'custom' => '(999)999-9999'
211 )
212 )
213 ),
214 /*
215 'paragraph' => array(
216 "field" => __( 'Paragraph Textarea', 'qcformbuilder-forms' ),
217 "description" => __( 'Paragraph Textarea', 'qcformbuilder-forms' ),
218 "file" => WFBCORE_PATH . "fields/paragraph/field.php",
219 "category" => __( 'Basic', 'qcformbuilder-forms' ),
220 "setup" => array(
221 "template" => WFBCORE_PATH . "fields/paragraph/config_template.php",
222 "preview" => WFBCORE_PATH . "fields/paragraph/preview.php",
223 "default" => array(
224 'rows' => '4'
225 ),
226 )
227 ),
228 'wysiwyg' => array(
229 "field" => __( 'Rich Editor', 'qcformbuilder-forms' ),
230 "description" => __( 'TinyMCE WYSIWYG editor', 'qcformbuilder-forms' ),
231 "file" => WFBCORE_PATH . "fields/wysiwyg/field.php",
232 'icon' => WFBCORE_URL . 'assets/build/images/align-justify.svg',
233 "category" => __( 'Basic', 'qcformbuilder-forms' ),
234 "setup" => array(
235 "template" => WFBCORE_PATH . "fields/wysiwyg/config_template.php",
236 "preview" => WFBCORE_PATH . "fields/wysiwyg/preview.php",
237 ),
238 "scripts" => array(
239 WFBCORE_URL . 'fields/wysiwyg/wysiwyg.js'
240 ),
241 "styles" => array(
242 WFBCORE_URL . "fields/wysiwyg/wysiwyg.min.css",
243 ),
244 ),
245
246 'url' => array(
247 "field" => __( 'URL', 'qcformbuilder-forms' ),
248 'icon' => WFBCORE_URL . 'assets/build/images/chain.svg',
249 "description" => __( 'URL input for website addresses', 'qcformbuilder-forms' ),
250 "file" => WFBCORE_PATH . "fields/generic-input.php",
251 "category" => __( 'Basic', 'qcformbuilder-forms' ),
252 "setup" => array(
253 "preview" => WFBCORE_PATH . "fields/url/preview.php",
254 "template" => WFBCORE_PATH . "fields/url/config.php"
255 )
256 ),
257
258 //eCommerce
259 'credit_card_number' => array(
260 "field" => __( 'Credit Card Number', 'qcformbuilder-forms' ),
261 "description" => __( 'Credit Card Number With Validation', 'qcformbuilder-forms' ),
262 "file" => WFBCORE_PATH . "fields/generic-input.php",
263 "category" => __( 'eCommerce', 'qcformbuilder-forms' ),
264 'icon' => WFBCORE_URL . 'assets/build/images/credit-card.svg',
265 "setup" => array(
266 "template" => WFBCORE_PATH . "fields/credit_card_number/config.php",
267 "preview" => WFBCORE_PATH . "fields/credit_card_number/preview.php"
268 ),
269 "scripts" => array(
270 WFBCORE_URL . 'fields/credit_card_number/credit-card.js'
271 )
272 ),
273 'credit_card_exp' => array(
274 "field" => __( 'Credit Card Expiration Date', 'qcformbuilder-forms' ),
275 "description" => __( 'Credit Card Expiration Date With Validation', 'qcformbuilder-forms' ),
276 "file" => WFBCORE_PATH . "fields/generic-input.php",
277 'icon' => WFBCORE_URL . 'assets/build/images/credit-card.svg',
278 "category" => __( 'eCommerce', 'qcformbuilder-forms' ),
279 "setup" => array(
280 "template" => WFBCORE_PATH . "fields/credit_card_exp/config.php",
281 "preview" => WFBCORE_PATH . "fields/credit_card_exp/preview.php"
282 ),
283 "scripts" => array(
284 WFBCORE_URL . 'fields/credit_card_number/credit-card.js'
285 )
286 ),
287 'credit_card_cvc' => array(
288 "field" => __( 'Credit Card CVC', 'qcformbuilder-forms' ),
289 "description" => __( 'Credit Card CVC With Validation', 'qcformbuilder-forms' ),
290 'icon' => WFBCORE_URL . 'assets/build/images/credit-card.svg',
291 "file" => WFBCORE_PATH . "fields/generic-input.php",
292 "category" => __( 'eCommerce', 'qcformbuilder-forms' ),
293 "setup" => array(
294 "template" => WFBCORE_PATH . "fields/credit_card_cvc/config.php",
295 "preview" => WFBCORE_PATH . "fields/credit_card_cvc/preview.php"
296 ),
297 "scripts" => array(
298 WFBCORE_URL . 'fields/credit_card_number/credit-card.js'
299 )
300 ),
301
302
303 //special
304 'calculation' => array(
305 "field" => __( 'Calculation', 'qcformbuilder-forms' ),
306 "file" => WFBCORE_PATH . "fields/calculation/field.php",
307 "handler" => array( Qcformbuilder_Forms::get_instance(), "run_calculation" ),
308 'icon' => WFBCORE_URL . 'assets/build/images/calculator.svg',
309 "category" => __( 'Special', 'qcformbuilder-forms' ),
310 "description" => __( 'Calculate values', 'qcformbuilder-forms' ),
311 "setup" => array(
312 "template" => WFBCORE_PATH . "fields/calculation/config.php",
313 "preview" => WFBCORE_PATH . "fields/calculation/preview.php",
314 "default" => array(
315 'element' => 'h3',
316 'classes' => 'total-line',
317 'before' => __( 'Total', 'qcformbuilder-forms' ) . ':',
318 'after' => ''
319 ),
320
321 ),
322 ),
323 'range_slider' => array(
324 "field" => __( 'Range Slider', 'qcformbuilder-forms' ),
325 "file" => WFBCORE_PATH . "fields/range_slider/field.php",
326 "category" => __( 'Special', 'qcformbuilder-forms' ),
327 "description" => __( 'Range Slider input field', 'qcformbuilder-forms' ),
328 "setup" => array(
329 "template" => WFBCORE_PATH . "fields/range_slider/config.php",
330 "preview" => WFBCORE_PATH . "fields/range_slider/preview.php",
331 "default" => array(
332 'default' => 1,
333 'step' => 1,
334 'min' => 0,
335 'max' => 100,
336 'showval' => 1,
337 'suffix' => '',
338 'prefix' => '',
339 'color' => '#00ff00',
340 'handle' => '#ffffff',
341 'handleborder' => '#cccccc',
342 'trackcolor' => '#e6e6e6'
343 ),
344 ),
345 "styles" => array(
346 WFBCORE_URL . "fields/range_slider/rangeslider.min.css",
347 ),
348 "scripts" => array(
349 WFBCORE_URL . "fields/range_slider/rangeslider.min.js",
350 ),
351 ),
352 'star_rating' => array(
353 "field" => __( 'Star Rating', 'qcformbuilder-forms' ),
354 "file" => WFBCORE_PATH . "fields/star-rate/field.php",
355 "category" => __( 'Special', 'qcformbuilder-forms' ),
356 'icon' => WFBCORE_URL . 'assets/build/images/star.svg',
357 "description" => __( 'Star rating input for feedback', 'qcformbuilder-forms' ),
358 "viewer" => array( Qcformbuilder_Forms::get_instance(), 'star_rating_viewer' ),
359 "setup" => array(
360 "template" => WFBCORE_PATH . "fields/star-rate/config.php",
361 "preview" => WFBCORE_PATH . "fields/star-rate/preview.php",
362 "default" => array(
363 'number' => 5,
364 'space' => 3,
365 'size' => 13,
366 'color' => '#FFAA00',
367 'track_color' => '#AFAFAF',
368 'type' => 'star',
369 ),
370 ),
371 "scripts" => array(
372 WFBCORE_URL . "fields/star-rate/jquery.raty.js",
373 ),
374 "styles" => array(
375 WFBCORE_URL . "fields/star-rate/wfb-raty.css",
376 ),
377 ),
378 'utm' => array(
379 'field' => __( 'UTM', 'qcformbuilder-forms' ),
380 'file' => WFBCORE_PATH . 'fields/utm/field.php',
381 'category' => __( 'Special', 'qcformbuilder-forms' ),
382 'description' => __( 'Capture all UTM tags', 'qcformbuilder-forms' ),
383 'setup' => array(
384 'template' => WFBCORE_PATH . 'fields/utm/config.php',
385 'preview' => WFBCORE_PATH . 'fields/utm/preview.php',
386 'not_supported' => array(
387 'hide_label',
388 'caption',
389 'required',
390 )
391 ),
392 'handler' => array( 'Qcformbuilder_Forms_Field_Utm', 'handler' )
393 ),
394 'gdpr' => array(
395 "field" => __( 'Consent Field', 'qcformbuilder-forms' ),
396 "description" => __( 'Record consent to collect personally identifying information (PII).', 'qcformbuilder-forms' ),
397 "file" => WFBCORE_PATH . "fields/gdpr/field.php",
398 "category" => __( 'Special', 'qcformbuilder-forms' ),
399 "setup" => array(
400 "template" => WFBCORE_PATH . "fields/gdpr/config_template.php",
401 "preview" => WFBCORE_PATH . "fields/gdpr/preview.php",
402 "not_supported" => array(
403 'caption',
404 'required',
405 )
406 ),
407
408 ),
409 //file
410 'file' => array(
411 "field" => __( 'File', 'qcformbuilder-forms' ),
412 "description" => __( 'Basic HTML5 File Uploader', 'qcformbuilder-forms' ),
413 "file" => WFBCORE_PATH . "fields/file/field.php",
414 'icon' => WFBCORE_URL . 'assets/build/images/cloud-upload.svg',
415 "viewer" => array( Qcformbuilder_Forms::get_instance(), 'handle_file_view' ),
416 "category" => __( 'File', 'qcformbuilder-forms' ),
417 "setup" => array(
418 "preview" => WFBCORE_PATH . "fields/file/preview.php",
419 "template" => WFBCORE_PATH . "fields/file/config_template.php"
420 )
421 ),
422 'advanced_file' => array(
423 "field" => __( 'Advanced File Uploader (1.0)', 'qcformbuilder-forms' ),
424 'icon' => WFBCORE_URL . 'assets/build/images/cloud-upload.svg',
425 "description" => __( 'File upload field with more features than standard HTML5 input.', 'qcformbuilder-forms' ),
426 "file" => WFBCORE_PATH . "fields/advanced_file/field.php",
427 "viewer" => array( Qcformbuilder_Forms::get_instance(), 'handle_file_view' ),
428 "category" => $deprecated,
429 "setup" => array(
430 "preview" => WFBCORE_PATH . "fields/advanced_file/preview.php",
431 "template" => WFBCORE_PATH . "fields/advanced_file/config_template.php"
432 ),
433 "scripts" => array(
434 WFBCORE_URL . 'fields/advanced_file/uploader.min.js'
435 ),
436
437 ),
438 */
439 //content
440 'html' => array(
441 "field" => __( 'HTML', 'qcformbuilder-forms' ),
442 "description" => __( 'Add text/html content', 'qcformbuilder-forms' ),
443 "file" => WFBCORE_PATH . "fields/html/field.php",
444 "category" => __( 'Content', 'qcformbuilder-forms' ),
445 "icon" => WFBCORE_URL . "fields/html/icon.png",
446 "capture" => false,
447 "setup" => array(
448 "preview" => WFBCORE_PATH . "fields/html/preview.php",
449 "template" => WFBCORE_PATH . "fields/html/config_template.php",
450 "not_supported" => array(
451 'hide_label',
452 'caption',
453 'required',
454 'entry_list'
455 )
456 )
457 ),
458 /*
459 'summary' => array(
460 "field" => __( 'Summary', 'qcformbuilder-forms' ),
461 "description" => __( 'Live updating summary of submission', 'qcformbuilder-forms' ),
462 "file" => WFBCORE_PATH . "fields/summary/field.php",
463 "category" => __( 'Content', 'qcformbuilder-forms' ),
464 'icon' => WFBCORE_URL . 'assets/build/images/list.svg',
465 "capture" => false,
466 "setup" => array(
467 "preview" => WFBCORE_PATH . "fields/summary/preview.php",
468 "template" => WFBCORE_PATH . "fields/summary/config.php",
469 "not_supported" => array(
470 'required',
471 'entry_list'
472 )
473 )
474 ),
475 'section_break' => array(
476 "field" => __( 'Section Break', 'qcformbuilder-forms' ),
477 "description" => __( 'An HR tag to separate sections of your form.', 'qcformbuilder-forms' ),
478 "file" => WFBCORE_PATH . "fields/section-break/section-break.php",
479 "category" => __( 'Content', 'qcformbuilder-forms' ),
480 "capture" => false,
481 "setup" => array(
482 "template" => WFBCORE_PATH . "fields/section-break/config.php",
483 "not_supported" => array(
484 'hide_label',
485 'caption',
486 'required',
487 'entry_list'
488 )
489 )
490 ),
491 */
492 //select
493 'dropdown' => array(
494 "field" => __( 'Select Option', 'qcformbuilder-forms' ),
495 "description" => __( 'Display Options as button', 'qcformbuilder-forms' ),
496 'icon' => WFBCORE_URL . 'assets/build/images/plus.svg',
497 "file" => WFBCORE_PATH . "fields/dropdown/field.php",
498 "category" => __( 'Select', 'qcformbuilder-forms' ),
499 "options" => "single",
500 "static" => true,
501 "viewer" => array( Qcformbuilder_Forms::get_instance(), 'filter_options_calculator' ),
502 "setup" => array(
503 "template" => WFBCORE_PATH . "fields/dropdown/config_template.php",
504 "preview" => WFBCORE_PATH . "fields/dropdown/preview.php",
505 "default" => array(),
506 )
507 ),
508 'checkbox' => array(
509 "field" => __( 'Checkbox', 'qcformbuilder-forms' ),
510 "description" => __( 'Checkbox', 'qcformbuilder-forms' ),
511 'icon' => WFBCORE_URL . 'assets/build/images/plus.svg',
512 "file" => WFBCORE_PATH . "fields/checkbox/field.php",
513 "category" => __( 'Select', 'qcformbuilder-forms' ),
514 "options" => "multiple",
515 "static" => true,
516 "viewer" => array( Qcformbuilder_Forms::get_instance(), 'filter_options_calculator' ),
517 "setup" => array(
518 "preview" => WFBCORE_PATH . "fields/checkbox/preview.php",
519 "template" => WFBCORE_PATH . "fields/checkbox/config_template.php",
520
521 ),
522 ),
523 /*
524
525 'radio' => array(
526 "field" => __( 'Radio', 'qcformbuilder-forms' ),
527 "description" => __( 'Radio', 'qcformbuilder-forms' ),
528 'icon' => WFBCORE_URL . 'assets/build/images/plus.svg',
529 "file" => WFBCORE_PATH . "fields/radio/field.php",
530 "category" => __( 'Select', 'qcformbuilder-forms' ),
531 "options" => true,
532 "static" => true,
533 "viewer" => array( Qcformbuilder_Forms::get_instance(), 'filter_options_calculator' ),
534 "setup" => array(
535 "preview" => WFBCORE_PATH . "fields/radio/preview.php",
536 "template" => WFBCORE_PATH . "fields/radio/config_template.php",
537 )
538 ),
539 'filtered_select2' => array(
540 "field" => __( 'Autocomplete', 'qcformbuilder-forms' ),
541 "file" => WFBCORE_PATH . "fields/select2/field/field.php",
542 'icon' => WFBCORE_URL . 'assets/build/images/plus.svg',
543 "category" => __( 'Select', 'qcformbuilder-forms' ),
544 "description" => 'Select2 dropdown',
545 "options" => "multiple",
546 "static" => true,
547 "setup" => array(
548 "template" => WFBCORE_PATH . "fields/select2/field/config.php",
549 "preview" => WFBCORE_PATH . "fields/select2/field/preview.php",
550 ),
551 "scripts" => array(
552 WFBCORE_URL . "fields/select2/js/select2.min.js",
553 ),
554 "styles" => array(
555 WFBCORE_URL . "fields/select2/css/select2.css",
556 )
557 ),
558 'date_picker' => array(
559 "field" => __( 'Date Picker', 'qcformbuilder-forms' ),
560 "description" => __( 'Date Picker', 'qcformbuilder-forms' ),
561 'icon' => WFBCORE_URL . 'assets/build/images/plus.svg',
562 "file" => WFBCORE_PATH . "fields/date_picker/datepicker.php",
563 "category" => __( 'Select', 'qcformbuilder-forms' ),
564 "setup" => array(
565 "preview" => WFBCORE_PATH . "fields/date_picker/preview.php",
566 "template" => WFBCORE_PATH . "fields/date_picker/setup.php",
567 "default" => array(
568 'format' => 'yyyy-mm-dd'
569 ),
570 ),
571 "styles" => array(
572 WFBCORE_URL . "fields/date_picker/css/datepicker.css",
573 ),
574 "scripts" => array(
575 WFBCORE_URL . "fields/date_picker/wfb-datepicker.js",
576 )
577 ),
578 'toggle_switch' => array(
579 "field" => __( 'Toggle Switch', 'qcformbuilder-forms' ),
580 "description" => __( 'Toggle Switch', 'qcformbuilder-forms' ),
581 "category" => __( 'Select', 'qcformbuilder-forms' ),
582 'icon' => WFBCORE_URL . 'assets/build/images/plus.svg',
583 "file" => WFBCORE_PATH . "fields/toggle_switch/field.php",
584 "viewer" => array( Qcformbuilder_Forms::get_instance(), 'filter_options_calculator' ),
585 "options" => "single",
586 "static" => true,
587 "setup" => array(
588 "template" => WFBCORE_PATH . "fields/toggle_switch/config_template.php",
589 "preview" => WFBCORE_PATH . "fields/toggle_switch/preview.php",
590 ),
591 ),
592 'color_picker' => array(
593 "field" => __( 'Color Picker', 'qcformbuilder-forms' ),
594 "description" => __( 'Color Picker', 'qcformbuilder-forms' ),
595 'icon' => WFBCORE_URL . 'assets/build/images/paint-brush.svg',
596 "category" => __( 'Select', 'qcformbuilder-forms' ),
597 "file" => WFBCORE_PATH . "fields/generic-input.php",
598 "setup" => array(
599 "preview" => WFBCORE_PATH . "fields/color_picker/preview.php",
600 "template" => WFBCORE_PATH . "fields/color_picker/setup.php",
601 "default" => array(
602 'default' => '#FFFFFF'
603 ),
604 ),
605 'styles' => array(
606 WFBCORE_URL . 'fields/color_picker/minicolors.min.css'
607 ),
608 'scripts' => array(
609 WFBCORE_URL . 'fields/color_picker/minicolors.js'
610 )
611 ),
612 'states' => array(
613 "field" => __( 'State/ Province Select', 'qcformbuilder-forms' ),
614 'icon' => WFBCORE_URL . 'assets/build/images/plus.svg',
615 "description" => __( 'Dropdown select for US states and Canadian provinces.', 'qcformbuilder-forms' ),
616 "file" => WFBCORE_PATH . "fields/states/field.php",
617 "category" => __( 'Select', 'qcformbuilder-forms' ),
618 "placeholder" => false,
619 "setup" => array(
620 "template" => WFBCORE_PATH . "fields/states/config_template.php",
621 "preview" => WFBCORE_PATH . "fields/states/preview.php",
622 "default" => array(),
623 )
624 ),
625
626
627 //discontinued
628 'recaptcha' => array(
629 "field" => __( 'reCAPTCHA', 'qcformbuilder-forms' ),
630 "description" => __( 'reCAPTCHA anti-spam field', 'qcformbuilder-forms' ),
631 "file" => WFBCORE_PATH . "fields/recaptcha/field.php",
632 "category" => $deprecated,
633 "handler" => array( Qcformbuilder_Forms::get_instance(), 'captcha_check' ),
634 "capture" => false,
635 "setup" => array(
636 "template" => WFBCORE_PATH . "fields/recaptcha/config.php",
637 "preview" => WFBCORE_PATH . "fields/recaptcha/preview.php",
638 "not_supported" => array(
639 'caption',
640 'required'
641 ),
642 )
643 ),
644 */
645
646 );
647
648 return $internal_fields;
649 }
650
651 }
652