← All changes
|
app/Services/FormBuilder/ElementCustomization.php
+791
-453
3.6.64
→
6.2.14
View file →
| @@ -5,603 +5,941 @@ | ||
| 5 | 5 | * |
| 6 | 6 | * Returns an array of countries and codes. |
| 7 | 7 | * |
| 8 | 8 | * @author WooThemes |
| 9 | + * | |
| 9 | 10 | * @category i18n |
| 10 | 11 | * @package fluentform/i18n |
| 12 | + * | |
| 11 | 13 | * @version 2.5.0 |
| 12 | 14 | */ |
| 13 | - | |
| 14 | -if (!defined('ABSPATH')) { | |
| 15 | +if (! defined('ABSPATH')) { | |
| 15 | 16 | exit; |
| 16 | 17 | } |
| 17 | 18 | |
| 18 | -$dateFormats = (new \FluentForm\App\Services\FormBuilder\Components\DateTime)->getAvailableDateFormats(); | |
| 19 | +$fluentformDateFormats = (new \FluentForm\App\Services\FormBuilder\Components\DateTime())->getAvailableDateFormats(); | |
| 20 | +$fluentformRatingIconOptions = \FluentForm\App\Services\FormBuilder\RatingIcon::getPresetOptions(); | |
| 21 | +$fluentformCanAuthorDateConfig = fluentformCanUnfilteredHTML(); | |
| 19 | 22 | |
| 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 configuration as JS object. Please write valid configuration as per flatpickr config.', 'fluentform'), | |
| 30 | -); | |
| 23 | +$fluentformDateConfigSettings = [ | |
| 24 | + 'template' => 'inputTextarea', | |
| 25 | + 'label' => __('Advanced Date Configuration', 'fluentform'), | |
| 26 | + 'placeholder' => __('Advanced Date Configuration', 'fluentform'), | |
| 27 | + 'rows' => (defined('FLUENTFORMPRO')) ? 10 : 2, | |
| 28 | + 'start_text' => (defined('FLUENTFORMPRO')) ? 10 : 2, | |
| 29 | + 'disabled' => ! defined('FLUENTFORMPRO') || ! $fluentformCanAuthorDateConfig, | |
| 30 | + 'css_class' => 'ff_code_editor', | |
| 31 | + 'inline_help_text' => 'Only valid JS object will work. Please check <a target="_blank" href="https://docs.fluentforms.com/time-date-input-field">the documentation for available config options</a>', | |
| 32 | + 'help_text' => __('You can write your own date configuration as JS object. Please write valid configuration as per flatpickr config.', 'fluentform'), | |
| 33 | +]; | |
| 31 | 34 | |
| 32 | -if (!defined('FLUENTFORMPRO')) { | |
| 33 | - $dateConfigSettings['inline_help_text'] = 'Available on Fluent Forms Pro'; | |
| 35 | +if (! defined('FLUENTFORMPRO')) { | |
| 36 | + $fluentformDateConfigSettings['inline_help_text'] = 'Available on Fluent Forms Pro'; | |
| 37 | +} elseif (! $fluentformCanAuthorDateConfig) { | |
| 38 | + $fluentformDateConfigSettings['inline_help_text'] = __('Only administrators can edit the Advanced Date Configuration.', 'fluentform'); | |
| 34 | 39 | } |
| 35 | 40 | |
| 36 | - | |
| 37 | -$element_customization_settings = array( | |
| 38 | - 'name' => array( | |
| 39 | - 'template' => 'nameAttr', | |
| 40 | - 'label' => __('Name Attribute', 'fluentform'), | |
| 41 | +$fluentformElementCustomizationSettings = [ | |
| 42 | + 'name' => [ | |
| 43 | + 'template' => 'nameAttr', | |
| 44 | + 'label' => __('Name Attribute', 'fluentform'), | |
| 41 | 45 | '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 | + ], | |
| 47 | + 'label' => [ | |
| 48 | + 'template' => 'inputText', | |
| 49 | + 'label' => __('Element Label', 'fluentform'), | |
| 46 | 50 | '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 | + ], | |
| 52 | + 'label_placement' => [ | |
| 53 | + 'template' => 'radioButton', | |
| 54 | + 'label' => __('Label Placement', 'fluentform'), | |
| 51 | 55 | '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( | |
| 56 | + 'options' => [ | |
| 57 | + [ | |
| 54 | 58 | 'value' => '', |
| 55 | 59 | 'label' => __('Default', 'fluentform'), |
| 56 | - ), | |
| 57 | - array( | |
| 60 | + ], | |
| 61 | + [ | |
| 58 | 62 | 'value' => 'top', |
| 59 | 63 | 'label' => __('Top', 'fluentform'), |
| 60 | - ), | |
| 61 | - array( | |
| 64 | + ], | |
| 65 | + [ | |
| 62 | 66 | 'value' => 'right', |
| 63 | 67 | 'label' => __('Right', 'fluentform'), |
| 64 | - ), | |
| 65 | - array( | |
| 68 | + ], | |
| 69 | + [ | |
| 66 | 70 | 'value' => 'bottom', |
| 67 | 71 | 'label' => __('Bottom', 'fluentform'), |
| 68 | - ), | |
| 69 | - array( | |
| 72 | + ], | |
| 73 | + [ | |
| 70 | 74 | 'value' => 'left', |
| 71 | 75 | 'label' => __('Left', 'fluentform'), |
| 72 | - ), | |
| 73 | - array( | |
| 76 | + ], | |
| 77 | + [ | |
| 74 | 78 | 'value' => 'hide_label', |
| 75 | 79 | 'label' => __('Hide Label', 'fluentform'), |
| 76 | - ), | |
| 77 | - ), | |
| 78 | - ), | |
| 79 | - 'button_style' => array( | |
| 80 | - 'template' => 'selectBtnStyle', | |
| 81 | - 'label' => __('Button Style', 'fluentform'), | |
| 80 | + ], | |
| 81 | + ], | |
| 82 | + ], | |
| 83 | + 'button_style' => [ | |
| 84 | + 'template' => 'selectBtnStyle', | |
| 85 | + 'label' => __('Button Style', 'fluentform'), | |
| 82 | 86 | 'help_text' => __('Select a button style from the dropdown', 'fluentform'), |
| 83 | - ), | |
| 84 | - 'button_size' => array( | |
| 85 | - 'template' => 'radioButton', | |
| 86 | - 'label' => __('Button Size', 'fluentform'), | |
| 87 | + ], | |
| 88 | + 'button_size' => [ | |
| 89 | + 'template' => 'radioButton', | |
| 90 | + 'label' => __('Button Size', 'fluentform'), | |
| 87 | 91 | 'help_text' => __('Define a size of the button', 'fluentform'), |
| 88 | - 'options' => array( | |
| 89 | - array( | |
| 92 | + 'options' => [ | |
| 93 | + [ | |
| 90 | 94 | 'value' => 'sm', |
| 91 | 95 | 'label' => __('Small', 'fluentform'), |
| 92 | - ), | |
| 93 | - array( | |
| 96 | + ], | |
| 97 | + [ | |
| 94 | 98 | 'value' => 'md', |
| 95 | 99 | 'label' => __('Medium', 'fluentform'), |
| 96 | - ), | |
| 97 | - array( | |
| 100 | + ], | |
| 101 | + [ | |
| 98 | 102 | 'value' => 'lg', |
| 99 | 103 | 'label' => __('Large', 'fluentform'), |
| 100 | - ), | |
| 101 | - ) | |
| 102 | - ), | |
| 103 | - 'placeholder' => array( | |
| 104 | - 'template' => 'inputText', | |
| 105 | - 'label' => __('Placeholder', 'fluentform'), | |
| 104 | + ], | |
| 105 | + ], | |
| 106 | + ], | |
| 107 | + 'placeholder' => [ | |
| 108 | + 'template' => 'inputText', | |
| 109 | + 'label' => __('Placeholder', 'fluentform'), | |
| 106 | 110 | '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, | |
| 111 | + ], | |
| 112 | + 'date_format' => [ | |
| 113 | + 'template' => 'select', | |
| 114 | + 'label' => __('Date Format', 'fluentform'), | |
| 115 | + 'filterable' => true, | |
| 116 | + 'creatable' => true, | |
| 113 | 117 | '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'), | |
| 118 | + 'help_text' => __('Select any date format from the dropdown. The user will be able to choose a date in this given format.', 'fluentform'), | |
| 119 | + 'options' => $fluentformDateFormats, | |
| 120 | + ], | |
| 121 | + 'date_config' => $fluentformDateConfigSettings, | |
| 122 | + 'rows' => [ | |
| 123 | + 'template' => 'inputText', | |
| 124 | + 'label' => __('Rows', 'fluentform'), | |
| 121 | 125 | '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 | + ], | |
| 127 | + 'cols' => [ | |
| 128 | + 'template' => 'inputText', | |
| 129 | + 'label' => __('Columns', 'fluentform'), | |
| 126 | 130 | '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 | + ], | |
| 132 | + 'options' => [ | |
| 133 | + 'template' => 'selectOptions', | |
| 134 | + 'label' => __('Options', 'fluentform'), | |
| 131 | 135 | '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 | + ], | |
| 137 | + 'advanced_options' => [ | |
| 138 | + 'template' => 'advancedOptions', | |
| 139 | + 'label' => __('Options', 'fluentform'), | |
| 136 | 140 | 'help_text' => __('Create visual options for the field and checkmark them for default selection.', 'fluentform'), |
| 137 | - ), | |
| 138 | - 'enable_select_2' => array( | |
| 139 | - 'template' => 'inputYesNoCheckBox', | |
| 140 | - 'label' => __('Enable Searchable Smart Options', 'fluentform'), | |
| 141 | + ], | |
| 142 | + 'enable_option_groups' => [ | |
| 143 | + 'template' => 'inputYesNoCheckBox', | |
| 144 | + 'label' => __('Enable Option Grouping', 'fluentform'), | |
| 145 | + 'help_text' => __('Turn this on to organize dropdown and multiselect options under group labels.', 'fluentform'), | |
| 146 | + ], | |
| 147 | + 'enable_select_2' => [ | |
| 148 | + 'template' => 'inputYesNoCheckBox', | |
| 149 | + 'label' => __('Enable Searchable Smart Options', 'fluentform'), | |
| 141 | 150 | 'help_text' => __('If you enable this then options will be searchable by select2 js library', 'fluentform'), |
| 142 | - ), | |
| 143 | - 'pricing_options' => array( | |
| 144 | - 'template' => 'pricingOptions', | |
| 145 | - 'label' => __('Payment Items', 'fluentform'), | |
| 151 | + 'dependency' => [ | |
| 152 | + 'depends_on' => 'parent_container', | |
| 153 | + 'operator' => '!=', | |
| 154 | + 'value' => 'repeater_container', | |
| 155 | + ], | |
| 156 | + ], | |
| 157 | + 'pricing_options' => [ | |
| 158 | + 'template' => 'pricingOptions', | |
| 159 | + 'label' => __('Payment Items', 'fluentform'), | |
| 146 | 160 | 'help_text' => __('Set your product type and corresponding prices', 'fluentform'), |
| 147 | - ), | |
| 148 | - 'validation_rules' => array( | |
| 149 | - 'template' => 'validationRulesForm', | |
| 150 | - 'label' => __('Validation Rules', 'fluentform'), | |
| 161 | + ], | |
| 162 | + 'subscription_options' => [ | |
| 163 | + 'template' => 'subscriptionOptions', | |
| 164 | + 'label' => __('Subscription Items', 'fluentform'), | |
| 165 | + 'help_text' => __('Set your subscription plans', 'fluentform'), | |
| 166 | + ], | |
| 167 | + 'validation_rules' => [ | |
| 168 | + 'template' => 'validationRulesForm', | |
| 169 | + 'label' => __('Validation Rules', 'fluentform'), | |
| 151 | 170 | 'help_text' => '', |
| 152 | - ), | |
| 153 | - 'required_field_message' => array( | |
| 154 | - 'template' => 'inputRequiredFieldText', | |
| 155 | - 'label' => __('Required Validation Message', 'fluentform'), | |
| 171 | + ], | |
| 172 | + 'required_field_message' => [ | |
| 173 | + 'template' => 'inputRequiredFieldText', | |
| 174 | + 'label' => __('Required Validation Message', 'fluentform'), | |
| 156 | 175 | 'help_text' => 'Message for failed validation for this field', |
| 157 | - ), | |
| 158 | - 'tnc_html' => array( | |
| 159 | - 'template' => 'inputHTML', | |
| 160 | - 'label' => __('Terms & Conditions', 'fluentform'), | |
| 176 | + ], | |
| 177 | + 'tnc_html' => [ | |
| 178 | + 'template' => 'inputHTML', | |
| 179 | + 'label' => __('Terms & Conditions', 'fluentform'), | |
| 161 | 180 | 'help_text' => __('Write HTML content for terms & condition checkbox', 'fluentform'), |
| 162 | - 'rows' => 4, | |
| 163 | - 'cols' => 2, | |
| 164 | - ), | |
| 165 | - 'hook_name' => array( | |
| 166 | - 'template' => 'customHookName', | |
| 167 | - 'label' => __('Hook Name', 'fluentform'), | |
| 181 | + 'rows' => 4, | |
| 182 | + 'cols' => 2, | |
| 183 | + ], | |
| 184 | + 'hook_name' => [ | |
| 185 | + 'template' => 'customHookName', | |
| 186 | + 'label' => __('Hook Name', 'fluentform'), | |
| 168 | 187 | 'help_text' => __('WordPress Hook name to hook something in this place.', 'fluentform'), |
| 169 | - ), | |
| 170 | - 'has_checkbox' => array( | |
| 188 | + ], | |
| 189 | + 'has_checkbox' => [ | |
| 171 | 190 | 'template' => 'inputCheckbox', |
| 172 | - 'options' => array( | |
| 173 | - array( | |
| 191 | + 'options' => [ | |
| 192 | + [ | |
| 174 | 193 | 'value' => true, |
| 175 | 194 | 'label' => __('Show Checkbox', 'fluentform'), |
| 176 | - ), | |
| 177 | - ), | |
| 178 | - ), | |
| 179 | - 'html_codes' => array( | |
| 180 | - 'template' => 'inputHTML', | |
| 181 | - 'rows' => 4, | |
| 182 | - 'cols' => 2, | |
| 183 | - 'label' => __('HTML Code', 'fluentform'), | |
| 195 | + ], | |
| 196 | + ], | |
| 197 | + ], | |
| 198 | + 'html_codes' => [ | |
| 199 | + 'template' => 'inputHTML', | |
| 200 | + 'rows' => 4, | |
| 201 | + 'cols' => 2, | |
| 202 | + 'label' => __('HTML Code', 'fluentform'), | |
| 184 | 203 | 'help_text' => __('Your valid HTML code will be shown to the user as normal content.', 'fluentform'), |
| 185 | - ), | |
| 186 | - 'description' => array( | |
| 187 | - 'template' => 'inputHTML', | |
| 188 | - 'rows' => 4, | |
| 189 | - 'cols' => 2, | |
| 190 | - 'label' => __('Description', 'fluentform'), | |
| 204 | + ], | |
| 205 | + 'description' => [ | |
| 206 | + 'template' => 'inputHTML', | |
| 207 | + 'rows' => 4, | |
| 208 | + 'cols' => 2, | |
| 209 | + 'label' => __('Description', 'fluentform'), | |
| 191 | 210 | 'help_text' => __('Description will be shown to the user as normal text content.', 'fluentform'), |
| 192 | - ), | |
| 193 | - 'btn_text' => array( | |
| 194 | - 'template' => 'inputText', | |
| 195 | - 'label' => __('Button Text', 'fluentform'), | |
| 211 | + ], | |
| 212 | + 'btn_text' => [ | |
| 213 | + 'template' => 'inputText', | |
| 214 | + 'label' => __('Button Text', 'fluentform'), | |
| 196 | 215 | 'help_text' => __('This will be visible as button text for upload file.', 'fluentform'), |
| 197 | - ), | |
| 198 | - 'button_ui' => array( | |
| 199 | - 'template' => 'prevNextButton', | |
| 200 | - 'label' => __('Submit Button', 'fluentform'), | |
| 201 | - 'help_text' => __('This is form submission button.', 'fluentform'), | |
| 202 | - ), | |
| 203 | - 'align' => array( | |
| 204 | - 'template' => 'radio', | |
| 205 | - 'label' => __('Content Alignment', 'fluentform'), | |
| 216 | + ], | |
| 217 | + 'button_ui' => [ | |
| 218 | + 'template' => 'prevNextButton', | |
| 219 | + 'label' => __('Button Text', 'fluentform'), | |
| 220 | + 'help_text' => __('Set as a default button or image icon type button', 'fluentform'), | |
| 221 | + ], | |
| 222 | + 'align' => [ | |
| 223 | + 'template' => 'radio', | |
| 224 | + 'label' => __('Content Alignment', 'fluentform'), | |
| 206 | 225 | 'help_text' => __('How the content will be aligned.', 'fluentform'), |
| 207 | - 'options' => array( | |
| 208 | - array( | |
| 226 | + 'options' => [ | |
| 227 | + [ | |
| 209 | 228 | 'value' => 'left', |
| 210 | 229 | 'label' => __('Left', 'fluentform'), |
| 211 | - ), | |
| 212 | - array( | |
| 230 | + ], | |
| 231 | + [ | |
| 213 | 232 | 'value' => 'center', |
| 214 | 233 | 'label' => __('Center', 'fluentform'), |
| 215 | - ), | |
| 216 | - array( | |
| 234 | + ], | |
| 235 | + [ | |
| 217 | 236 | 'value' => 'right', |
| 218 | 237 | 'label' => __('Right', 'fluentform'), |
| 219 | - ), | |
| 220 | - ), | |
| 221 | - ), | |
| 222 | - 'shortcode' => array( | |
| 223 | - 'template' => 'inputText', | |
| 224 | - 'label' => __('Shortcode', 'fluentform'), | |
| 238 | + ], | |
| 239 | + ], | |
| 240 | + ], | |
| 241 | + 'shortcode' => [ | |
| 242 | + 'template' => 'inputText', | |
| 243 | + 'label' => __('Shortcode', 'fluentform'), | |
| 225 | 244 | 'help_text' => __('Your shortcode to render desired content in current place.', 'fluentform'), |
| 226 | - ), | |
| 227 | - 'apply_styles' => array( | |
| 228 | - 'template' => 'radioButton', | |
| 229 | - 'label' => __('Apply Styles', 'fluentform'), | |
| 245 | + ], | |
| 246 | + 'apply_styles' => [ | |
| 247 | + 'template' => 'radioButton', | |
| 248 | + 'label' => __('Apply Styles', 'fluentform'), | |
| 230 | 249 | 'help_text' => __('Apply styles provided here', 'fluentform'), |
| 231 | - 'options' => array( | |
| 232 | - array( | |
| 250 | + 'options' => [ | |
| 251 | + [ | |
| 233 | 252 | 'value' => true, |
| 234 | 253 | 'label' => __('Yes', 'fluentform'), |
| 235 | - ), | |
| 236 | - array( | |
| 254 | + ], | |
| 255 | + [ | |
| 237 | 256 | 'value' => false, |
| 238 | 257 | 'label' => __('No', 'fluentform'), |
| 239 | - ) | |
| 240 | - ), | |
| 241 | - ), | |
| 242 | - 'step_title' => array( | |
| 243 | - 'template' => 'inputText', | |
| 244 | - 'label' => __('Step Title', 'fluentform'), | |
| 258 | + ], | |
| 259 | + ], | |
| 260 | + ], | |
| 261 | + 'step_title' => [ | |
| 262 | + 'template' => 'inputText', | |
| 263 | + 'label' => __('Step Title', 'fluentform'), | |
| 245 | 264 | 'help_text' => __('Form step titles, user will see each title in each step.', 'fluentform'), |
| 246 | - ), | |
| 247 | - 'disable_auto_focus' => array( | |
| 248 | - 'template' => 'inputYesNoCheckBox', | |
| 249 | - 'label' => __('Disable auto focus when changing each page', 'fluentform'), | |
| 265 | + ], | |
| 266 | + 'disable_auto_focus' => [ | |
| 267 | + 'template' => 'inputYesNoCheckBox', | |
| 268 | + 'label' => __('Disable auto focus when changing each page', 'fluentform'), | |
| 250 | 269 | 'help_text' => __('If you enable this then on page transition automatic scrolling will be disabled', 'fluentform'), |
| 251 | - ), | |
| 252 | - 'enable_auto_slider' => array( | |
| 253 | - 'template' => 'inputYesNoCheckBox', | |
| 254 | - 'label' => __('Enable auto page change for single radio field', 'fluentform'), | |
| 270 | + ], | |
| 271 | + 'enable_auto_slider' => [ | |
| 272 | + 'template' => 'inputYesNoCheckBox', | |
| 273 | + 'label' => __('Enable auto page change for single radio field', 'fluentform'), | |
| 255 | 274 | 'help_text' => __('If you enable this then for last radio item field will trigger next page change', 'fluentform'), |
| 256 | - ), | |
| 257 | - 'enable_step_data_persistency' => array( | |
| 258 | - 'template' => 'inputYesNoCheckBox', | |
| 259 | - 'label' => __('Enable Per step data save (Save and Continue)', 'fluentform'), | |
| 275 | + ], | |
| 276 | + 'enable_step_data_persistency' => [ | |
| 277 | + 'template' => 'inputYesNoCheckBox', | |
| 278 | + 'label' => __('Enable Per step data save (Save and Continue)', 'fluentform'), | |
| 260 | 279 | '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'), |
| 261 | - ), | |
| 262 | - 'enable_step_page_resume' => array( | |
| 263 | - 'template' => 'inputYesNoCheckBox', | |
| 264 | - 'label' => __('Resume Step from last form session', 'fluentform'), | |
| 265 | - 'help_text' => __('If you enable this then users will see the form as step page where it has been left', 'fluentform'), | |
| 266 | - 'dependency' => array( | |
| 280 | + ], | |
| 281 | + 'enable_step_page_resume' => [ | |
| 282 | + 'template' => 'inputYesNoCheckBox', | |
| 283 | + 'label' => __('Resume Step from last form session', 'fluentform'), | |
| 284 | + 'help_text' => __('If you enable this then users will see the form as step page where it has been left', 'fluentform'), | |
| 285 | + 'dependency' => [ | |
| 267 | 286 | 'depends_on' => 'settings/enable_step_data_persistency', |
| 268 | - 'value' => 'yes', | |
| 269 | - 'operator' => '==' | |
| 270 | - ) | |
| 271 | - ), | |
| 272 | - 'progress_indicator' => array( | |
| 273 | - 'template' => 'radio', | |
| 274 | - 'label' => __('Progress Indicator', 'fluentform'), | |
| 287 | + 'value' => 'yes', | |
| 288 | + 'operator' => '==', | |
| 289 | + ], | |
| 290 | + ], | |
| 291 | + 'progress_indicator' => [ | |
| 292 | + 'template' => 'radio', | |
| 293 | + 'label' => __('Progress Indicator', 'fluentform'), | |
| 275 | 294 | 'help_text' => __('Select any of them below, user will see progress of form steps according to your choice.', 'fluentform'), |
| 276 | - 'options' => array( | |
| 277 | - array( | |
| 295 | + 'options' => [ | |
| 296 | + [ | |
| 278 | 297 | 'value' => 'progress-bar', |
| 279 | 298 | 'label' => __('Progress Bar', 'fluentform'), |
| 280 | - ), | |
| 281 | - array( | |
| 299 | + ], | |
| 300 | + [ | |
| 282 | 301 | 'value' => 'steps', |
| 283 | 302 | 'label' => __('Steps', 'fluentform'), |
| 284 | - ), | |
| 285 | - array( | |
| 303 | + ], | |
| 304 | + [ | |
| 305 | + 'value' => 'tabs', | |
| 306 | + 'label' => __('Tabs', 'fluentform'), | |
| 307 | + ], | |
| 308 | + [ | |
| 286 | 309 | 'value' => '', |
| 287 | 310 | 'label' => __('None', 'fluentform'), |
| 288 | - ), | |
| 289 | - ), | |
| 290 | - ), | |
| 291 | - 'step_titles' => array( | |
| 292 | - 'template' => 'customStepTitles', | |
| 293 | - 'label' => __('Step Titles', 'fluentform'), | |
| 311 | + ], | |
| 312 | + ], | |
| 313 | + ], | |
| 314 | + 'progress_layout' => [ | |
| 315 | + 'template' => 'radioButton', | |
| 316 | + 'label' => __('Tab Position', 'fluentform'), | |
| 317 | + 'help_text' => __('Choose how step tabs should be displayed on the frontend.', 'fluentform'), | |
| 318 | + 'options' => [ | |
| 319 | + [ | |
| 320 | + 'value' => 'top', | |
| 321 | + 'label' => __('Top', 'fluentform'), | |
| 322 | + ], | |
| 323 | + [ | |
| 324 | + 'value' => 'left', | |
| 325 | + 'label' => __('Left', 'fluentform'), | |
| 326 | + ], | |
| 327 | + ], | |
| 328 | + 'dependency' => [ | |
| 329 | + 'depends_on' => 'settings/progress_indicator', | |
| 330 | + 'value' => 'tabs', | |
| 331 | + 'operator' => '==', | |
| 332 | + ], | |
| 333 | + ], | |
| 334 | + 'tabs_show_progress_bar' => [ | |
| 335 | + 'template' => 'inputYesNoCheckBox', | |
| 336 | + 'label' => __('Show Progress Bar Under Tabs', 'fluentform'), | |
| 337 | + 'help_text' => __('Enable a compact progress bar under the step tabs.', 'fluentform'), | |
| 338 | + 'dependency' => [ | |
| 339 | + 'depends_on' => 'settings/progress_indicator', | |
| 340 | + 'value' => 'tabs', | |
| 341 | + 'operator' => '==', | |
| 342 | + ], | |
| 343 | + ], | |
| 344 | + 'step_animation' => [ | |
| 345 | + 'template' => 'radioButton', | |
| 346 | + 'label' => __('Animation type', 'fluentform'), | |
| 347 | + 'help_text' => __('Select any of them below, steps will change according to your choice.', 'fluentform'), | |
| 348 | + 'options' => [ | |
| 349 | + [ | |
| 350 | + 'value' => 'slide', | |
| 351 | + 'label' => __('Slide Left/Right', 'fluentform'), | |
| 352 | + ], | |
| 353 | + [ | |
| 354 | + 'value' => 'fade', | |
| 355 | + 'label' => __('Fade In/Out', 'fluentform'), | |
| 356 | + ], | |
| 357 | + [ | |
| 358 | + 'value' => 'slide_down', | |
| 359 | + 'label' => __('Slide Down/Up', 'fluentform'), | |
| 360 | + ], | |
| 361 | + [ | |
| 362 | + 'value' => 'none', | |
| 363 | + 'label' => __('None', 'fluentform'), | |
| 364 | + ], | |
| 365 | + ], | |
| 366 | + ], | |
| 367 | + 'step_titles' => [ | |
| 368 | + 'template' => 'customStepTitles', | |
| 369 | + 'label' => __('Step Titles', 'fluentform'), | |
| 294 | 370 | 'help_text' => __('Form step titles, user will see each title in each step.', 'fluentform'), |
| 295 | - ), | |
| 296 | - 'prev_btn' => array( | |
| 297 | - 'template' => 'prevNextButton', | |
| 298 | - 'label' => __('Previous Button', 'fluentform'), | |
| 371 | + ], | |
| 372 | + 'prev_btn' => [ | |
| 373 | + 'template' => 'prevNextButton', | |
| 374 | + 'label' => __('Previous Button', 'fluentform'), | |
| 299 | 375 | 'help_text' => __('Multi-step form\'s previous button', 'fluentform'), |
| 300 | - ), | |
| 301 | - 'next_btn' => array( | |
| 302 | - 'template' => 'prevNextButton', | |
| 303 | - 'label' => __('Next Button', 'fluentform'), | |
| 376 | + ], | |
| 377 | + 'next_btn' => [ | |
| 378 | + 'template' => 'prevNextButton', | |
| 379 | + 'label' => __('Next Button', 'fluentform'), | |
| 304 | 380 | 'help_text' => __('Multi-step form\'s next button', 'fluentform'), |
| 305 | - ), | |
| 306 | - 'address_fields' => array( | |
| 381 | + ], | |
| 382 | + 'address_fields' => [ | |
| 307 | 383 | 'template' => 'addressFields', |
| 308 | - 'label' => __('Address Fields', 'fluentform'), | |
| 309 | - ), | |
| 310 | - 'name_fields' => array( | |
| 384 | + 'label' => __('Address Fields', 'fluentform'), | |
| 385 | + 'key' => 'country_list', | |
| 386 | + ], | |
| 387 | + 'name_fields' => [ | |
| 311 | 388 | 'template' => 'nameFields', |
| 312 | - 'label' => __('Name Fields', 'fluentform'), | |
| 313 | - ), | |
| 314 | - 'multi_column' => array( | |
| 389 | + 'label' => __('Name Fields', 'fluentform'), | |
| 390 | + ], | |
| 391 | + 'multi_column' => [ | |
| 315 | 392 | 'template' => 'inputCheckbox', |
| 316 | - 'options' => array( | |
| 317 | - array( | |
| 393 | + 'options' => [ | |
| 394 | + [ | |
| 318 | 395 | 'value' => true, |
| 319 | 396 | 'label' => __('Enable Multiple Columns', 'fluentform'), |
| 320 | - ), | |
| 321 | - ), | |
| 322 | - ), | |
| 323 | - 'repeat_fields' => array( | |
| 324 | - 'template' => 'customRepeatFields', | |
| 325 | - 'label' => __('Repeat Fields', 'fluentform'), | |
| 397 | + ], | |
| 398 | + ], | |
| 399 | + ], | |
| 400 | + 'repeat_fields' => [ | |
| 401 | + 'template' => 'customRepeatFields', | |
| 402 | + 'label' => __('Repeat Fields', 'fluentform'), | |
| 326 | 403 | 'help_text' => __('This is a form field which a user will be able to repeat.', 'fluentform'), |
| 327 | - ), | |
| 328 | - 'admin_field_label' => array( | |
| 329 | - 'template' => 'inputText', | |
| 330 | - 'label' => __('Admin Field Label', 'fluentform'), | |
| 404 | + ], | |
| 405 | + 'admin_field_label' => [ | |
| 406 | + 'template' => 'inputText', | |
| 407 | + 'label' => __('Admin Field Label', 'fluentform'), | |
| 331 | 408 | 'help_text' => __('Admin field label is field title which will be used for admin field title.', 'fluentform'), |
| 332 | - ), | |
| 333 | - 'maxlength' => array( | |
| 334 | - 'template' => 'inputNumber', | |
| 335 | - 'label' => __('Max text length', 'fluentform'), | |
| 409 | + ], | |
| 410 | + 'maxlength' => [ | |
| 411 | + 'template' => 'inputNumber', | |
| 412 | + 'label' => __('Max text length', 'fluentform'), | |
| 336 | 413 | 'help_text' => __('The maximum number of characters the input should accept', 'fluentform'), |
| 337 | - ), | |
| 338 | - 'value' => array( | |
| 339 | - 'template' => 'inputValue', | |
| 340 | - 'label' => __('Default Value', 'fluentform'), | |
| 414 | + ], | |
| 415 | + 'value' => [ | |
| 416 | + 'template' => 'inputValue', | |
| 417 | + 'label' => __('Default Value', 'fluentform'), | |
| 418 | + 'help_text' => __('If you would like to pre-populate the value of a field, enter it here.', 'fluentform') . ' <a target="_blank" rel="noopener" href="https://wpmanageninja.com/docs/fluent-form/miscellaneous/form-editor-smart-codes/">View All the smartcodes here</a>', | |
| 419 | + ], | |
| 420 | + 'dynamic_default_value' => [ | |
| 421 | + 'template' => 'inputValue', | |
| 422 | + 'type' => 'text', | |
| 423 | + 'label' => __('Dynamic Default Value', 'fluentform'), | |
| 341 | 424 | 'help_text' => __('If you would like to pre-populate the value of a field, enter it here.', 'fluentform'), |
| 342 | - ), | |
| 343 | - 'dynamic_default_value' => array( | |
| 344 | - 'template' => 'inputValue', | |
| 345 | - 'type' => 'text', | |
| 346 | - 'label' => __('Dynamic Default Value', 'fluentform'), | |
| 347 | - 'help_text' => __('If you would like to pre-populate the value of a field, enter it here.', 'fluentform'), | |
| 348 | - ), | |
| 349 | - 'max_selection' => array( | |
| 350 | - 'template' => 'inputNumber', | |
| 351 | - 'type' => 'text', | |
| 352 | - 'label' => __('Max Selection', 'fluentform'), | |
| 353 | - 'help_text' => __('Define Max selections items that a user can select .', 'fluentform'), | |
| 354 | - 'dependency' => array( | |
| 425 | + ], | |
| 426 | + 'max_selection' => [ | |
| 427 | + 'template' => 'inputNumber', | |
| 428 | + 'type' => 'text', | |
| 429 | + 'label' => __('Max Selection', 'fluentform'), | |
| 430 | + 'help_text' => __('Define Max selections items that a user can select .', 'fluentform'), | |
| 431 | + 'dependency' => [ | |
| 355 | 432 | 'depends_on' => 'attributes/multiple', |
| 356 | - 'value' => true, | |
| 357 | - 'operator' => '==' | |
| 358 | - ) | |
| 359 | - ), | |
| 360 | - 'container_class' => array( | |
| 361 | - 'template' => 'inputText', | |
| 362 | - 'label' => __('Container Class', 'fluentform'), | |
| 433 | + 'value' => true, | |
| 434 | + 'operator' => '==', | |
| 435 | + ], | |
| 436 | + ], | |
| 437 | + 'container_class' => [ | |
| 438 | + 'template' => 'inputText', | |
| 439 | + 'label' => __('Container Class', 'fluentform'), | |
| 363 | 440 | 'help_text' => __('Class for the field wrapper. This can be used to style current element.', 'fluentform'), |
| 364 | - ), | |
| 365 | - 'class' => array( | |
| 366 | - 'template' => 'inputText', | |
| 367 | - 'label' => __('Element Class', 'fluentform'), | |
| 441 | + ], | |
| 442 | + 'class' => [ | |
| 443 | + 'template' => 'inputText', | |
| 444 | + 'label' => __('Element Class', 'fluentform'), | |
| 368 | 445 | 'help_text' => __('Class for the field. This can be used to style current element.', 'fluentform'), |
| 369 | - ), | |
| 370 | - 'country_list' => array( | |
| 446 | + ], | |
| 447 | + 'country_list' => [ | |
| 371 | 448 | 'template' => 'customCountryList', |
| 372 | - 'label' => __('Country List', 'fluentform'), | |
| 373 | - 'key' => 'country_list' | |
| 374 | - ), | |
| 375 | - 'product_field_types' => array( | |
| 449 | + 'label' => __('Country List', 'fluentform'), | |
| 450 | + 'key' => 'country_list', | |
| 451 | + ], | |
| 452 | + 'product_field_types' => [ | |
| 376 | 453 | 'template' => 'productFieldTypes', |
| 377 | - 'label' => __('Options', 'fluentform'), | |
| 378 | - ), | |
| 379 | - 'help_message' => array( | |
| 380 | - 'template' => 'inputTextarea', | |
| 381 | - 'label' => __('Help Message', 'fluentform'), | |
| 454 | + 'label' => __('Options', 'fluentform'), | |
| 455 | + ], | |
| 456 | + 'help_message' => [ | |
| 457 | + 'template' => 'inputTextarea', | |
| 458 | + 'label' => __('Help Message', 'fluentform'), | |
| 382 | 459 | 'help_text' => __('Help message will be shown as tooltip next to sidebar or below the field.', 'fluentform'), |
| 383 | - ), | |
| 384 | - 'conditional_logics' => array( | |
| 385 | - 'template' => 'conditionalLogics', | |
| 386 | - 'label' => __('Conditional Logic', 'fluentform'), | |
| 460 | + ], | |
| 461 | + 'conditional_logics' => [ | |
| 462 | + 'template' => 'conditionalLogics', | |
| 463 | + 'label' => __('Conditional Logic', 'fluentform'), | |
| 387 | 464 | 'help_text' => __('Create rules to dynamically display or hide this field based on values from another field.', 'fluentform'), |
| 388 | - ), | |
| 389 | - 'background_color' => array( | |
| 390 | - 'template' => 'inputColor', | |
| 391 | - 'label' => __('Background Color', 'fluentform'), | |
| 392 | - 'help_text' => __('The Background color of the element', 'fluentform') | |
| 393 | - ), | |
| 394 | - 'color' => array( | |
| 395 | - 'template' => 'inputColor', | |
| 396 | - 'label' => __('Font Color', 'fluentform'), | |
| 397 | - 'help_text' => __('Font color of the element', 'fluentform') | |
| 398 | - ), | |
| 399 | - 'data-mask' => array( | |
| 400 | - 'template' => 'customMask', | |
| 401 | - 'label' => __('Custom Mask', 'fluentform'), | |
| 402 | - 'help_text' => __('Write your own mask for this input', 'fluentform'), | |
| 403 | - 'dependency' => array( | |
| 465 | + ], | |
| 466 | + 'background_color' => [ | |
| 467 | + 'template' => 'inputColor', | |
| 468 | + 'label' => __('Background Color', 'fluentform'), | |
| 469 | + 'help_text' => __('The Background color of the element', 'fluentform'), | |
| 470 | + ], | |
| 471 | + 'color' => [ | |
| 472 | + 'template' => 'inputColor', | |
| 473 | + 'label' => __('Font Color', 'fluentform'), | |
| 474 | + 'help_text' => __('Font color of the element', 'fluentform'), | |
| 475 | + ], | |
| 476 | + 'data-mask' => [ | |
| 477 | + 'template' => 'customMask', | |
| 478 | + 'label' => __('Custom Mask', 'fluentform'), | |
| 479 | + 'help_text' => __('Write your own mask for this input', 'fluentform'), | |
| 480 | + 'dependency' => [ | |
| 404 | 481 | 'depends_on' => 'settings/temp_mask', |
| 405 | - 'value' => 'custom', | |
| 406 | - 'operator' => '==' | |
| 407 | - ) | |
| 408 | - ), | |
| 409 | - 'data-mask-reverse' => array( | |
| 410 | - 'template' => 'inputYesNoCheckBox', | |
| 411 | - 'label' => __('Activating a reversible mask', 'fluentform'), | |
| 412 | - 'help_text' => __('If you enable this then it the mask will work as reverse', 'fluentform'), | |
| 413 | - 'dependency' => array( | |
| 482 | + 'value' => 'custom', | |
| 483 | + 'operator' => '==', | |
| 484 | + ], | |
| 485 | + ], | |
| 486 | + 'data-mask-reverse' => [ | |
| 487 | + 'template' => 'inputYesNoCheckBox', | |
| 488 | + 'label' => __('Activating a reversible mask', 'fluentform'), | |
| 489 | + 'help_text' => __('If you enable this then it the mask will work as reverse', 'fluentform'), | |
| 490 | + 'dependency' => [ | |
| 414 | 491 | 'depends_on' => 'settings/temp_mask', |
| 415 | - 'value' => 'custom', | |
| 416 | - 'operator' => '==' | |
| 417 | - ) | |
| 418 | - ), | |
| 419 | - 'randomize_options' => array( | |
| 420 | - 'template' => 'inputYesNoCheckBox', | |
| 421 | - 'label' => __('Shuffle the available options', 'fluentform'), | |
| 422 | - 'help_text' => __('If you enable this then the checkable options will be shuffled', 'fluentform') | |
| 423 | - ), | |
| 424 | - 'data-clear-if-not-match' => array( | |
| 425 | - 'template' => 'inputYesNoCheckBox', | |
| 426 | - 'label' => __('Clear if not match', 'fluentform'), | |
| 427 | - 'help_text' => __('Clear value if not match the mask', 'fluentform'), | |
| 428 | - 'dependency' => array( | |
| 492 | + 'value' => 'custom', | |
| 493 | + 'operator' => '==', | |
| 494 | + ], | |
| 495 | + ], | |
| 496 | + 'randomize_options' => [ | |
| 497 | + 'template' => 'inputYesNoCheckBox', | |
| 498 | + 'label' => __('Shuffle the available options', 'fluentform'), | |
| 499 | + 'help_text' => __('If you enable this then the checkable options will be shuffled', 'fluentform'), | |
| 500 | + ], | |
| 501 | + 'data-clear-if-not-match' => [ | |
| 502 | + 'template' => 'inputYesNoCheckBox', | |
| 503 | + 'label' => __('Clear if not match', 'fluentform'), | |
| 504 | + 'help_text' => __('Clear value if not match the mask', 'fluentform'), | |
| 505 | + 'dependency' => [ | |
| 429 | 506 | 'depends_on' => 'settings/temp_mask', |
| 430 | - 'value' => 'custom', | |
| 431 | - 'operator' => '==' | |
| 432 | - ) | |
| 433 | - ), | |
| 434 | - 'temp_mask' => array( | |
| 435 | - 'template' => 'select', | |
| 436 | - 'label' => __('Mask Input', 'fluentform'), | |
| 507 | + 'value' => 'custom', | |
| 508 | + 'operator' => '==', | |
| 509 | + ], | |
| 510 | + ], | |
| 511 | + 'temp_mask' => [ | |
| 512 | + 'template' => 'select', | |
| 513 | + 'label' => __('Mask Input', 'fluentform'), | |
| 437 | 514 | 'help_text' => __('Select a mask for the input field', 'fluentform'), |
| 438 | - 'options' => array( | |
| 439 | - array( | |
| 515 | + 'options' => [ | |
| 516 | + [ | |
| 440 | 517 | 'value' => '', |
| 441 | 518 | 'label' => __('None', 'fluentform'), |
| 442 | - ), | |
| 443 | - array( | |
| 519 | + ], | |
| 520 | + [ | |
| 444 | 521 | 'value' => '(000) 000-0000', |
| 445 | 522 | 'label' => '(###) ###-####', |
| 446 | - ), | |
| 447 | - array( | |
| 523 | + ], | |
| 524 | + [ | |
| 448 | 525 | 'value' => '(00) 0000-0000', |
| 449 | 526 | 'label' => '(##) ####-####', |
| 450 | - ), | |
| 451 | - array( | |
| 527 | + ], | |
| 528 | + [ | |
| 452 | 529 | 'value' => '00/00/0000', |
| 453 | 530 | 'label' => __('23/03/2018', 'fluentform'), |
| 454 | - ), | |
| 455 | - array( | |
| 531 | + ], | |
| 532 | + [ | |
| 456 | 533 | 'value' => '00:00:00', |
| 457 | 534 | 'label' => __('23:59:59', 'fluentform'), |
| 458 | - ), | |
| 459 | - array( | |
| 535 | + ], | |
| 536 | + [ | |
| 460 | 537 | 'value' => '00/00/0000 00:00:00', |
| 461 | 538 | 'label' => __('23/03/2018 23:59:59', 'fluentform'), |
| 462 | - ), | |
| 463 | - array( | |
| 539 | + ], | |
| 540 | + [ | |
| 464 | 541 | 'value' => 'custom', |
| 465 | 542 | 'label' => __('Custom', 'fluentform'), |
| 466 | - ) | |
| 467 | - ), | |
| 468 | - ), | |
| 469 | - 'grid_columns' => array( | |
| 470 | - 'template' => 'gridRowCols', | |
| 471 | - 'label' => __('Grid Columns', 'fluentform'), | |
| 543 | + ], | |
| 544 | + ], | |
| 545 | + ], | |
| 546 | + 'grid_columns' => [ | |
| 547 | + 'template' => 'gridRowCols', | |
| 548 | + 'label' => __('Grid Columns', 'fluentform'), | |
| 472 | 549 | 'help_text' => __('Write your own mask for this input', 'fluentform'), |
| 473 | - ), | |
| 474 | - 'grid_rows' => array( | |
| 475 | - 'template' => 'gridRowCols', | |
| 476 | - 'label' => __('Grid Rows', 'fluentform'), | |
| 550 | + ], | |
| 551 | + 'grid_rows' => [ | |
| 552 | + 'template' => 'gridRowCols', | |
| 553 | + 'label' => __('Grid Rows', 'fluentform'), | |
| 477 | 554 | 'help_text' => __('Write your own mask for this input', 'fluentform'), |
| 478 | - ), | |
| 479 | - 'tabular_field_type' => array( | |
| 480 | - 'template' => 'radio', | |
| 481 | - 'label' => __('Field Type', 'fluentform'), | |
| 555 | + ], | |
| 556 | + 'tabular_field_type' => [ | |
| 557 | + 'template' => 'radio', | |
| 558 | + 'label' => __('Field Type', 'fluentform'), | |
| 482 | 559 | 'help_text' => __('Field Type', 'fluentform'), |
| 483 | - 'options' => array( | |
| 484 | - array( | |
| 560 | + 'options' => [ | |
| 561 | + [ | |
| 485 | 562 | 'value' => 'checkbox', |
| 486 | 563 | 'label' => __('Checkbox', 'fluentform'), |
| 487 | - ), | |
| 488 | - array( | |
| 564 | + ], | |
| 565 | + [ | |
| 489 | 566 | 'value' => 'radio', |
| 490 | 567 | 'label' => __('Radio', 'fluentform'), |
| 491 | - ), | |
| 492 | - ) | |
| 493 | - ), | |
| 494 | - 'max_repeat_field' => array( | |
| 495 | - 'template' => 'inputNumber', | |
| 496 | - 'label' => __('Max Repeat inputs', 'fluentform'), | |
| 497 | - 'help_text' => __('Please provide max number of rows the user can fill up for this repeat field. Keep blank/0 for unlimited numbers', 'fluentform') | |
| 498 | - ), | |
| 499 | - 'calculation_settings' => array( | |
| 500 | - 'template' => (defined('FLUENTFORMPRO')) ? 'inputCalculationSettings' : 'infoBlock', | |
| 501 | - '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', | |
| 502 | - 'label' => 'Calculation Field Settings', | |
| 503 | - 'status_label' => 'Enable Calculation', | |
| 568 | + ], | |
| 569 | + ], | |
| 570 | + ], | |
| 571 | + 'max_repeat_field' => [ | |
| 572 | + 'template' => 'inputNumber', | |
| 573 | + 'label' => __('Max Repeat inputs', 'fluentform'), | |
| 574 | + 'help_text' => __('Please provide max number of rows the user can fill up for this repeat field. Keep blank/0 for unlimited numbers', 'fluentform'), | |
| 575 | + ], | |
| 576 | + 'calculation_settings' => [ | |
| 577 | + 'template' => (defined('FLUENTFORMPRO')) ? 'inputCalculationSettings' : 'infoBlock', | |
| 578 | + 'text' => '<strong>Calculation Field Settings</strong><br/>Calculate the value based on other numeric field is available on pro version of Fluent Forms. Please install Fluent Forms Pro to use this feature <br /> <a target="_blank" rel="noopener" href="' . esc_url(fluentform_upgrade_url('feature_lock_calculation')) . '"> | |
| 579 | + Upgrade to Pro </a>', | |
| 580 | + 'label' => 'Calculation Field Settings', | |
| 581 | + 'status_label' => 'Enable Calculation', | |
| 504 | 582 | 'formula_label' => 'Calculation Expression', |
| 505 | - 'formula_tips' => 'You can use + - * / for calculating the the value. Use context icon to insert the input values', | |
| 506 | - 'status_tips' => 'Enable this and provide formula expression if you want this field as calculated based on other numeric field value' | |
| 507 | - ), | |
| 508 | - 'min' => array( | |
| 509 | - 'template' => 'inputNumber', | |
| 510 | - 'label' => __('Min Value', 'fluentform'), | |
| 511 | - 'help_text' => __('Please provide minimum value', 'fluentform') | |
| 512 | - ), | |
| 513 | - 'max' => array( | |
| 514 | - 'template' => 'inputNumber', | |
| 515 | - 'label' => __('Max Value', 'fluentform'), | |
| 516 | - 'help_text' => __('Please provide Maximum value', 'fluentform') | |
| 517 | - ), | |
| 518 | - 'number_step' => array( | |
| 519 | - 'template' => 'inputText', | |
| 520 | - 'label' => __('Step', 'fluentform'), | |
| 521 | - 'help_text' => __('Please provide step attribute for this field. Give value "any" for floating value', 'fluentform') | |
| 522 | - ), | |
| 523 | - 'prefix_label' => array( | |
| 524 | - 'template' => 'inputText', | |
| 525 | - 'label' => __('Prefix Label', 'fluentform'), | |
| 526 | - 'help_text' => __('Provide Input Prefix Label. It will show in the input field as prefix label', 'fluentform') | |
| 527 | - ), | |
| 528 | - 'suffix_label' => array( | |
| 529 | - 'template' => 'inputText', | |
| 530 | - 'label' => __('Suffix Label', 'fluentform'), | |
| 531 | - 'help_text' => __('Provide Input Suffix Label. It will show in the input field as suffix label', 'fluentform') | |
| 532 | - ), | |
| 533 | - 'is_unique' => array( | |
| 534 | - 'template' => 'inputYesNoCheckBox', | |
| 535 | - 'label' => __('Validate as Unique', 'fluentform'), | |
| 536 | - 'help_text' => __('If you make it unique then it will validate as unique from previous submissions of this form', 'fluentform') | |
| 537 | - ), | |
| 538 | - 'show_text' => array( | |
| 539 | - 'template' => 'select', | |
| 540 | - 'label' => __('Show Text', 'fluentform'), | |
| 583 | + 'formula_tips' => 'You can use + - * / for calculating the the value. Use context icon to insert the input values', | |
| 584 | + 'status_tips' => 'Enable this and provide formula expression if you want this field as calculated based on other numeric field value', | |
| 585 | + ], | |
| 586 | + 'min' => [ | |
| 587 | + 'template' => 'inputNumber', | |
| 588 | + 'label' => __('Min Value', 'fluentform'), | |
| 589 | + 'help_text' => __('Please provide minimum value', 'fluentform'), | |
| 590 | + ], | |
| 591 | + 'max' => [ | |
| 592 | + 'template' => 'inputNumber', | |
| 593 | + 'label' => __('Max Value', 'fluentform'), | |
| 594 | + 'help_text' => __('Please provide Maximum value', 'fluentform'), | |
| 595 | + ], | |
| 596 | + 'digits' => [ | |
| 597 | + 'template' => 'inputNumber', | |
| 598 | + 'label' => __('Digits Count', 'fluentform'), | |
| 599 | + 'help_text' => __('Please provide digits count value', 'fluentform'), | |
| 600 | + ], | |
| 601 | + 'number_step' => [ | |
| 602 | + 'template' => 'inputText', | |
| 603 | + 'label' => __('Step', 'fluentform'), | |
| 604 | + 'help_text' => __('Please provide step attribute for this field.', 'fluentform'), | |
| 605 | + ], | |
| 606 | + 'prefix_label' => [ | |
| 607 | + 'template' => 'inputText', | |
| 608 | + 'label' => __('Prefix Label', 'fluentform'), | |
| 609 | + 'help_text' => __('Provide Input Prefix Label. It will show in the input field as prefix label', 'fluentform'), | |
| 610 | + ], | |
| 611 | + 'suffix_label' => [ | |
| 612 | + 'template' => 'inputText', | |
| 613 | + 'label' => __('Suffix Label', 'fluentform'), | |
| 614 | + 'help_text' => __('Provide Input Suffix Label or Icon or SVG. It will show in the input field as suffix label', 'fluentform'), | |
| 615 | + ], | |
| 616 | + 'is_unique' => [ | |
| 617 | + 'template' => 'inputYesNoCheckBox', | |
| 618 | + 'label' => __('Validate as Unique', 'fluentform'), | |
| 619 | + 'help_text' => __('If you make it unique then it will validate as unique from previous submissions of this form', 'fluentform'), | |
| 620 | + ], | |
| 621 | + 'show_text' => [ | |
| 622 | + 'template' => 'select', | |
| 623 | + 'label' => __('Show Text', 'fluentform'), | |
| 541 | 624 | 'help_text' => __('Show Text value on selection', 'fluentform'), |
| 542 | - 'options' => array( | |
| 543 | - array( | |
| 625 | + 'options' => [ | |
| 626 | + [ | |
| 544 | 627 | 'value' => 'yes', |
| 545 | 628 | 'label' => __('Yes', 'fluentform'), |
| 546 | - ), | |
| 547 | - array( | |
| 629 | + ], | |
| 630 | + [ | |
| 548 | 631 | 'value' => 'no', |
| 549 | 632 | 'label' => __('No', 'fluentform'), |
| 550 | - ) | |
| 551 | - ) | |
| 552 | - ), | |
| 553 | - 'numeric_formatter' => array( | |
| 554 | - 'template' => 'select', | |
| 555 | - 'label' => __('Number Format', 'fluentform'), | |
| 633 | + ], | |
| 634 | + ], | |
| 635 | + ], | |
| 636 | + 'icon_source' => [ | |
| 637 | + 'template' => 'select', | |
| 638 | + 'label' => __('Icon Source', 'fluentform'), | |
| 639 | + 'help_text' => __('Choose a preset icon or provide a custom SVG icon for this rating field.', 'fluentform'), | |
| 640 | + 'options' => [ | |
| 641 | + [ | |
| 642 | + 'value' => 'preset', | |
| 643 | + 'label' => __('Preset Icons', 'fluentform'), | |
| 644 | + ], | |
| 645 | + [ | |
| 646 | + 'value' => 'custom_svg', | |
| 647 | + 'label' => __('Custom SVG', 'fluentform'), | |
| 648 | + ], | |
| 649 | + ], | |
| 650 | + ], | |
| 651 | + 'icon_type' => [ | |
| 652 | + 'template' => 'select', | |
| 653 | + 'label' => __('Preset Icon', 'fluentform'), | |
| 654 | + 'help_text' => __('Select which icon shape to use for this rating field.', 'fluentform'), | |
| 655 | + 'options' => $fluentformRatingIconOptions, | |
| 656 | + 'dependency' => [ | |
| 657 | + 'depends_on' => 'settings/icon_source', | |
| 658 | + 'value' => 'preset', | |
| 659 | + 'operator' => '==', | |
| 660 | + ], | |
| 661 | + ], | |
| 662 | + 'custom_icon_svg' => [ | |
| 663 | + 'template' => 'inputTextarea', | |
| 664 | + 'label' => __('Custom SVG Icon', 'fluentform'), | |
| 665 | + 'help_text' => __('Paste a single inline SVG. Unsupported tags and attributes will be stripped on save.', 'fluentform'), | |
| 666 | + 'placeholder' => __('<svg viewBox="0 0 24 24">...</svg>', 'fluentform'), | |
| 667 | + 'rows' => 6, | |
| 668 | + 'inline_help_text' => __('Use a simple monochrome SVG for the most predictable result across classic and conversational forms.', 'fluentform'), | |
| 669 | + 'dependency' => [ | |
| 670 | + 'depends_on' => 'settings/icon_source', | |
| 671 | + 'value' => 'custom_svg', | |
| 672 | + 'operator' => '==', | |
| 673 | + ], | |
| 674 | + ], | |
| 675 | + 'inactive_color' => [ | |
| 676 | + 'template' => 'inputColor', | |
| 677 | + 'label' => __('Inactive Color', 'fluentform'), | |
| 678 | + 'help_text' => __('Color used before a rating item is selected.', 'fluentform'), | |
| 679 | + ], | |
| 680 | + 'active_color' => [ | |
| 681 | + 'template' => 'inputColor', | |
| 682 | + 'label' => __('Active Color', 'fluentform'), | |
| 683 | + 'help_text' => __('Color used after a rating item becomes active or selected.', 'fluentform'), | |
| 684 | + ], | |
| 685 | + 'numeric_formatter' => [ | |
| 686 | + 'template' => 'select', | |
| 687 | + 'label' => __('Number Format', 'fluentform'), | |
| 556 | 688 | 'help_text' => __('Select the format of numbers that are allowed in this field. You have the option to use a comma or a dot as the decimal separator.', 'fluentform'), |
| 557 | - 'options' => \FluentForm\App\Helpers\Helper::getNumericFormatters() | |
| 558 | - ), | |
| 559 | - 'unique_validation_message' => array( | |
| 560 | - 'template' => 'inputText', | |
| 561 | - 'label' => __('Validation Message for Duplicate', 'fluentform'), | |
| 562 | - 'help_text' => __('If validation failed then it will show this message', 'fluentform'), | |
| 563 | - 'dependency' => array( | |
| 689 | + 'options' => \FluentForm\App\Helpers\Helper::getNumericFormatters(), | |
| 690 | + ], | |
| 691 | + 'mobile_keyboard_type' => [ | |
| 692 | + 'template' => 'select', | |
| 693 | + 'label' => __('Mobile Keyboard Type', 'fluentform'), | |
| 694 | + 'help_text' => __('Select the keyboard type to display on mobile devices. This only affects the keyboard shown, not validation or accepted characters.', 'fluentform'), | |
| 695 | + 'options' => [ | |
| 696 | + [ | |
| 697 | + 'value' => '', | |
| 698 | + 'label' => __('Standard Keyboard', 'fluentform'), | |
| 699 | + ], | |
| 700 | + [ | |
| 701 | + 'value' => 'numeric', | |
| 702 | + 'label' => __('Numeric (0-9)', 'fluentform'), | |
| 703 | + ], | |
| 704 | + [ | |
| 705 | + 'value' => 'decimal', | |
| 706 | + 'label' => __('Decimal (0-9 with .)', 'fluentform'), | |
| 707 | + ], | |
| 708 | + [ | |
| 709 | + 'value' => 'tel', | |
| 710 | + 'label' => __('Telephone (0-9, *, #)', 'fluentform'), | |
| 711 | + ], | |
| 712 | + ], | |
| 713 | + ], | |
| 714 | + 'mobile_keyboard_type_number' => [ | |
| 715 | + 'template' => 'select', | |
| 716 | + 'label' => __('Mobile Keyboard Type', 'fluentform'), | |
| 717 | + 'help_text' => __('Select the keyboard type to display on mobile devices.', 'fluentform'), | |
| 718 | + 'options' => [ | |
| 719 | + [ | |
| 720 | + 'value' => '', | |
| 721 | + 'label' => __('Numeric (0-9)', 'fluentform'), | |
| 722 | + ], | |
| 723 | + [ | |
| 724 | + 'value' => 'decimal', | |
| 725 | + 'label' => __('Decimal (0-9 with .)', 'fluentform'), | |
| 726 | + ], | |
| 727 | + ], | |
| 728 | + ], | |
| 729 | + 'unique_validation_message' => [ | |
| 730 | + 'template' => 'inputText', | |
| 731 | + 'label' => __('Validation Message for Duplicate', 'fluentform'), | |
| 732 | + 'help_text' => __('If validation failed then it will show this message', 'fluentform'), | |
| 733 | + 'dependency' => [ | |
| 564 | 734 | 'depends_on' => 'settings/is_unique', |
| 565 | - 'value' => 'yes', | |
| 566 | - 'operator' => '==' | |
| 567 | - ) | |
| 568 | - ), | |
| 569 | - 'layout_class' => array( | |
| 570 | - 'template' => 'select', | |
| 571 | - 'label' => __('Layout', 'fluentform'), | |
| 735 | + 'value' => 'yes', | |
| 736 | + 'operator' => '==', | |
| 737 | + ], | |
| 738 | + ], | |
| 739 | + 'layout_class' => [ | |
| 740 | + 'template' => 'select', | |
| 741 | + 'label' => __('Layout', 'fluentform'), | |
| 572 | 742 | 'help_text' => __('Select the Layout for checkable items', 'fluentform'), |
| 573 | - 'options' => array( | |
| 574 | - array( | |
| 743 | + 'options' => [ | |
| 744 | + [ | |
| 575 | 745 | 'value' => '', |
| 576 | 746 | 'label' => __('Default', 'fluentform'), |
| 577 | - ), | |
| 578 | - array( | |
| 747 | + ], | |
| 748 | + [ | |
| 579 | 749 | 'value' => 'ff_list_inline', |
| 580 | 750 | 'label' => 'Inline Layout', |
| 581 | - ), | |
| 582 | - array( | |
| 751 | + ], | |
| 752 | + [ | |
| 583 | 753 | 'value' => 'ff_list_buttons', |
| 584 | 754 | 'label' => 'Button Type Styles', |
| 585 | - ), | |
| 586 | - array( | |
| 755 | + ], | |
| 756 | + [ | |
| 587 | 757 | 'value' => 'ff_list_2col', |
| 588 | 758 | 'label' => '2-Column Layout', |
| 589 | - ), | |
| 590 | - array( | |
| 759 | + ], | |
| 760 | + [ | |
| 591 | 761 | 'value' => 'ff_list_3col', |
| 592 | 762 | 'label' => '3-Column Layout', |
| 593 | - ), | |
| 594 | - array( | |
| 763 | + ], | |
| 764 | + [ | |
| 595 | 765 | 'value' => 'ff_list_4col', |
| 596 | 766 | 'label' => '4-Column Layout', |
| 597 | - ), | |
| 598 | - array( | |
| 767 | + ], | |
| 768 | + [ | |
| 599 | 769 | 'value' => 'ff_list_5col', |
| 600 | 770 | 'label' => '5-Column Layout', |
| 601 | - ) | |
| 602 | - ), | |
| 603 | - ), | |
| 771 | + ], | |
| 772 | + ], | |
| 773 | + ], | |
| 774 | + 'upload_file_location' => [ | |
| 775 | + 'template' => 'radio', | |
| 776 | + 'label' => __('Save Uploads in', 'fluentform'), | |
| 777 | + 'help_text' => __('Uploaded files can be stored in media library or your server or both.', 'fluentform'), | |
| 778 | + 'options' => \FluentForm\App\Helpers\Helper::fileUploadLocations(), | |
| 779 | + 'dependency' => [ | |
| 780 | + 'depends_on' => 'settings/file_location_type', | |
| 781 | + 'value' => 'custom', | |
| 782 | + 'operator' => '==', | |
| 783 | + ], | |
| 784 | + ], | |
| 785 | + 'file_location_type' => [ | |
| 786 | + 'template' => 'radioButton', | |
| 787 | + 'label' => __('File Location Type', 'fluentform'), | |
| 788 | + 'help_text' => __('Set default or custom location for files', 'fluentform'), | |
| 789 | + 'options' => [ | |
| 790 | + [ | |
| 791 | + 'value' => 'follow_global_settings', | |
| 792 | + 'label' => __('As Per Global Settings', 'fluentform'), | |
| 793 | + ], | |
| 794 | + [ | |
| 795 | + 'value' => 'custom', | |
| 796 | + 'label' => __('Custom', 'fluentform'), | |
| 797 | + ], | |
| 798 | + ], | |
| 799 | + ], | |
| 800 | + 'upload_bttn_ui' => [ | |
| 801 | + 'template' => 'radio', | |
| 802 | + 'label' => __('Upload Button Interface', 'fluentform'), | |
| 803 | + 'help_text' => __('Select how the upload button should work show a dropzone or a button', 'fluentform'), | |
| 804 | + 'options' => [ | |
| 805 | + [ | |
| 806 | + 'value' => '', | |
| 807 | + 'label' => __('Button', 'fluentform'), | |
| 808 | + ], | |
| 809 | + [ | |
| 810 | + 'value' => 'dropzone', | |
| 811 | + 'label' => __('Dropzone', 'fluentform'), | |
| 812 | + ], | |
| 813 | + ], | |
| 814 | + ], | |
| 815 | + 'enable_crop' => [ | |
| 816 | + 'template' => 'inputYesNoCheckBox', | |
| 817 | + 'label' => __('Enable crop', 'fluentform'), | |
| 818 | + 'help_text' => __('If enabled, users must crop the image before it is uploaded.', 'fluentform'), | |
| 819 | + ], | |
| 820 | + 'crop_mode' => [ | |
| 821 | + 'template' => 'radioButton', | |
| 822 | + 'label' => __('Crop Type', 'fluentform'), | |
| 823 | + 'help_text' => __('Choose whether users crop by ratio or by exact width and height.', 'fluentform'), | |
| 824 | + 'options' => [ | |
| 825 | + [ | |
| 826 | + 'value' => 'ratio', | |
| 827 | + 'label' => __('Crop Ratio', 'fluentform'), | |
| 828 | + ], | |
| 829 | + [ | |
| 830 | + 'value' => 'dimensions', | |
| 831 | + 'label' => __('Width and Height', 'fluentform'), | |
| 832 | + ], | |
| 833 | + ], | |
| 834 | + 'dependency' => [ | |
| 835 | + 'depends_on' => 'settings/enable_crop', | |
| 836 | + 'value' => 'yes', | |
| 837 | + 'operator' => '==', | |
| 838 | + ], | |
| 839 | + ], | |
| 840 | + 'crop_ratio' => [ | |
| 841 | + 'template' => 'select', | |
| 842 | + 'label' => __('Crop ratio', 'fluentform'), | |
| 843 | + 'help_text' => __('Choose the default crop ratio users will see before upload.', 'fluentform'), | |
| 844 | + 'options' => [ | |
| 845 | + [ | |
| 846 | + 'value' => 'free', | |
| 847 | + 'label' => __('Free', 'fluentform'), | |
| 848 | + ], | |
| 849 | + [ | |
| 850 | + 'value' => '1:1', | |
| 851 | + 'label' => '1:1', | |
| 852 | + ], | |
| 853 | + [ | |
| 854 | + 'value' => '4:3', | |
| 855 | + 'label' => '4:3', | |
| 856 | + ], | |
| 857 | + [ | |
| 858 | + 'value' => '16:9', | |
| 859 | + 'label' => '16:9', | |
| 860 | + ], | |
| 861 | + [ | |
| 862 | + 'value' => '3:4', | |
| 863 | + 'label' => '3:4', | |
| 864 | + ], | |
| 865 | + ], | |
| 866 | + ], | |
| 867 | + 'crop_width' => [ | |
| 868 | + 'template' => 'inputNumber', | |
| 869 | + 'label' => __('Width (px)', 'fluentform'), | |
| 870 | + 'help_text' => __('Required crop width in pixels.', 'fluentform'), | |
| 871 | + ], | |
| 872 | + 'crop_height' => [ | |
| 873 | + 'template' => 'inputNumber', | |
| 874 | + 'label' => __('Height (px)', 'fluentform'), | |
| 875 | + 'help_text' => __('Required crop height in pixels.', 'fluentform'), | |
| 876 | + ], | |
| 877 | + 'container_width' => [ | |
| 878 | + 'template' => 'containerWidth', | |
| 879 | + 'label' => __('Column Width %', 'fluentform'), | |
| 880 | + 'help_text' => __('Set the width of the columns. The minimum column width is 10%.', 'fluentform'), | |
| 881 | + 'width_limitation_msg' => __('The minimum column width is 10%', 'fluentform'), | |
| 882 | + ], | |
| 883 | + 'render_recaptcha_v3_badge' => [ | |
| 884 | + 'template' => 'radio', | |
| 885 | + 'label' => __('Render ReCaptcha V3 badge', 'fluentform'), | |
| 886 | + 'help_text' => __('Select if ReCaptcha V3 verified badge should render in the form or not', 'fluentform'), | |
| 887 | + 'options' => [ | |
| 888 | + [ | |
| 889 | + 'value' => true, | |
| 890 | + 'label' => __('Yes', 'fluentform'), | |
| 891 | + ], | |
| 892 | + [ | |
| 893 | + 'value' => false, | |
| 894 | + 'label' => __('No', 'fluentform'), | |
| 895 | + ], | |
| 896 | + ], | |
| 897 | + ], | |
| 898 | + 'enable_other_option' => [ | |
| 899 | + 'template' => 'inputYesNoCheckBox', | |
| 900 | + 'label' => __('Enable "Other" Option', 'fluentform'), | |
| 901 | + 'help_text' => __('Allow users to add a custom option by selecting "Other"', 'fluentform'), | |
| 902 | + ], | |
| 903 | + 'other_option_label' => [ | |
| 904 | + 'template' => 'inputText', | |
| 905 | + 'label' => __('Other Option Label', 'fluentform'), | |
| 906 | + 'help_text' => __('Label for the "Other" option', 'fluentform'), | |
| 907 | + 'dependency' => [ | |
| 908 | + 'depends_on' => 'settings/enable_other_option', | |
| 909 | + 'value' => 'yes', | |
| 910 | + 'operator' => '==', | |
| 911 | + ], | |
| 912 | + ], | |
| 913 | + 'other_option_placeholder' => [ | |
| 914 | + 'template' => 'inputText', | |
| 915 | + 'label' => __('Other Option Placeholder', 'fluentform'), | |
| 916 | + 'help_text' => __('Placeholder text for the "Other" input field', 'fluentform'), | |
| 917 | + 'dependency' => [ | |
| 918 | + 'depends_on' => 'settings/enable_other_option', | |
| 919 | + 'value' => 'yes', | |
| 920 | + 'operator' => '==', | |
| 921 | + ], | |
| 922 | + ], | |
| 923 | + 'other_option_required_message' => [ | |
| 924 | + 'template' => 'inputText', | |
| 925 | + 'label' => __('Other Option Required Message', 'fluentform'), | |
| 926 | + 'help_text' => __('Error message shown when the "Other" option is selected but its text field is left empty.', 'fluentform'), | |
| 927 | + 'dependency' => [ | |
| 928 | + 'depends_on' => 'settings/enable_other_option', | |
| 929 | + 'value' => 'yes', | |
| 930 | + 'operator' => '==', | |
| 931 | + ], | |
| 932 | + ], | |
| 933 | +]; | |
| 934 | + | |
| 935 | +$fluentformElementCustomizationSettings = apply_filters_deprecated( | |
| 936 | + 'fluentform_editor_element_customization_settings', | |
| 937 | + [ | |
| 938 | + $fluentformElementCustomizationSettings | |
| 939 | + ], | |
| 940 | + FLUENTFORM_FRAMEWORK_UPGRADE, | |
| 941 | + 'fluentform/editor_element_customization_settings', | |
| 942 | + 'Use fluentform/editor_element_customization_settings instead of fluent_editor_element_customization_settings.' | |
| 604 | 943 | ); |
| 605 | 944 | |
| 606 | - | |
| 607 | -return apply_filters('fluent_editor_element_customization_settings', $element_customization_settings); | |
| 945 | +return apply_filters('fluentform/editor_element_customization_settings', $fluentformElementCustomizationSettings); | |