| @@ -17,8 +17,9 @@ | ||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | $fluentformDateFormats = (new \FluentForm\App\Services\FormBuilder\Components\DateTime())->getAvailableDateFormats(); |
| 20 | 20 | $fluentformRatingIconOptions = \FluentForm\App\Services\FormBuilder\RatingIcon::getPresetOptions(); |
| 21 | +$fluentformCanAuthorDateConfig = fluentformCanUnfilteredHTML(); | |
| 21 | 22 | |
| 22 | 23 | $fluentformDateConfigSettings = [ |
| 23 | 24 | 'template' => 'inputTextarea', |
| 24 | 25 | 'label' => __('Advanced Date Configuration', 'fluentform'), |
| @@ -24,16 +25,18 @@ | ||
| 24 | 25 | 'label' => __('Advanced Date Configuration', 'fluentform'), |
| 25 | 26 | 'placeholder' => __('Advanced Date Configuration', 'fluentform'), |
| 26 | 27 | 'rows' => (defined('FLUENTFORMPRO')) ? 10 : 2, |
| 27 | 28 | 'start_text' => (defined('FLUENTFORMPRO')) ? 10 : 2, |
| 28 | - 'disabled' => ! defined('FLUENTFORMPRO'), | |
| 29 | + 'disabled' => ! defined('FLUENTFORMPRO') || ! $fluentformCanAuthorDateConfig, | |
| 29 | 30 | 'css_class' => 'ff_code_editor', |
| 30 | - '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>', | |
| 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>', | |
| 31 | 32 | 'help_text' => __('You can write your own date configuration as JS object. Please write valid configuration as per flatpickr config.', 'fluentform'), |
| 32 | 33 | ]; |
| 33 | 34 | |
| 34 | 35 | if (! defined('FLUENTFORMPRO')) { |
| 35 | 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'); | |
| 36 | 39 | } |
| 37 | 40 | |
| 38 | 41 | $fluentformElementCustomizationSettings = [ |
| 39 | 42 | 'name' => [ |
| @@ -105,8 +108,17 @@ | ||
| 105 | 108 | 'template' => 'inputText', |
| 106 | 109 | 'label' => __('Placeholder', 'fluentform'), |
| 107 | 110 | 'help_text' => __('This is the field placeholder, the user will see this if the input field is empty.', 'fluentform'), |
| 108 | 111 | ], |
| 112 | + 'autocomplete' => [ | |
| 113 | + 'template' => 'select', | |
| 114 | + 'label' => __('Autocomplete', 'fluentform'), | |
| 115 | + 'filterable' => true, | |
| 116 | + 'creatable' => true, | |
| 117 | + 'placeholder' => __('Select an autocomplete value', 'fluentform'), | |
| 118 | + 'help_text' => __('Tells the browser what kind of information this field collects so it can be autofilled, and lets assistive technology identify the input purpose (WCAG 1.3.5). Choose "off" to disable browser autofill, or "None" to add no attribute at all. You can also type a scoped value such as "billing postal-code". Anything outside the HTML autofill list is ignored when the form is displayed.', 'fluentform'), | |
| 119 | + 'options' => \FluentForm\App\Services\FormBuilder\AutocompleteTokens::editorOptions(), | |
| 120 | + ], | |
| 109 | 121 | 'date_format' => [ |
| 110 | 122 | 'template' => 'select', |
| 111 | 123 | 'label' => __('Date Format', 'fluentform'), |
| 112 | 124 | 'filterable' => true, |
| @@ -571,9 +583,9 @@ | ||
| 571 | 583 | 'help_text' => __('Please provide max number of rows the user can fill up for this repeat field. Keep blank/0 for unlimited numbers', 'fluentform'), |
| 572 | 584 | ], |
| 573 | 585 | 'calculation_settings' => [ |
| 574 | 586 | 'template' => (defined('FLUENTFORMPRO')) ? 'inputCalculationSettings' : 'infoBlock', |
| 575 | - '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="https://fluentforms.com/pricing/?utm_source=plugin&utm_medium=wp_install&utm_campaign=ff_upgrade&theme_style=twentytwentythree"> | |
| 587 | + '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')) . '"> | |
| 576 | 588 | Upgrade to Pro </a>', |
| 577 | 589 | 'label' => 'Calculation Field Settings', |
| 578 | 590 | 'status_label' => 'Enable Calculation', |
| 579 | 591 | 'formula_label' => 'Calculation Expression', |
| @@ -910,8 +922,18 @@ | ||
| 910 | 922 | 'other_option_placeholder' => [ |
| 911 | 923 | 'template' => 'inputText', |
| 912 | 924 | 'label' => __('Other Option Placeholder', 'fluentform'), |
| 913 | 925 | 'help_text' => __('Placeholder text for the "Other" input field', 'fluentform'), |
| 926 | + 'dependency' => [ | |
| 927 | + 'depends_on' => 'settings/enable_other_option', | |
| 928 | + 'value' => 'yes', | |
| 929 | + 'operator' => '==', | |
| 930 | + ], | |
| 931 | + ], | |
| 932 | + 'other_option_required_message' => [ | |
| 933 | + 'template' => 'inputText', | |
| 934 | + 'label' => __('Other Option Required Message', 'fluentform'), | |
| 935 | + 'help_text' => __('Error message shown when the "Other" option is selected but its text field is left empty.', 'fluentform'), | |
| 914 | 936 | 'dependency' => [ |
| 915 | 937 | 'depends_on' => 'settings/enable_other_option', |
| 916 | 938 | 'value' => 'yes', |
| 917 | 939 | 'operator' => '==', |