diff --git a/classes/helpers/FrmStylesHelper.php b/classes/helpers/FrmStylesHelper.php index 4cc5ea3dc6..f4f4219e87 100644 --- a/classes/helpers/FrmStylesHelper.php +++ b/classes/helpers/FrmStylesHelper.php @@ -467,6 +467,7 @@ private static function css_var_prepare_value( $settings, $key ) { case 'font': return safecss_filter_attr( $value ); + case 'border_width_error': case 'field_border_width': if ( ! empty( $settings['field_shape_type'] ) && 'underline' === $settings['field_shape_type'] ) { return safecss_filter_attr( '0px 0px ' . $value . ' 0px' ); @@ -570,7 +571,7 @@ public static function get_settings_for_output( $style ) { * @return array */ public static function update_base_font_size( $settings, $defaults ) { - if ( empty( $settings['base_font_size'] ) || empty( $settings['use_base_font_size'] ) ) { + if ( empty( $settings['base_font_size'] ) || empty( $settings['use_base_font_size'] ) || 'false' === $settings['use_base_font_size'] ) { return $settings; } $base_font_size = (int) $settings['base_font_size']; diff --git a/classes/models/FrmStyle.php b/classes/models/FrmStyle.php index 3506a9aafb..68dce66fa8 100644 --- a/classes/models/FrmStyle.php +++ b/classes/models/FrmStyle.php @@ -620,7 +620,7 @@ public function get_defaults() { 'direction' => is_rtl() ? 'rtl' : 'ltr', 'fieldset' => '0px', 'fieldset_color' => '000000', - 'fieldset_padding' => '0 0 15px 0', + 'fieldset_padding' => '0px 0px 15px 0px', 'fieldset_bg_color' => '', 'title_size' => '40px', @@ -631,7 +631,7 @@ public function get_defaults() { 'form_desc_color' => '98A2B3', 'form_desc_margin_top' => '10px', 'form_desc_margin_bottom' => '25px', - 'form_desc_padding' => '0', + 'form_desc_padding' => '0px', 'font' => '', 'font_size' => '15px', @@ -642,14 +642,14 @@ public function get_defaults() { 'width' => '150px', 'required_color' => 'F04438', 'required_weight' => 'bold', - 'label_padding' => '0 0 5px 0', + 'label_padding' => '0px 0px 5px 0px', 'description_font_size' => '12px', 'description_color' => '667085', 'description_weight' => 'normal', 'description_style' => 'normal', 'description_align' => 'left', - 'description_margin' => '0', + 'description_margin' => '0px', 'field_font_size' => '14px', 'field_height' => '36px', @@ -689,7 +689,7 @@ public function get_defaults() { 'section_font_size' => '18px', 'section_color' => '344054', 'section_weight' => 'bold', - 'section_pad' => '32px 0 3px 0', + 'section_pad' => '32px 0px 3px 0px', 'section_mar_top' => '30px', 'section_mar_bottom' => '30px', 'section_bg_color' => '', diff --git a/classes/views/styles/_field-colors.php b/classes/views/styles/_field-colors.php index 144f98621c..7892923c8c 100644 --- a/classes/views/styles/_field-colors.php +++ b/classes/views/styles/_field-colors.php @@ -114,7 +114,7 @@ $frm_style->get_field_name( 'remove_box_shadow' ), array( 'div_class' => 'with_frm_style frm_toggle', - 'checked' => ! $style->post_content['remove_box_shadow'], + 'checked' => ! empty( $style->post_content['remove_box_shadow'] ), 'echo' => true, ) ); @@ -167,7 +167,7 @@ $frm_style->get_field_name( 'remove_box_shadow_active' ), array( 'div_class' => 'with_frm_style frm_toggle', - 'checked' => ! $style->post_content['remove_box_shadow_active'], + 'checked' => ! empty( $style->post_content['remove_box_shadow_active'] ), 'echo' => true, 'aria-label-attr' => __( 'Toggle box shadow', 'formidable' ), ) diff --git a/classes/views/styles/_quick-settings.php b/classes/views/styles/_quick-settings.php index 81677fdf27..9e4ea9443a 100644 --- a/classes/views/styles/_quick-settings.php +++ b/classes/views/styles/_quick-settings.php @@ -131,8 +131,12 @@
- - + + 'base_font_size', 'max_value' => 100, 'not_show_in' => 'advanced-settings', + 'classname' => 'frm-base-font-size', ) ); ?> diff --git a/classes/views/styles/components/FrmSliderStyleComponent.php b/classes/views/styles/components/FrmSliderStyleComponent.php index adaf114609..62c7c93120 100644 --- a/classes/views/styles/components/FrmSliderStyleComponent.php +++ b/classes/views/styles/components/FrmSliderStyleComponent.php @@ -33,6 +33,7 @@ public function __construct( $field_name, $field_value, $data ) { $this->data['unit_measurement'] = $this->detect_unit_measurement(); $this->data['has-multiple-values'] = count( $this->get_values() ) > 1; $this->data['units'] = $this->get_units_list( $data ); + $this->data['value_label'] = empty( $this->detect_unit_measurement() ) ? $field_value : (int) $field_value; $this->init_defaults(); $this->init_icon(); @@ -53,8 +54,9 @@ public function __construct( $field_name, $field_value, $data ) { */ private function get_units_list( $data ) { if ( empty( $data['units'] ) ) { - return array( 'px', 'em', '%' ); + return array( '', 'px', 'em', '%' ); } + array_unshift( $data['units'], '' ); return $data['units']; } @@ -89,33 +91,33 @@ private function init_multiple_values() { $right = $values[1]; $this->data['vertical'] = array( - 'value' => $top, 'unit' => $this->detect_unit_measurement( $top ), + 'value' => empty( $this->detect_unit_measurement( $top ) ) ? $top : (int) $top, ); $this->data['horizontal'] = array( - 'value' => $right, 'unit' => $this->detect_unit_measurement( $right ), + 'value' => empty( $this->detect_unit_measurement( $right ) ) ? $right : (int) $right, ); $this->data['top'] = array( - 'value' => $top, 'unit' => $this->detect_unit_measurement( $top ), + 'value' => empty( $this->detect_unit_measurement( $top ) ) ? $top : (int) $top, ); $this->data['bottom'] = array( - 'value' => $bottom, 'unit' => $this->detect_unit_measurement( $bottom ), + 'value' => empty( $this->detect_unit_measurement( $bottom ) ) ? $bottom : (int) $bottom, ); $this->data['left'] = array( - 'value' => $left, 'unit' => $this->detect_unit_measurement( $left ), + 'value' => empty( $this->detect_unit_measurement( $left ) ) ? $left : (int) $left, ); $this->data['right'] = array( - 'value' => $right, 'unit' => $this->detect_unit_measurement( $right ), + 'value' => empty( $this->detect_unit_measurement( $right ) ) ? $right : (int) $right, ); } @@ -133,7 +135,7 @@ private function get_values() { /** * Detect the unit measurement from the value. - * Possible values are: px, %, em. + * Possible values are: "px", "%", "em" or empty "" * * @since 6.14 * @@ -150,8 +152,11 @@ private function detect_unit_measurement( $value = null ) { if ( preg_match( '/em$/', $value ) ) { return 'em'; } + if ( preg_match( '/px$/', $value ) ) { + return 'px'; + } - return 'px'; + return ''; } /** diff --git a/classes/views/styles/components/FrmStyleComponent.php b/classes/views/styles/components/FrmStyleComponent.php index c600db67ee..5cb0dd62b7 100644 --- a/classes/views/styles/components/FrmStyleComponent.php +++ b/classes/views/styles/components/FrmStyleComponent.php @@ -133,6 +133,9 @@ protected function init_field_data( $data, $field_name, $field_value ) { */ protected function get_default_wrapper_class_names() { $class = 'frm-style-component'; + if ( ! empty( $this->data['classname'] ) ) { + $class .= ' ' . $this->data['classname']; + } if ( ! empty( $this->data['will_change'] ) ) { return $class . ' frm-style-dependent-updater-component'; } diff --git a/classes/views/styles/components/templates/slider.php b/classes/views/styles/components/templates/slider.php index be716c3543..671974a661 100644 --- a/classes/views/styles/components/templates/slider.php +++ b/classes/views/styles/components/templates/slider.php @@ -16,7 +16,7 @@
- + + + + + + + value="" id="" /> + + value="" id="" />