PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 3.6.21
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v3.6.21
6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 3.6.66 All 195 releases
fluentform / app / Services / FormBuilder / ElementCustomization.php

ElementCustomization.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 3.6.21, at app/Services/FormBuilder/ElementCustomization.php

569 lines 22.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * element_customization_settings
5 *
6 * Returns an array of countries and codes.
7 *
8 * @author WooThemes
9 * @category i18n
10 * @package fluentform/i18n
11 * @version 2.5.0
12 */
13
14 if (!defined('ABSPATH')) {
15 exit;
16 }
17
18 $dateFormats = (new \FluentForm\App\Services\FormBuilder\Components\DateTime)->getAvailableDateFormats();
19
20 $dateConfigSettings = array(
21 'template' => 'inputTextarea',
22 'label' => __('Advanced Date Configuration', 'fluentform'),
23 'placeholder' => __('Advanced Date Configuration', 'fluentform'),
24 'rows' => (defined('FLUENTFORMPRO')) ? 10 : 2,
25 'start_text' => (defined('FLUENTFORMPRO')) ? 10 : 2,
26 'disabled' => !defined('FLUENTFORMPRO'),
27 'css_class' => 'ff_code_editor',
28 'inline_help_text' => 'Only valid JS object will work. Please check <a target="_blank" href="https://wpmanageninja.com/docs/fluent-form/field-types/time-date#advanced_configaration">the documentation for available config options</a>',
29 'help_text' => __('You can write your own date configaration as JS object. Please write valid configaration as per flatpickr config.', 'fluentform'),
30 );
31
32 if (!defined('FLUENTFORMPRO')) {
33 $dateConfigSettings['inline_help_text'] = 'Available on Fluent Forms Pro';
34 }
35
36
37 $element_customization_settings = array(
38 'name' => array(
39 'template' => 'nameAttr',
40 'label' => __('Name Attribute', 'fluentform'),
41 'help_text' => __('This is the field name attributes which is used to submit form data, name attribute must be unique.', 'fluentform'),
42 ),
43 'label' => array(
44 'template' => 'inputText',
45 'label' => __('Element Label', 'fluentform'),
46 'help_text' => __('This is the field title the user will see when filling out the form.', 'fluentform'),
47 ),
48 'label_placement' => array(
49 'template' => 'radioButton',
50 'label' => __('Label Placement', 'fluentform'),
51 'help_text' => __('Determine the position of label title where the user will see this. By choosing "Default", global label placement setting will be applied.', 'fluentform'),
52 'options' => array(
53 array(
54 'value' => '',
55 'label' => __('Default', 'fluentform'),
56 ),
57 array(
58 'value' => 'top',
59 'label' => __('Top', 'fluentform'),
60 ),
61 array(
62 'value' => 'right',
63 'label' => __('Right', 'fluentform'),
64 ),
65 array(
66 'value' => 'bottom',
67 'label' => __('Bottom', 'fluentform'),
68 ),
69 array(
70 'value' => 'left',
71 'label' => __('Left', 'fluentform'),
72 ),
73 array(
74 'value' => 'hide_label',
75 'label' => __('Hide Label', 'fluentform'),
76 ),
77 ),
78 ),
79 'button_style' => array(
80 'template' => 'selectBtnStyle',
81 'label' => __('Button Style', 'fluentform'),
82 'help_text' => __('Select a button style from the dropdown', 'fluentform'),
83 ),
84 'button_size' => array(
85 'template' => 'radioButton',
86 'label' => __('Button Size', 'fluentform'),
87 'help_text' => __('Define a size of the button', 'fluentform'),
88 'options' => array(
89 array(
90 'value' => 'sm',
91 'label' => __('Small', 'fluentform'),
92 ),
93 array(
94 'value' => 'md',
95 'label' => __('Medium', 'fluentform'),
96 ),
97 array(
98 'value' => 'lg',
99 'label' => __('Large', 'fluentform'),
100 ),
101 )
102 ),
103 'placeholder' => array(
104 'template' => 'inputText',
105 'label' => __('Placeholder', 'fluentform'),
106 'help_text' => __('This is the field placeholder, the user will see this if the input field is empty.', 'fluentform'),
107 ),
108 'date_format' => array(
109 'template' => 'select',
110 'label' => __('Date Format', 'fluentform'),
111 'filterable' => true,
112 'creatable' => true,
113 'placeholder' => __('Select Date Format', 'fluentform'),
114 'help_text' => __('Select any date format from the dropdown. The user will be able to choose a date in this given format.', 'fluentform'),
115 'options' => $dateFormats,
116 ),
117 'date_config' => $dateConfigSettings,
118 'rows' => array(
119 'template' => 'inputText',
120 'label' => __('Rows', 'fluentform'),
121 'help_text' => __('How many rows will textarea take in a form. It\'s an HTML attributes for browser support.', 'fluentform'),
122 ),
123 'cols' => array(
124 'template' => 'inputText',
125 'label' => __('Columns', 'fluentform'),
126 'help_text' => __('How many cols will textarea take in a form. It\'s an HTML attributes for browser support.', 'fluentform'),
127 ),
128 'options' => array(
129 'template' => 'selectOptions',
130 'label' => __('Options', 'fluentform'),
131 'help_text' => __('Create options for the field and checkmark them for default selection.', 'fluentform'),
132 ),
133 'advanced_options' => array(
134 'template' => 'advancedOptions',
135 'label' => __('Options', 'fluentform'),
136 'help_text' => __('Create visual options for the field and checkmark them for default selection.', 'fluentform'),
137 ),
138 'pricing_options' => array(
139 'template' => 'pricingOptions',
140 'label' => __('Payment Settings', 'fluentform'),
141 'help_text' => __('Set your product type and corresponding prices', 'fluentform'),
142 ),
143 'validation_rules' => array(
144 'template' => 'validationRulesForm',
145 'label' => __('Validation Rules', 'fluentform'),
146 'help_text' => '',
147 ),
148 'required_field_message' => array(
149 'template' => 'inputRequiredFieldText',
150 'label' => __('Required Validation Message', 'fluentform'),
151 'help_text' => 'Message for failed validation for this field',
152 ),
153 'tnc_html' => array(
154 'template' => 'inputHTML',
155 'label' => __('Terms & Conditions', 'fluentform'),
156 'help_text' => __('Write HTML content for terms & condition checkbox', 'fluentform'),
157 'rows' => 4,
158 'cols' => 2,
159 ),
160 'hook_name' => array(
161 'template' => 'customHookName',
162 'label' => __('Hook Name', 'fluentform'),
163 'help_text' => __('WordPress Hook name to hook something in this place.', 'fluentform'),
164 ),
165 'has_checkbox' => array(
166 'template' => 'inputCheckbox',
167 'options' => array(
168 array(
169 'value' => true,
170 'label' => __('Show Checkbox', 'fluentform'),
171 ),
172 ),
173 ),
174 'html_codes' => array(
175 'template' => 'inputHTML',
176 'rows' => 4,
177 'cols' => 2,
178 'label' => __('HTML Code', 'fluentform'),
179 'help_text' => __('Your valid HTML code will be shown to the user as normal content.', 'fluentform'),
180 ),
181 'description' => array(
182 'template' => 'inputHTML',
183 'rows' => 4,
184 'cols' => 2,
185 'label' => __('Description', 'fluentform'),
186 'help_text' => __('Description will be shown to the user as normal text content.', 'fluentform'),
187 ),
188 'btn_text' => array(
189 'template' => 'inputText',
190 'label' => __('Button Text', 'fluentform'),
191 'help_text' => __('This will be visible as button text for upload file.', 'fluentform'),
192 ),
193 'button_ui' => array(
194 'template' => 'prevNextButton',
195 'label' => __('Submit Button', 'fluentform'),
196 'help_text' => __('This is form submission button.', 'fluentform'),
197 ),
198 'align' => array(
199 'template' => 'radio',
200 'label' => __('Content Alignment', 'fluentform'),
201 'help_text' => __('How the content will be aligned.', 'fluentform'),
202 'options' => array(
203 array(
204 'value' => 'left',
205 'label' => __('Left', 'fluentform'),
206 ),
207 array(
208 'value' => 'center',
209 'label' => __('Center', 'fluentform'),
210 ),
211 array(
212 'value' => 'right',
213 'label' => __('Right', 'fluentform'),
214 ),
215 ),
216 ),
217 'shortcode' => array(
218 'template' => 'inputText',
219 'label' => __('Shortcode', 'fluentform'),
220 'help_text' => __('Your shortcode to render desired content in current place.', 'fluentform'),
221 ),
222 'apply_styles' => array(
223 'template' => 'radioButton',
224 'label' => __('Apply Styles', 'fluentform'),
225 'help_text' => __('Apply styles provided here', 'fluentform'),
226 'options' => array(
227 array(
228 'value' => true,
229 'label' => __('Yes', 'fluentform'),
230 ),
231 array(
232 'value' => false,
233 'label' => __('No', 'fluentform'),
234 )
235 ),
236 ),
237 'step_title' => array(
238 'template' => 'inputText',
239 'label' => __('Step Title', 'fluentform'),
240 'help_text' => __('Form step titles, user will see each title in each step.', 'fluentform'),
241 ),
242 'disable_auto_focus' => array(
243 'template' => 'inputYesNoCheckBox',
244 'label' => __('Disable auto focus when changing each page', 'fluentform'),
245 'help_text' => __('If you enable this then on page transition automatic scrolling will be disabled', 'fluentform'),
246 ),
247 'enable_auto_slider' => array(
248 'template' => 'inputYesNoCheckBox',
249 'label' => __('Enable auto page change for single radio field', 'fluentform'),
250 'help_text' => __('If you enable this then for last radio item field will trigger next page change', 'fluentform'),
251 ),
252 'enable_step_data_persistency' => array(
253 'template' => 'inputYesNoCheckBox',
254 'label' => __('Enable Per step data save (Save and Continue)', 'fluentform'),
255 'help_text' => __('If you enable this then on each step change the data current step data will be persisted in a step form<br />Your users can resume the form where they left', 'fluentform'),
256 ),
257 'enable_step_page_resume' => array(
258 'template' => 'inputYesNoCheckBox',
259 'label' => __('Resume Step from last form session', 'fluentform'),
260 'help_text' => __('If you enable this then users will see the form as step page where it has been left', 'fluentform'),
261 'dependency' => array(
262 'depends_on' => 'settings/enable_step_data_persistency',
263 'value' => 'yes',
264 'operator' => '=='
265 )
266 ),
267 'progress_indicator' => array(
268 'template' => 'radio',
269 'label' => __('Progress Indicator', 'fluentform'),
270 'help_text' => __('Select any of them below, user will see progress of form steps according to your choice.', 'fluentform'),
271 'options' => array(
272 array(
273 'value' => 'progress-bar',
274 'label' => __('Progress Bar', 'fluentform'),
275 ),
276 array(
277 'value' => 'steps',
278 'label' => __('Steps', 'fluentform'),
279 ),
280 array(
281 'value' => '',
282 'label' => __('None', 'fluentform'),
283 ),
284 ),
285 ),
286 'step_titles' => array(
287 'template' => 'customStepTitles',
288 'label' => __('Step Titles', 'fluentform'),
289 'help_text' => __('Form step titles, user will see each title in each step.', 'fluentform'),
290 ),
291 'prev_btn' => array(
292 'template' => 'prevNextButton',
293 'label' => __('Previous Button', 'fluentform'),
294 'help_text' => __('Multi-step form\'s previous button', 'fluentform'),
295 ),
296 'next_btn' => array(
297 'template' => 'prevNextButton',
298 'label' => __('Next Button', 'fluentform'),
299 'help_text' => __('Multi-step form\'s next button', 'fluentform'),
300 ),
301 'address_fields' => array(
302 'template' => 'addressFields',
303 'label' => __('Address Fields', 'fluentform'),
304 ),
305 'name_fields' => array(
306 'template' => 'nameFields',
307 'label' => __('Name Fields', 'fluentform'),
308 ),
309 'multi_column' => array(
310 'template' => 'inputCheckbox',
311 'options' => array(
312 array(
313 'value' => true,
314 'label' => __('Enable Multiple Columns', 'fluentform'),
315 ),
316 ),
317 ),
318 'repeat_fields' => array(
319 'template' => 'customRepeatFields',
320 'label' => __('Repeat Fields', 'fluentform'),
321 'help_text' => __('This is a form field which a user will be able to repeat.', 'fluentform'),
322 ),
323 'admin_field_label' => array(
324 'template' => 'inputText',
325 'label' => __('Admin Field Label', 'fluentform'),
326 'help_text' => __('Admin field label is field title which will be used for admin field title.', 'fluentform'),
327 ),
328 'maxlength' => array(
329 'template' => 'inputNumber',
330 'label' => __('Max text length', 'fluentform'),
331 'help_text' => __('The maximum number of characters the input should accept', 'fluentform'),
332 ),
333 'value' => array(
334 'template' => 'inputValue',
335 'label' => __('Default Value', 'fluentform'),
336 'help_text' => __('If you would like to pre-populate the value of a field, enter it here.', 'fluentform'),
337 ),
338 'dynamic_default_value' => array(
339 'template' => 'inputValue',
340 'label' => __('Default Value', 'fluentform'),
341 'help_text' => __('If you would like to pre-populate the value of a field, enter it here.', 'fluentform'),
342 ),
343 'container_class' => array(
344 'template' => 'inputText',
345 'label' => __('Container Class', 'fluentform'),
346 'help_text' => __('Class for the field wrapper. This can be used to style current element.', 'fluentform'),
347 ),
348 'class' => array(
349 'template' => 'inputText',
350 'label' => __('Element Class', 'fluentform'),
351 'help_text' => __('Class for the field. This can be used to style current element.', 'fluentform'),
352 ),
353 'country_list' => array(
354 'template' => 'customCountryList',
355 'label' => __('Country List', 'fluentform'),
356 ),
357 'product_field_types' => array(
358 'template' => 'productFieldTypes',
359 'label' => __('Options', 'fluentform'),
360 ),
361 'help_message' => array(
362 'template' => 'inputTextarea',
363 'label' => __('Help Message', 'fluentform'),
364 'help_text' => __('Help message will be shown as tooltip next to sidebar or below the field.', 'fluentform'),
365 ),
366 'conditional_logics' => array(
367 'template' => 'conditionalLogics',
368 'label' => __('Conditional Logic', 'fluentform'),
369 'help_text' => __('Create rules to dynamically display or hide this field based on values from another field.', 'fluentform'),
370 ),
371 'background_color' => array(
372 'template' => 'inputColor',
373 'label' => __('Background Color', 'fluentform'),
374 'help_text' => __('The Background color of the element', 'fluentform')
375 ),
376 'color' => array(
377 'template' => 'inputColor',
378 'label' => __('Font Color', 'fluentform'),
379 'help_text' => __('Font color of the element', 'fluentform')
380 ),
381 'data-mask' => array(
382 'template' => 'customMask',
383 'label' => __('Custom Mask', 'fluentform'),
384 'help_text' => __('Write your own mask for this input', 'fluentform'),
385 'dependency' => array(
386 'depends_on' => 'settings/temp_mask',
387 'value' => 'custom',
388 'operator' => '=='
389 )
390 ),
391 'temp_mask' => array(
392 'template' => 'select',
393 'label' => __('Mask Input', 'fluentform'),
394 'help_text' => __('Select a mask for the input field', 'fluentform'),
395 'options' => array(
396 array(
397 'value' => '',
398 'label' => __('None', 'fluentform'),
399 ),
400 array(
401 'value' => '(000) 000-0000',
402 'label' => '(###) ###-####',
403 ),
404 array(
405 'value' => '(00) 0000-0000',
406 'label' => '(##) ####-####',
407 ),
408 array(
409 'value' => '00/00/0000',
410 'label' => __('23/03/2018', 'fluentform'),
411 ),
412 array(
413 'value' => '00:00:00',
414 'label' => __('23:59:59', 'fluentform'),
415 ),
416 array(
417 'value' => '00/00/0000 00:00:00',
418 'label' => __('23/03/2018 23:59:59', 'fluentform'),
419 ),
420 array(
421 'value' => 'custom',
422 'label' => __('Custom', 'fluentform'),
423 )
424 ),
425 ),
426 'grid_columns' => array(
427 'template' => 'gridRowCols',
428 'label' => __('Grid Columns', 'fluentform'),
429 'help_text' => __('Write your own mask for this input', 'fluentform'),
430 ),
431 'grid_rows' => array(
432 'template' => 'gridRowCols',
433 'label' => __('Grid Rows', 'fluentform'),
434 'help_text' => __('Write your own mask for this input', 'fluentform'),
435 ),
436 'tabular_field_type' => array(
437 'template' => 'radio',
438 'label' => __('Field Type', 'fluentform'),
439 'help_text' => __('Field Type', 'fluentform'),
440 'options' => array(
441 array(
442 'value' => 'checkbox',
443 'label' => __('Checkbox', 'fluentform'),
444 ),
445 array(
446 'value' => 'radio',
447 'label' => __('Radio', 'fluentform'),
448 ),
449 )
450 ),
451 'max_repeat_field' => array(
452 'template' => 'inputNumber',
453 'label' => __('Max Repeat inputs', 'fluentform'),
454 'help_text' => __('Please provide max number of rows the user can fill up for this repeat field. Keep blank/0 for unlimited numbers', 'fluentform')
455 ),
456 'calculation_settings' => array(
457 'template' => (defined('FLUENTFORMPRO')) ? 'inputCalculationSettings' : 'infoBlock',
458 'text' => '<b>Calculation Field Settings</b><br />Calculate the value based on other numeric field is available on pro version of WP Fluent Forms. Please install WP Fluent Forms Pro to use this feature',
459 'label' => 'Calculation Field Settings',
460 'status_label' => 'Enable Calculation',
461 'formula_label' => 'Calculation Expression',
462 'formula_tips' => 'You can use + - * / for calculating the the value. Use context icon to insert the input values',
463 'status_tips' => 'Enable this and provide formula expression if you want this field as calculated based on other numeric field value'
464 ),
465 'min' => array(
466 'template' => 'inputNumber',
467 'label' => __('Min Value', 'fluentform'),
468 'help_text' => __('Please provide minimum value', 'fluentform')
469 ),
470 'max' => array(
471 'template' => 'inputNumber',
472 'label' => __('Max Value', 'fluentform'),
473 'help_text' => __('Please provide Maximum value', 'fluentform')
474 ),
475 'number_step' => array(
476 'template' => 'inputText',
477 'label' => __('Step', 'fluentform'),
478 'help_text' => __('Please provide step attribute for this field. Give value "any" for floating value', 'fluentform')
479 ),
480 'prefix_label' => array(
481 'template' => 'inputText',
482 'label' => __('Prefix Label', 'fluentform'),
483 'help_text' => __('Provide Input Prefix Label. It will show in the input field as prefix label', 'fluentform')
484 ),
485 'suffix_label' => array(
486 'template' => 'inputText',
487 'label' => __('Suffix Label', 'fluentform'),
488 'help_text' => __('Provide Input Suffix Label. It will show in the input field as suffix label', 'fluentform')
489 ),
490 'is_unique' => array(
491 'template' => 'select',
492 'label' => __('Validate as Unique', 'fluentform'),
493 'help_text' => __('If you make it unique then it will validate as unique from previous submissions of this form', 'fluentform'),
494 'options' => array(
495 array(
496 'value' => 'no',
497 'label' => __('No', 'fluentform'),
498 ),
499 array(
500 'value' => 'yes',
501 'label' => __('Yes', 'fluentform'),
502 )
503 )
504 ),
505 'show_text' => array(
506 'template' => 'select',
507 'label' => __('Show Text', 'fluentform'),
508 'help_text' => __('Show Text value on selection', 'fluentform'),
509 'options' => array(
510 array(
511 'value' => 'yes',
512 'label' => __('Yes', 'fluentform'),
513 ),
514 array(
515 'value' => 'no',
516 'label' => __('No', 'fluentform'),
517 )
518 )
519 ),
520 'unique_validation_message' => array(
521 'template' => 'inputText',
522 'label' => __('Validation Message for Duplicate', 'fluentform'),
523 'help_text' => __('If validation failed then it will show this message', 'fluentform'),
524 'dependency' => array(
525 'depends_on' => 'settings/is_unique',
526 'value' => 'yes',
527 'operator' => '=='
528 )
529 ),
530 'layout_class' => array(
531 'template' => 'select',
532 'label' => __('Layout', 'fluentform'),
533 'help_text' => __('Select the Layout for checkable items', 'fluentform'),
534 'options' => array(
535 array(
536 'value' => '',
537 'label' => __('Default', 'fluentform'),
538 ),
539 array(
540 'value' => 'ff_list_inline',
541 'label' => 'Inline Layout',
542 ),
543 array(
544 'value' => 'ff_list_buttons',
545 'label' => 'Button Type Styles',
546 ),
547 array(
548 'value' => 'ff_list_2col',
549 'label' => '2-Column Layout',
550 ),
551 array(
552 'value' => 'ff_list_3col',
553 'label' => '3-Column Layout',
554 ),
555 array(
556 'value' => 'ff_list_4col',
557 'label' => '4-Column Layout',
558 ),
559 array(
560 'value' => 'ff_list_5col',
561 'label' => '5-Column Layout',
562 )
563 ),
564 ),
565 );
566
567
568 return apply_filters('fluent_editor_element_customization_settings', $element_customization_settings);
569