@@ -1,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if ( isset($_GET['frm_style_setting']) || isset($_GET['flat']) ) { |
|
3 | +if ( isset( $_GET['frm_style_setting'] ) || isset( $_GET['flat'] ) ) { |
|
4 | 4 | if ( isset( $_GET['frm_style_setting'] ) ) { |
5 | 5 | extract( $_GET['frm_style_setting']['post_content'] ); |
6 | 6 | } else { |
7 | - extract($_GET); |
|
7 | + extract( $_GET ); |
|
8 | 8 | } |
9 | 9 | |
10 | - $important_style = isset($important_style) ? $important_style : 0; |
|
11 | - $auto_width = isset($auto_width) ? $auto_width : 0; |
|
12 | - $submit_style = isset($submit_style) ? $submit_style : 0; |
|
10 | + $important_style = isset( $important_style ) ? $important_style : 0; |
|
11 | + $auto_width = isset( $auto_width ) ? $auto_width : 0; |
|
12 | + $submit_style = isset( $submit_style ) ? $submit_style : 0; |
|
13 | 13 | |
14 | 14 | $style_name = FrmAppHelper::simple_get( 'style_name', 'sanitize_title' ); |
15 | 15 | if ( ! empty( $style_name ) ) { |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | $style_class = 'with_frm_style'; |
19 | 19 | } |
20 | 20 | } else { |
21 | - $style_class = 'frm_style_'. $style->post_name .'.with_frm_style'; |
|
22 | - extract($style->post_content); |
|
21 | + $style_class = 'frm_style_' . $style->post_name . '.with_frm_style'; |
|
22 | + extract( $style->post_content ); |
|
23 | 23 | } |
24 | 24 | |
25 | -$important = empty($important_style) ? '' : ' !important'; |
|
25 | +$important = empty( $important_style ) ? '' : ' !important'; |
|
26 | 26 | $label_margin = (int) $width + 10; |
27 | 27 | |
28 | 28 | $minus_icons = FrmStylesHelper::minus_icons(); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $change_margin = 650 . 'px'; |
40 | 40 | } |
41 | 41 | |
42 | -if ( ! isset($collapse_icon) ) { |
|
42 | +if ( ! isset( $collapse_icon ) ) { |
|
43 | 43 | $collapse_icon = 0; |
44 | 44 | } |
45 | 45 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | border:<?php echo esc_html( $fieldset ) ?> solid #<?php echo esc_html( $fieldset_color . $important ) ?>; |
77 | 77 | margin:0; |
78 | 78 | padding:<?php echo esc_html( $fieldset_padding . $important ) ?>; |
79 | - background-color:<?php echo esc_html( empty($fieldset_bg_color) ? 'transparent' : '#'. $fieldset_bg_color ); ?>; |
|
79 | + background-color:<?php echo esc_html( empty( $fieldset_bg_color ) ? 'transparent' : '#' . $fieldset_bg_color ); ?>; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | .<?php echo esc_html( $style_class ) ?> legend + h3, |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | } |
121 | 121 | |
122 | 122 | .<?php echo esc_html( $style_class ) ?> .frm_repeat_sec{ |
123 | - margin-bottom:<?php echo esc_html( $field_margin. $important ) ?>; |
|
124 | - margin-top:<?php echo esc_html( $field_margin. $important ) ?>; |
|
123 | + margin-bottom:<?php echo esc_html( $field_margin . $important ) ?>; |
|
124 | + margin-top:<?php echo esc_html( $field_margin . $important ) ?>; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | .<?php echo esc_html( $style_class ) ?> label.frm_primary_label, |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | } |
149 | 149 | |
150 | 150 | .<?php echo esc_html( $style_class ) ?> .frm_icon_font.frm_minus_icon:before{ |
151 | - content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['-'] : $minus_icons[1]['-'] ) ?>"; |
|
151 | + content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['-'] : $minus_icons[1]['-'] ) ?>"; |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | .<?php echo esc_html( $style_class ) ?> .frm_icon_font.frm_plus_icon:before{ |
155 | - content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['+'] : $minus_icons[1]['+'] ) ?>"; |
|
155 | + content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['+'] : $minus_icons[1]['+'] ) ?>"; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | .<?php echo esc_html( $style_class ) ?> .frm_icon_font.frm_minus_icon:before, |
@@ -161,15 +161,15 @@ discard block |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | .<?php echo esc_html( $style_class ) ?> .frm_trigger.active .frm_icon_font.frm_arrow_icon:before{ |
164 | - content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['-'] : $arrow_icons[1]['-'] ) ?>"; |
|
164 | + content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['-'] : $arrow_icons[1]['-'] ) ?>"; |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | .<?php echo esc_html( $style_class ) ?> .frm_trigger .frm_icon_font.frm_arrow_icon:before{ |
168 | - content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['+'] : $arrow_icons[1]['+'] ) ?>"; |
|
168 | + content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['+'] : $arrow_icons[1]['+'] ) ?>"; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | .<?php echo esc_html( $style_class ) ?> .form-field{ |
172 | - margin-bottom:<?php echo esc_html( $field_margin. $important ) ?>; |
|
172 | + margin-bottom:<?php echo esc_html( $field_margin . $important ) ?>; |
|
173 | 173 | } |
174 | 174 | .<?php echo esc_html( $style_class ) ?> .frm_grid, |
175 | 175 | .<?php echo esc_html( $style_class ) ?> .frm_grid_first, |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | .<?php echo esc_html( $style_class ) ?> .frm_error{ |
188 | 188 | margin:0; |
189 | 189 | padding:0; |
190 | - font-family:<?php echo FrmAppHelper::kses( stripslashes($font) . $important ) ?>; |
|
190 | + font-family:<?php echo FrmAppHelper::kses( stripslashes( $font ) . $important ) ?>; |
|
191 | 191 | font-size:<?php echo esc_html( $description_font_size . $important ) ?>; |
192 | 192 | color:#<?php echo esc_html( $description_color . $important ) ?>; |
193 | 193 | font-weight:<?php echo esc_html( $description_weight . $important ) ?>; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | } |
269 | 269 | |
270 | 270 | .<?php echo esc_html( $style_class ) ?> .form-field.frm_col_field div.frm_description{ |
271 | - width:<?php echo esc_html( ( $field_width == '' ? 'auto' : $field_width ) . $important ) ?>; |
|
271 | + width:<?php echo esc_html( ( $field_width == '' ? 'auto' : $field_width ) . $important ) ?>; |
|
272 | 272 | max-width:100%; |
273 | 273 | } |
274 | 274 | |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | |
294 | 294 | .<?php echo esc_html( $style_class ) ?> .frm_scale label{ |
295 | 295 | font-weight:<?php echo esc_html( $check_weight . $important ) ?>; |
296 | - font-family:<?php echo FrmAppHelper::kses( stripslashes($font) . $important ) ?>; |
|
296 | + font-family:<?php echo FrmAppHelper::kses( stripslashes( $font ) . $important ) ?>; |
|
297 | 297 | font-size:<?php echo esc_html( $check_font_size . $important ) ?>; |
298 | 298 | color:#<?php echo esc_html( $check_label_color . $important ) ?>; |
299 | 299 | } |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | .<?php echo esc_html( $style_class ) ?> select, |
314 | 314 | .<?php echo esc_html( $style_class ) ?> textarea, |
315 | 315 | .<?php echo esc_html( $style_class ) ?> .chosen-container{ |
316 | - font-family:<?php echo FrmAppHelper::kses( stripslashes($font) . $important ) ?>; |
|
316 | + font-family:<?php echo FrmAppHelper::kses( stripslashes( $font ) . $important ) ?>; |
|
317 | 317 | font-size:<?php echo esc_html( $field_font_size ) ?>; |
318 | 318 | margin-bottom:0<?php echo esc_html( $important ) ?>; |
319 | 319 | } |
@@ -335,8 +335,8 @@ discard block |
||
335 | 335 | .<?php echo esc_html( $style_class ) ?> .chosen-container-multi .chosen-choices, |
336 | 336 | .<?php echo esc_html( $style_class ) ?> .chosen-container-single .chosen-single{ |
337 | 337 | color:#<?php echo esc_html( $text_color . $important ) ?>; |
338 | - background-color:<?php echo esc_html( ( empty($bg_color) ? 'transparent' : '#'. $bg_color ) . $important ); ?>; |
|
339 | -<?php if ( ! empty($important) ) { |
|
338 | + background-color:<?php echo esc_html( ( empty( $bg_color ) ? 'transparent' : '#' . $bg_color ) . $important ); ?>; |
|
339 | +<?php if ( ! empty( $important ) ) { |
|
340 | 340 | echo esc_html( 'background-image:none' . $important . ';' ); |
341 | 341 | } |
342 | 342 | ?> |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | |
361 | 361 | .<?php echo esc_html( $style_class ) ?> input[type=file]::-webkit-file-upload-button{ |
362 | 362 | color:#<?php echo esc_html( $text_color . $important ) ?>; |
363 | - background-color:<?php echo esc_html( ( empty($bg_color) ? 'transparent' : '#'. $bg_color ) . $important ); ?>; |
|
363 | + background-color:<?php echo esc_html( ( empty( $bg_color ) ? 'transparent' : '#' . $bg_color ) . $important ); ?>; |
|
364 | 364 | padding:<?php echo esc_html( $field_pad . $important ) ?>; |
365 | 365 | border-radius:<?php echo esc_html( $border_radius . $important ) ?>; |
366 | 366 | border-color:#<?php echo esc_html( $border_color . $important ) ?>; |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | } |
439 | 439 | |
440 | 440 | .<?php echo esc_html( $style_class ) ?> .mceIframeContainer{ |
441 | - background-color:<?php echo esc_html( ( empty($bg_color) ? 'transparent' : '#'. $bg_color ) . $important ); ?>; |
|
441 | + background-color:<?php echo esc_html( ( empty( $bg_color ) ? 'transparent' : '#' . $bg_color ) . $important ); ?>; |
|
442 | 442 | } |
443 | 443 | |
444 | 444 | .<?php echo esc_html( $style_class ) ?> .auto_width input, |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | .<?php echo esc_html( $style_class ) ?> input[readonly], |
455 | 455 | .<?php echo esc_html( $style_class ) ?> select[readonly], |
456 | 456 | .<?php echo esc_html( $style_class ) ?> textarea[readonly]{ |
457 | - background-color:<?php echo esc_html( ( empty($bg_color_disabled) ? 'transparent' : '#'. $bg_color_disabled ) . $important ); ?>; |
|
457 | + background-color:<?php echo esc_html( ( empty( $bg_color_disabled ) ? 'transparent' : '#' . $bg_color_disabled ) . $important ); ?>; |
|
458 | 458 | color:#<?php echo esc_html( $text_color_disabled . $important ) ?>; |
459 | 459 | border-color:#<?php echo esc_html( $border_color_disabled . $important ) ?>; |
460 | 460 | } |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | .<?php echo esc_html( $style_class ) ?> .frm_focus_field input[type=search], |
473 | 473 | .frm_form_fields_active_style, |
474 | 474 | .<?php echo esc_html( $style_class ) ?> .chosen-container-active .chosen-choices{ |
475 | - background-color:<?php echo esc_html( ( empty($bg_color_active) ? 'transparent' : '#'. $bg_color_active ) . $important ); ?>; |
|
475 | + background-color:<?php echo esc_html( ( empty( $bg_color_active ) ? 'transparent' : '#' . $bg_color_active ) . $important ); ?>; |
|
476 | 476 | border-color:#<?php echo esc_html( $border_color_active . $important ) ?>; |
477 | 477 | <?php if ( isset( $remove_box_shadow_active ) && $remove_box_shadow_active ) { ?> |
478 | 478 | box-shadow:none; |
@@ -494,8 +494,8 @@ discard block |
||
494 | 494 | line-height:normal<?php echo esc_html( $important ) ?>; |
495 | 495 | text-align:center; |
496 | 496 | background:#<?php echo esc_html( $submit_bg_color ); |
497 | - if ( ! empty($submit_bg_img) ) { |
|
498 | - echo esc_html( ' url('. $submit_bg_img .')' ); |
|
497 | + if ( ! empty( $submit_bg_img ) ) { |
|
498 | + echo esc_html( ' url(' . $submit_bg_img . ')' ); |
|
499 | 499 | } |
500 | 500 | echo esc_html( $important ); ?>; |
501 | 501 | border-width:<?php echo esc_html( $submit_border_width ) ?>; |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | |
593 | 593 | .<?php echo esc_html( $style_class ) ?> .frm_radio label, |
594 | 594 | .<?php echo esc_html( $style_class ) ?> .frm_checkbox label{ |
595 | - font-family:<?php echo FrmAppHelper::kses( stripslashes($font) . $important ) ?>; |
|
595 | + font-family:<?php echo FrmAppHelper::kses( stripslashes( $font ) . $important ) ?>; |
|
596 | 596 | font-size:<?php echo esc_html( $check_font_size . $important ) ?>; |
597 | 597 | color:#<?php echo esc_html( $check_label_color . $important ) ?>; |
598 | 598 | font-weight:<?php echo esc_html( $check_weight . $important ) ?>; |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | .<?php echo esc_html( $style_class ) ?> .frm_blank_field .g-recaptcha iframe, |
613 | 613 | .<?php echo esc_html( $style_class ) ?> .frm_blank_field .chosen-container-multi .chosen-choices{ |
614 | 614 | color:#<?php echo esc_html( $text_color_error . $important ) ?>; |
615 | - background-color:<?php echo esc_html( ( empty($bg_color_error) ? 'transparent' : '#'. $bg_color_error ) . $important ); ?>; |
|
615 | + background-color:<?php echo esc_html( ( empty( $bg_color_error ) ? 'transparent' : '#' . $bg_color_error ) . $important ); ?>; |
|
616 | 616 | border-color:#<?php echo esc_html( $border_color_error . $important ) ?>; |
617 | 617 | border-width:<?php echo esc_html( $border_width_error . $important ) ?>; |
618 | 618 | border-style:<?php echo esc_html( $border_style_error . $important ) ?>; |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | } |
629 | 629 | |
630 | 630 | .<?php echo esc_html( $style_class ) ?> .frm_error_style{ |
631 | - background-color:<?php echo esc_html( ( empty($error_bg) ? 'transparent' : '#'. $error_bg ) . $important ); ?>; |
|
631 | + background-color:<?php echo esc_html( ( empty( $error_bg ) ? 'transparent' : '#' . $error_bg ) . $important ); ?>; |
|
632 | 632 | border:1px solid #<?php echo esc_html( $error_border . $important ) ?>; |
633 | 633 | color:#<?php echo esc_html( $error_text . $important ) ?>; |
634 | 634 | font-size:<?php echo esc_html( $error_font_size . $important ) ?>; |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | .<?php echo esc_html( $style_class ) ?> .frm_message, |
640 | 640 | .frm_success_style{ |
641 | 641 | border:1px solid #<?php echo esc_html( $success_border_color ) ?>; |
642 | - background-color:<?php echo esc_html( ( empty($success_bg_color) ? 'transparent' : '#'. $success_bg_color ) . $important ); ?>; |
|
642 | + background-color:<?php echo esc_html( ( empty( $success_bg_color ) ? 'transparent' : '#' . $success_bg_color ) . $important ); ?>; |
|
643 | 643 | color:#<?php echo esc_html( $success_text_color ) ?>; |
644 | 644 | } |
645 | 645 | |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | |
665 | 665 | .form_results.<?php echo esc_html( $style_class ) ?> tr.frm_even, |
666 | 666 | .frm-grid .frm_even{ |
667 | - background-color:<?php echo esc_html( ( empty($bg_color) ? 'transparent' : '#'. $bg_color ) . $important ); ?>; |
|
667 | + background-color:<?php echo esc_html( ( empty( $bg_color ) ? 'transparent' : '#' . $bg_color ) . $important ); ?>; |
|
668 | 668 | } |
669 | 669 | |
670 | 670 | .<?php echo esc_html( $style_class ) ?> #frm_loading .progress-striped .progress-bar{ |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | } |
673 | 673 | |
674 | 674 | .<?php echo esc_html( $style_class ) ?> #frm_loading .progress-bar{ |
675 | - background-color:<?php echo esc_html( ( empty($bg_color) ? 'transparent' : '#'. $bg_color ) . $important ); ?>; |
|
675 | + background-color:<?php echo esc_html( ( empty( $bg_color ) ? 'transparent' : '#' . $bg_color ) . $important ); ?>; |
|
676 | 676 | } |
677 | 677 | |
678 | 678 | .<?php echo esc_html( $style_class ) ?> .frm_grid, |
@@ -684,21 +684,21 @@ discard block |
||
684 | 684 | .<?php echo esc_html( $style_class ) ?> .frm_grid.frm_blank_field, |
685 | 685 | .<?php echo esc_html( $style_class ) ?> .frm_grid_first.frm_blank_field, |
686 | 686 | .<?php echo esc_html( $style_class ) ?> .frm_grid_odd.frm_blank_field{ |
687 | - background-color:<?php echo esc_html( ( empty($error_bg) ? 'transparent' : '#'. $error_bg ) . $important ); ?>; |
|
687 | + background-color:<?php echo esc_html( ( empty( $error_bg ) ? 'transparent' : '#' . $error_bg ) . $important ); ?>; |
|
688 | 688 | border-color:#<?php echo esc_html( $error_border ) ?>; |
689 | 689 | } |
690 | 690 | |
691 | 691 | .<?php echo esc_html( $style_class ) ?> .frm_grid_first, |
692 | 692 | .<?php echo esc_html( $style_class ) ?> .frm_grid_odd{ |
693 | - background-color:<?php echo esc_html( ( empty($bg_color) ? 'transparent' : '#'. $bg_color ) . $important ); ?>; |
|
693 | + background-color:<?php echo esc_html( ( empty( $bg_color ) ? 'transparent' : '#' . $bg_color ) . $important ); ?>; |
|
694 | 694 | } |
695 | 695 | |
696 | 696 | .<?php echo esc_html( $style_class ) ?> .frm_grid{ |
697 | - background-color:<?php echo esc_html( ( empty($bg_color_active) ? 'transparent' : '#'. $bg_color_active ) . $important ); ?>; |
|
697 | + background-color:<?php echo esc_html( ( empty( $bg_color_active ) ? 'transparent' : '#' . $bg_color_active ) . $important ); ?>; |
|
698 | 698 | } |
699 | 699 | |
700 | 700 | .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_html_scroll_box{ |
701 | - background-color:<?php echo esc_html( ( empty($bg_color) ? 'transparent' : '#'. $bg_color ) . $important ); ?>; |
|
701 | + background-color:<?php echo esc_html( ( empty( $bg_color ) ? 'transparent' : '#' . $bg_color ) . $important ); ?>; |
|
702 | 702 | border-color:#<?php echo esc_html( $border_color . $important ) ?>; |
703 | 703 | border-width:<?php echo esc_html( $field_border_width . $important ) ?>; |
704 | 704 | border-style:<?php echo esc_html( $field_border_style . $important ) ?>; |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | -webkit-border-radius:<?php echo esc_html( $border_radius . $important ) ?>; |
733 | 733 | border-radius:<?php echo esc_html( $border_radius . $important ) ?>; |
734 | 734 | font-size:<?php echo esc_html( $submit_font_size . $important ) ?>; |
735 | - font-family:<?php echo FrmAppHelper::kses( stripslashes($font) . $important ) ?>; |
|
735 | + font-family:<?php echo FrmAppHelper::kses( stripslashes( $font ) . $important ) ?>; |
|
736 | 736 | font-weight:<?php echo esc_html( $submit_weight . $important ) ?>; |
737 | 737 | color:#<?php echo esc_html( $submit_text_color . $important ) ?>; |
738 | 738 | background:#<?php echo esc_html( $submit_bg_color . $important ) ?>; |
@@ -851,10 +851,10 @@ discard block |
||
851 | 851 | .<?php echo esc_html( $style_class ) ?> .chosen-container-single .chosen-single div{ |
852 | 852 | <?php |
853 | 853 | // calculate the top position based on field padding |
854 | - $top_pad = explode(' ', $field_pad); |
|
855 | - $top_pad = reset($top_pad); // the top padding is listed first |
|
856 | - $pad_unit = preg_replace('/[0-9]+/', '', $top_pad); //px, em, rem... |
|
857 | - $top_margin = (int) str_replace($pad_unit, '', $top_pad) / 2; |
|
854 | + $top_pad = explode( ' ', $field_pad ); |
|
855 | + $top_pad = reset( $top_pad ); // the top padding is listed first |
|
856 | + $pad_unit = preg_replace( '/[0-9]+/', '', $top_pad ); //px, em, rem... |
|
857 | + $top_margin = (int) str_replace( $pad_unit, '', $top_pad ) / 2; |
|
858 | 858 | ?> |
859 | 859 | top:<?php echo esc_html( $top_margin . $pad_unit . $important ) ?>; |
860 | 860 | } |