| @@ -398,8 +398,15 @@ | ||
| 398 | 398 | 'description' => __('Range Slider is not available with the free version. Please upgrade to pro to get all the advanced features.', 'fluentform'), |
| 399 | 399 | 'image' => '', |
| 400 | 400 | 'video' => 'https://www.youtube.com/embed/RaY2VcPWk6I', |
| 401 | 401 | ]; |
| 402 | + $disabled['input_ranking'] = [ | |
| 403 | + 'disabled' => true, | |
| 404 | + 'title' => __('Ranking Field', 'fluentform'), | |
| 405 | + 'description' => __('Ranking Field is not available with the free version. Please upgrade to pro to get all the advanced features.', 'fluentform'), | |
| 406 | + 'image' => '', | |
| 407 | + 'video' => '', | |
| 408 | + ]; | |
| 402 | 409 | $disabled['color-picker'] = [ |
| 403 | 410 | 'disabled' => true, |
| 404 | 411 | 'title' => __('Color Picker', 'fluentform'), |
| 405 | 412 | 'description' => __('Color Picker is not available with the free version. Please upgrade to pro to get all the advanced features.', 'fluentform'), |
| @@ -635,8 +642,9 @@ | ||
| 635 | 642 | $data = [ |
| 636 | 643 | 'ajaxUrl' => admin_url('admin-ajax.php'), |
| 637 | 644 | 'forms' => [], |
| 638 | 645 | 'step_text' => $stepText, |
| 646 | + 'step_completed_text' => __('Completed', 'fluentform'), | |
| 639 | 647 | 'is_rtl' => is_rtl(), |
| 640 | 648 | 'date_i18n' => self::getDatei18n(), |
| 641 | 649 | 'pro_version' => (defined('FLUENTFORMPRO_VERSION')) ? FLUENTFORMPRO_VERSION : false, |
| 642 | 650 | 'fluentform_version' => FLUENTFORM_VERSION, |
| @@ -735,8 +743,14 @@ | ||
| 735 | 743 | if ($conditionals = $formBuilder->conditions) { |
| 736 | 744 | $form_vars['conditionals'] = $conditionals; |
| 737 | 745 | } |
| 738 | 746 | |
| 747 | + $form_vars['file_upload_settings'] = apply_filters( | |
| 748 | + 'fluentform/file_upload_settings_for_js', | |
| 749 | + [], | |
| 750 | + $form | |
| 751 | + ); | |
| 752 | + | |
| 739 | 753 | $form_vars = apply_filters('fluentform/form_vars_for_JS', $form_vars, $form); |
| 740 | 754 | |
| 741 | 755 | if ($form->has_payment) { |
| 742 | 756 | do_action_deprecated( |
| @@ -953,8 +967,15 @@ | ||
| 953 | 967 | */ |
| 954 | 968 | public function addIsRenderableFilter() |
| 955 | 969 | { |
| 956 | 970 | $this->app->addFilter('fluentform/is_form_renderable', function ($isRenderable, $form) { |
| 971 | + if ( | |
| 972 | + $this->app->request->get('design_mode') | |
| 973 | + && Acl::hasAnyFormPermission() | |
| 974 | + ) { | |
| 975 | + return $isRenderable; | |
| 976 | + } | |
| 977 | + | |
| 957 | 978 | $checkables = ['limitNumberOfEntries', 'scheduleForm', 'requireLogin']; |
| 958 | 979 | |
| 959 | 980 | // Ensure settings is an array |
| 960 | 981 | if (!isset($form->settings) || !is_array($form->settings)) { |
| @@ -993,9 +1014,9 @@ | ||
| 993 | 1014 | */ |
| 994 | 1015 | private function limitNumberOfEntries($restrictions, $form, &$isRenderable) |
| 995 | 1016 | { |
| 996 | 1017 | |
| 997 | - if (!$restrictions['enabled'] || !isset($restrictions['period']) || !isset($restrictions['numberOfEntries'])) { | |
| 1018 | + if (!Arr::isTrue($restrictions, 'enabled') || !isset($restrictions['period']) || !isset($restrictions['numberOfEntries'])) { | |
| 998 | 1019 | return true; |
| 999 | 1020 | } |
| 1000 | 1021 | |
| 1001 | 1022 | |
| @@ -1055,9 +1076,9 @@ | ||
| 1055 | 1076 | * @return bool |
| 1056 | 1077 | */ |
| 1057 | 1078 | private function scheduleForm($restrictions, $form, &$isRenderable) |
| 1058 | 1079 | { |
| 1059 | - if (!$restrictions['enabled']) { | |
| 1080 | + if (!Arr::isTrue($restrictions, 'enabled')) { | |
| 1060 | 1081 | return true; |
| 1061 | 1082 | } |
| 1062 | 1083 | |
| 1063 | 1084 | $time = time(); |
| @@ -1094,9 +1115,9 @@ | ||
| 1094 | 1115 | * @return bool |
| 1095 | 1116 | */ |
| 1096 | 1117 | private function requireLogin($restrictions, $form, &$isRenderable) |
| 1097 | 1118 | { |
| 1098 | - if (!$restrictions['enabled']) { | |
| 1119 | + if (!Arr::isTrue($restrictions, 'enabled')) { | |
| 1099 | 1120 | return true; |
| 1100 | 1121 | } |
| 1101 | 1122 | |
| 1102 | 1123 | if (!($isLoggedIn = is_user_logged_in())) { |
| @@ -1427,17 +1448,19 @@ | ||
| 1427 | 1448 | $atts = shortcode_atts([ |
| 1428 | 1449 | 'param' => '', |
| 1429 | 1450 | ], $atts); |
| 1430 | 1451 | |
| 1452 | + if ('' === $atts['param']) { | |
| 1453 | + return ''; | |
| 1454 | + } | |
| 1455 | + | |
| 1431 | 1456 | $value = $this->app->request->get($atts['param']); |
| 1432 | 1457 | |
| 1433 | - if ($atts['param'] && $value) { | |
| 1434 | - if (is_array($value)) { | |
| 1435 | - return implode(', ', $value); | |
| 1436 | - } | |
| 1437 | - return esc_html($value); | |
| 1458 | + if (null === $value || '' === $value) { | |
| 1459 | + return ''; | |
| 1438 | 1460 | } |
| 1439 | - return ''; | |
| 1461 | + | |
| 1462 | + return esc_html(Helper::flattenRequestValue($value)); | |
| 1440 | 1463 | }); |
| 1441 | 1464 | |
| 1442 | 1465 | $this->app->addShortcode('ff_entry',function($atts){ |
| 1443 | 1466 | ob_start(); |