@@ -1,67 +1,67 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | class FrmStylesHelper { |
3 | 3 | |
4 | - public static function jquery_themes() { |
|
5 | - $themes = array( |
|
6 | - 'ui-lightness' => 'UI Lightness', |
|
7 | - 'ui-darkness' => 'UI Darkness', |
|
8 | - 'smoothness' => 'Smoothness', |
|
9 | - 'start' => 'Start', |
|
10 | - 'redmond' => 'Redmond', |
|
11 | - 'sunny' => 'Sunny', |
|
12 | - 'overcast' => 'Overcast', |
|
13 | - 'le-frog' => 'Le Frog', |
|
14 | - 'flick' => 'Flick', |
|
4 | + public static function jquery_themes() { |
|
5 | + $themes = array( |
|
6 | + 'ui-lightness' => 'UI Lightness', |
|
7 | + 'ui-darkness' => 'UI Darkness', |
|
8 | + 'smoothness' => 'Smoothness', |
|
9 | + 'start' => 'Start', |
|
10 | + 'redmond' => 'Redmond', |
|
11 | + 'sunny' => 'Sunny', |
|
12 | + 'overcast' => 'Overcast', |
|
13 | + 'le-frog' => 'Le Frog', |
|
14 | + 'flick' => 'Flick', |
|
15 | 15 | 'pepper-grinder' => 'Pepper Grinder', |
16 | - 'eggplant' => 'Eggplant', |
|
17 | - 'dark-hive' => 'Dark Hive', |
|
18 | - 'cupertino' => 'Cupertino', |
|
19 | - 'south-street' => 'South Street', |
|
20 | - 'blitzer' => 'Blitzer', |
|
21 | - 'humanity' => 'Humanity', |
|
22 | - 'hot-sneaks' => 'Hot Sneaks', |
|
23 | - 'excite-bike' => 'Excite Bike', |
|
24 | - 'vader' => 'Vader', |
|
25 | - 'dot-luv' => 'Dot Luv', |
|
26 | - 'mint-choc' => 'Mint Choc', |
|
27 | - 'black-tie' => 'Black Tie', |
|
28 | - 'trontastic' => 'Trontastic', |
|
29 | - 'swanky-purse' => 'Swanky Purse', |
|
30 | - ); |
|
31 | - |
|
32 | - $themes = apply_filters('frm_jquery_themes', $themes); |
|
33 | - return $themes; |
|
34 | - } |
|
16 | + 'eggplant' => 'Eggplant', |
|
17 | + 'dark-hive' => 'Dark Hive', |
|
18 | + 'cupertino' => 'Cupertino', |
|
19 | + 'south-street' => 'South Street', |
|
20 | + 'blitzer' => 'Blitzer', |
|
21 | + 'humanity' => 'Humanity', |
|
22 | + 'hot-sneaks' => 'Hot Sneaks', |
|
23 | + 'excite-bike' => 'Excite Bike', |
|
24 | + 'vader' => 'Vader', |
|
25 | + 'dot-luv' => 'Dot Luv', |
|
26 | + 'mint-choc' => 'Mint Choc', |
|
27 | + 'black-tie' => 'Black Tie', |
|
28 | + 'trontastic' => 'Trontastic', |
|
29 | + 'swanky-purse' => 'Swanky Purse', |
|
30 | + ); |
|
31 | + |
|
32 | + $themes = apply_filters('frm_jquery_themes', $themes); |
|
33 | + return $themes; |
|
34 | + } |
|
35 | 35 | |
36 | 36 | public static function jquery_css_url( $theme_css ) { |
37 | - if ( $theme_css == -1 ) { |
|
38 | - return; |
|
39 | - } |
|
40 | - |
|
41 | - if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) { |
|
42 | - $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css'; |
|
43 | - } else if ( preg_match('/^http.?:\/\/.*\..*$/', $theme_css) ) { |
|
44 | - $css_file = $theme_css; |
|
45 | - } else { |
|
46 | - $uploads = self::get_upload_base(); |
|
37 | + if ( $theme_css == -1 ) { |
|
38 | + return; |
|
39 | + } |
|
40 | + |
|
41 | + if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) { |
|
42 | + $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css'; |
|
43 | + } else if ( preg_match('/^http.?:\/\/.*\..*$/', $theme_css) ) { |
|
44 | + $css_file = $theme_css; |
|
45 | + } else { |
|
46 | + $uploads = self::get_upload_base(); |
|
47 | 47 | $file_path = '/formidable/css/' . $theme_css . '/jquery-ui.css'; |
48 | - if ( file_exists($uploads['basedir'] . $file_path) ) { |
|
49 | - $css_file = $uploads['baseurl'] . $file_path; |
|
50 | - } else { |
|
48 | + if ( file_exists($uploads['basedir'] . $file_path) ) { |
|
49 | + $css_file = $uploads['baseurl'] . $file_path; |
|
50 | + } else { |
|
51 | 51 | $css_file = FrmAppHelper::jquery_ui_base_url() . '/themes/' . $theme_css . '/jquery-ui.min.css'; |
52 | - } |
|
53 | - } |
|
52 | + } |
|
53 | + } |
|
54 | 54 | |
55 | - return $css_file; |
|
56 | - } |
|
55 | + return $css_file; |
|
56 | + } |
|
57 | 57 | |
58 | - public static function enqueue_jquery_css() { |
|
58 | + public static function enqueue_jquery_css() { |
|
59 | 59 | $form = self::get_form_for_page(); |
60 | 60 | $theme_css = FrmStylesController::get_style_val( 'theme_css', $form ); |
61 | - if ( $theme_css != -1 ) { |
|
62 | - wp_enqueue_style('jquery-theme', self::jquery_css_url($theme_css), array(), FrmAppHelper::plugin_version()); |
|
63 | - } |
|
64 | - } |
|
61 | + if ( $theme_css != -1 ) { |
|
62 | + wp_enqueue_style('jquery-theme', self::jquery_css_url($theme_css), array(), FrmAppHelper::plugin_version()); |
|
63 | + } |
|
64 | + } |
|
65 | 65 | |
66 | 66 | public static function get_form_for_page() { |
67 | 67 | global $frm_vars; |
@@ -77,14 +77,14 @@ discard block |
||
77 | 77 | return $form_id; |
78 | 78 | } |
79 | 79 | |
80 | - public static function get_upload_base() { |
|
81 | - $uploads = wp_upload_dir(); |
|
82 | - if ( is_ssl() && ! preg_match('/^https:\/\/.*\..*$/', $uploads['baseurl']) ) { |
|
83 | - $uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']); |
|
84 | - } |
|
80 | + public static function get_upload_base() { |
|
81 | + $uploads = wp_upload_dir(); |
|
82 | + if ( is_ssl() && ! preg_match('/^https:\/\/.*\..*$/', $uploads['baseurl']) ) { |
|
83 | + $uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']); |
|
84 | + } |
|
85 | 85 | |
86 | - return $uploads; |
|
87 | - } |
|
86 | + return $uploads; |
|
87 | + } |
|
88 | 88 | |
89 | 89 | public static function style_menu( $active = '' ) { |
90 | 90 | ?> |
@@ -94,22 +94,22 @@ discard block |
||
94 | 94 | <a href="<?php echo esc_url( admin_url('admin.php?page=formidable-styles&frm_action=custom_css' ) ) ?>" class="nav-tab <?php echo ( 'custom_css' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Custom CSS', 'formidable' ) ?></a> |
95 | 95 | </h2> |
96 | 96 | <?php |
97 | - } |
|
97 | + } |
|
98 | 98 | |
99 | - public static function minus_icons() { |
|
100 | - return array( |
|
99 | + public static function minus_icons() { |
|
100 | + return array( |
|
101 | 101 | 0 => array( '-' => '62e', '+' => '62f' ), |
102 | 102 | 1 => array( '-' => '600', '+' => '602' ), |
103 | 103 | 2 => array( '-' => '604', '+' => '603' ), |
104 | 104 | 3 => array( '-' => '633', '+' => '632' ), |
105 | 105 | 4 => array( '-' => '613', '+' => '60f' ), |
106 | - ); |
|
107 | - } |
|
106 | + ); |
|
107 | + } |
|
108 | 108 | |
109 | - public static function arrow_icons() { |
|
110 | - $minus_icons = self::minus_icons(); |
|
109 | + public static function arrow_icons() { |
|
110 | + $minus_icons = self::minus_icons(); |
|
111 | 111 | |
112 | - return array( |
|
112 | + return array( |
|
113 | 113 | 6 => array( '-' => '62d', '+' => '62a' ), |
114 | 114 | 0 => array( '-' => '60d', '+' => '609' ), |
115 | 115 | 1 => array( '-' => '60e', '+' => '60c' ), |
@@ -117,44 +117,44 @@ discard block |
||
117 | 117 | 3 => array( '-' => '62b', '+' => '628' ), |
118 | 118 | 4 => array( '-' => '62c', '+' => '629' ), |
119 | 119 | 5 => array( '-' => '635', '+' => '634' ), |
120 | - 'p0' => $minus_icons[0], |
|
121 | - 'p1' => $minus_icons[1], |
|
122 | - 'p2' => $minus_icons[2], |
|
123 | - 'p3' => $minus_icons[3], |
|
124 | - 'p4' => $minus_icons[4], |
|
125 | - ); |
|
126 | - } |
|
127 | - |
|
128 | - /** |
|
129 | - * @since 2.0 |
|
130 | - * @return The class for this icon |
|
131 | - */ |
|
120 | + 'p0' => $minus_icons[0], |
|
121 | + 'p1' => $minus_icons[1], |
|
122 | + 'p2' => $minus_icons[2], |
|
123 | + 'p3' => $minus_icons[3], |
|
124 | + 'p4' => $minus_icons[4], |
|
125 | + ); |
|
126 | + } |
|
127 | + |
|
128 | + /** |
|
129 | + * @since 2.0 |
|
130 | + * @return The class for this icon |
|
131 | + */ |
|
132 | 132 | public static function icon_key_to_class( $key, $icon = '+', $type = 'arrow' ) { |
133 | - if ( 'arrow' == $type && is_numeric($key) ) { |
|
134 | - //frm_arrowup6_icon |
|
133 | + if ( 'arrow' == $type && is_numeric($key) ) { |
|
134 | + //frm_arrowup6_icon |
|
135 | 135 | $arrow = array( '-' => 'down', '+' => 'up' ); |
136 | 136 | $class = 'frm_arrow' . $arrow[ $icon ]; |
137 | - } else { |
|
138 | - //frm_minus1_icon |
|
139 | - $key = str_replace('p', '', $key); |
|
137 | + } else { |
|
138 | + //frm_minus1_icon |
|
139 | + $key = str_replace('p', '', $key); |
|
140 | 140 | $plus = array( '-' => 'minus', '+' => 'plus' ); |
141 | 141 | $class = 'frm_' . $plus[ $icon ]; |
142 | - } |
|
142 | + } |
|
143 | 143 | |
144 | - if ( $key ) { |
|
145 | - $class .= $key; |
|
146 | - } |
|
147 | - $class .= '_icon'; |
|
144 | + if ( $key ) { |
|
145 | + $class .= $key; |
|
146 | + } |
|
147 | + $class .= '_icon'; |
|
148 | 148 | |
149 | - return $class; |
|
150 | - } |
|
149 | + return $class; |
|
150 | + } |
|
151 | 151 | |
152 | 152 | public static function bs_icon_select( $style, $frm_style, $type = 'arrow' ) { |
153 | 153 | $function_name = $type . '_icons'; |
154 | 154 | $icons = self::$function_name(); |
155 | 155 | unset( $function_name ); |
156 | 156 | |
157 | - $name = ( 'arrow' == $type ) ? 'collapse_icon' : 'repeat_icon'; |
|
157 | + $name = ( 'arrow' == $type ) ? 'collapse_icon' : 'repeat_icon'; |
|
158 | 158 | ?> |
159 | 159 | <select name="<?php echo esc_attr( $frm_style->get_field_name($name) ) ?>" id="frm_<?php echo esc_attr( $name ) ?>" class="frm_icon_font frm_multiselect hide-if-js"> |
160 | 160 | <?php foreach ( $icons as $key => $icon ) { ?> |
@@ -187,22 +187,22 @@ discard block |
||
187 | 187 | </ul> |
188 | 188 | </div> |
189 | 189 | <?php |
190 | - } |
|
190 | + } |
|
191 | 191 | |
192 | 192 | public static function hex2rgb( $hex ) { |
193 | - $hex = str_replace('#', '', $hex); |
|
193 | + $hex = str_replace('#', '', $hex); |
|
194 | 194 | |
195 | - if ( strlen($hex) == 3 ) { |
|
195 | + if ( strlen($hex) == 3 ) { |
|
196 | 196 | $r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) ); |
197 | 197 | $g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) ); |
198 | 198 | $b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) ); |
199 | - } else { |
|
199 | + } else { |
|
200 | 200 | $r = hexdec( substr( $hex, 0, 2 ) ); |
201 | 201 | $g = hexdec( substr( $hex, 2, 2 ) ); |
202 | 202 | $b = hexdec( substr( $hex, 4, 2 ) ); |
203 | - } |
|
203 | + } |
|
204 | 204 | $rgb = array( $r, $g, $b ); |
205 | - return implode(',', $rgb); // returns the rgb values separated by commas |
|
206 | - //return $rgb; // returns an array with the rgb values |
|
207 | - } |
|
205 | + return implode(',', $rgb); // returns the rgb values separated by commas |
|
206 | + //return $rgb; // returns an array with the rgb values |
|
207 | + } |
|
208 | 208 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | 'swanky-purse' => 'Swanky Purse', |
30 | 30 | ); |
31 | 31 | |
32 | - $themes = apply_filters('frm_jquery_themes', $themes); |
|
32 | + $themes = apply_filters( 'frm_jquery_themes', $themes ); |
|
33 | 33 | return $themes; |
34 | 34 | } |
35 | 35 | |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | |
41 | 41 | if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) { |
42 | 42 | $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css'; |
43 | - } else if ( preg_match('/^http.?:\/\/.*\..*$/', $theme_css) ) { |
|
43 | + } else if ( preg_match( '/^http.?:\/\/.*\..*$/', $theme_css ) ) { |
|
44 | 44 | $css_file = $theme_css; |
45 | 45 | } else { |
46 | 46 | $uploads = self::get_upload_base(); |
47 | 47 | $file_path = '/formidable/css/' . $theme_css . '/jquery-ui.css'; |
48 | - if ( file_exists($uploads['basedir'] . $file_path) ) { |
|
48 | + if ( file_exists( $uploads['basedir'] . $file_path ) ) { |
|
49 | 49 | $css_file = $uploads['baseurl'] . $file_path; |
50 | 50 | } else { |
51 | 51 | $css_file = FrmAppHelper::jquery_ui_base_url() . '/themes/' . $theme_css . '/jquery-ui.min.css'; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $form = self::get_form_for_page(); |
60 | 60 | $theme_css = FrmStylesController::get_style_val( 'theme_css', $form ); |
61 | 61 | if ( $theme_css != -1 ) { |
62 | - wp_enqueue_style('jquery-theme', self::jquery_css_url($theme_css), array(), FrmAppHelper::plugin_version()); |
|
62 | + wp_enqueue_style( 'jquery-theme', self::jquery_css_url( $theme_css ), array(), FrmAppHelper::plugin_version() ); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | |
80 | 80 | public static function get_upload_base() { |
81 | 81 | $uploads = wp_upload_dir(); |
82 | - if ( is_ssl() && ! preg_match('/^https:\/\/.*\..*$/', $uploads['baseurl']) ) { |
|
83 | - $uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']); |
|
82 | + if ( is_ssl() && ! preg_match( '/^https:\/\/.*\..*$/', $uploads['baseurl'] ) ) { |
|
83 | + $uploads['baseurl'] = str_replace( 'http://', 'https://', $uploads['baseurl'] ); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | return $uploads; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | <h2 class="nav-tab-wrapper"> |
92 | 92 | <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-styles' ) ) ?>" class="nav-tab <?php echo ( '' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Edit Styles', 'formidable' ) ?></a> |
93 | 93 | <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-styles&frm_action=manage' ) ) ?>" class="nav-tab <?php echo ( 'manage' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Manage Form Styles', 'formidable' ) ?></a> |
94 | - <a href="<?php echo esc_url( admin_url('admin.php?page=formidable-styles&frm_action=custom_css' ) ) ?>" class="nav-tab <?php echo ( 'custom_css' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Custom CSS', 'formidable' ) ?></a> |
|
94 | + <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-styles&frm_action=custom_css' ) ) ?>" class="nav-tab <?php echo ( 'custom_css' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Custom CSS', 'formidable' ) ?></a> |
|
95 | 95 | </h2> |
96 | 96 | <?php |
97 | 97 | } |
@@ -130,15 +130,15 @@ discard block |
||
130 | 130 | * @return The class for this icon |
131 | 131 | */ |
132 | 132 | public static function icon_key_to_class( $key, $icon = '+', $type = 'arrow' ) { |
133 | - if ( 'arrow' == $type && is_numeric($key) ) { |
|
133 | + if ( 'arrow' == $type && is_numeric( $key ) ) { |
|
134 | 134 | //frm_arrowup6_icon |
135 | 135 | $arrow = array( '-' => 'down', '+' => 'up' ); |
136 | - $class = 'frm_arrow' . $arrow[ $icon ]; |
|
136 | + $class = 'frm_arrow' . $arrow[$icon]; |
|
137 | 137 | } else { |
138 | 138 | //frm_minus1_icon |
139 | - $key = str_replace('p', '', $key); |
|
139 | + $key = str_replace( 'p', '', $key ); |
|
140 | 140 | $plus = array( '-' => 'minus', '+' => 'plus' ); |
141 | - $class = 'frm_' . $plus[ $icon ]; |
|
141 | + $class = 'frm_' . $plus[$icon]; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | if ( $key ) { |
@@ -156,9 +156,9 @@ discard block |
||
156 | 156 | |
157 | 157 | $name = ( 'arrow' == $type ) ? 'collapse_icon' : 'repeat_icon'; |
158 | 158 | ?> |
159 | - <select name="<?php echo esc_attr( $frm_style->get_field_name($name) ) ?>" id="frm_<?php echo esc_attr( $name ) ?>" class="frm_icon_font frm_multiselect hide-if-js"> |
|
159 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ) ?>" id="frm_<?php echo esc_attr( $name ) ?>" class="frm_icon_font frm_multiselect hide-if-js"> |
|
160 | 160 | <?php foreach ( $icons as $key => $icon ) { ?> |
161 | - <option value="<?php echo esc_attr( $key ) ?>" <?php selected( $style->post_content[ $name ], $key ) ?>> |
|
161 | + <option value="<?php echo esc_attr( $key ) ?>" <?php selected( $style->post_content[$name], $key ) ?>> |
|
162 | 162 | <?php echo '' . $icon['+'] . '; ' . $icon['-'] . ';'; ?> |
163 | 163 | </option> |
164 | 164 | <?php } ?> |
@@ -166,8 +166,8 @@ discard block |
||
166 | 166 | |
167 | 167 | <div class="btn-group hide-if-no-js" id="frm_<?php echo esc_attr( $name ) ?>_select"> |
168 | 168 | <button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button"> |
169 | - <i class="frm_icon_font <?php echo esc_attr( self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ) ?>"></i> |
|
170 | - <i class="frm_icon_font <?php echo esc_attr( self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ) ?>"></i> |
|
169 | + <i class="frm_icon_font <?php echo esc_attr( self::icon_key_to_class( $style->post_content[$name], '+', $type ) ) ?>"></i> |
|
170 | + <i class="frm_icon_font <?php echo esc_attr( self::icon_key_to_class( $style->post_content[$name], '-', $type ) ) ?>"></i> |
|
171 | 171 | <b class="caret"></b> |
172 | 172 | </button> |
173 | 173 | <ul class="multiselect-container frm-dropdown-menu"> |
@@ -190,9 +190,9 @@ discard block |
||
190 | 190 | } |
191 | 191 | |
192 | 192 | public static function hex2rgb( $hex ) { |
193 | - $hex = str_replace('#', '', $hex); |
|
193 | + $hex = str_replace( '#', '', $hex ); |
|
194 | 194 | |
195 | - if ( strlen($hex) == 3 ) { |
|
195 | + if ( strlen( $hex ) == 3 ) { |
|
196 | 196 | $r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) ); |
197 | 197 | $g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) ); |
198 | 198 | $b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) ); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $b = hexdec( substr( $hex, 4, 2 ) ); |
203 | 203 | } |
204 | 204 | $rgb = array( $r, $g, $b ); |
205 | - return implode(',', $rgb); // returns the rgb values separated by commas |
|
205 | + return implode( ',', $rgb ); // returns the rgb values separated by commas |
|
206 | 206 | //return $rgb; // returns an array with the rgb values |
207 | 207 | } |
208 | 208 | } |
@@ -3,23 +3,23 @@ discard block |
||
3 | 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 | - } else { |
|
7 | - extract($_GET); |
|
8 | - } |
|
6 | + } else { |
|
7 | + extract($_GET); |
|
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 ) ) { |
16 | 16 | $style_class = $style_name . '.with_frm_style'; |
17 | - } else { |
|
18 | - $style_class = 'with_frm_style'; |
|
19 | - } |
|
17 | + } else { |
|
18 | + $style_class = 'with_frm_style'; |
|
19 | + } |
|
20 | 20 | } else { |
21 | 21 | $style_class = 'frm_style_' . $style->post_name . '.with_frm_style'; |
22 | - extract($style->post_content); |
|
22 | + extract($style->post_content); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | $important = empty($important_style) ? '' : ' !important'; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | if ( ! isset($collapse_icon) ) { |
43 | - $collapse_icon = 0; |
|
43 | + $collapse_icon = 0; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | if ( ! isset( $center_form ) ) { |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | color:#<?php echo esc_html( $text_color . $important ) ?>; |
338 | 338 | background-color:<?php echo esc_html( ( empty( $bg_color ) ? 'transparent' : '#' . $bg_color ) . $important ); ?>; |
339 | 339 | <?php if ( ! empty($important) ) { |
340 | - echo esc_html( 'background-image:none' . $important . ';' ); |
|
340 | + echo esc_html( 'background-image:none' . $important . ';' ); |
|
341 | 341 | } |
342 | 342 | ?> |
343 | 343 | border-color:#<?php echo esc_html( $border_color . $important ) ?>; |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | color:#<?php echo esc_html( $submit_active_color . $important ) ?>; |
549 | 549 | } |
550 | 550 | <?php |
551 | - } |
|
551 | + } |
|
552 | 552 | } |
553 | 553 | ?> |
554 | 554 | |
@@ -851,11 +851,11 @@ discard block |
||
851 | 851 | |
852 | 852 | .<?php echo esc_html( $style_class ) ?> .chosen-container-single .chosen-single div{ |
853 | 853 | <?php |
854 | - // calculate the top position based on field padding |
|
855 | - $top_pad = explode(' ', $field_pad); |
|
856 | - $top_pad = reset($top_pad); // the top padding is listed first |
|
857 | - $pad_unit = preg_replace('/[0-9]+/', '', $top_pad); //px, em, rem... |
|
858 | - $top_margin = (int) str_replace($pad_unit, '', $top_pad) / 2; |
|
854 | + // calculate the top position based on field padding |
|
855 | + $top_pad = explode(' ', $field_pad); |
|
856 | + $top_pad = reset($top_pad); // the top padding is listed first |
|
857 | + $pad_unit = preg_replace('/[0-9]+/', '', $top_pad); //px, em, rem... |
|
858 | + $top_margin = (int) str_replace($pad_unit, '', $top_pad) / 2; |
|
859 | 859 | ?> |
860 | 860 | top:<?php echo esc_html( $top_margin . $pad_unit . $important ) ?>; |
861 | 861 | } |
@@ -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 ) ) { |
@@ -19,10 +19,10 @@ discard block |
||
19 | 19 | } |
20 | 20 | } else { |
21 | 21 | $style_class = 'frm_style_' . $style->post_name . '.with_frm_style'; |
22 | - extract($style->post_content); |
|
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(); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $change_margin = 650 . 'px'; |
42 | 42 | } |
43 | 43 | |
44 | -if ( ! isset($collapse_icon) ) { |
|
44 | +if ( ! isset( $collapse_icon ) ) { |
|
45 | 45 | $collapse_icon = 0; |
46 | 46 | } |
47 | 47 | |
@@ -150,11 +150,11 @@ discard block |
||
150 | 150 | } |
151 | 151 | |
152 | 152 | .<?php echo esc_html( $style_class ) ?> .frm_icon_font.frm_minus_icon:before{ |
153 | - content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['-'] : $minus_icons[1]['-'] ) ?>"; |
|
153 | + content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['-'] : $minus_icons[1]['-'] ) ?>"; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | .<?php echo esc_html( $style_class ) ?> .frm_icon_font.frm_plus_icon:before{ |
157 | - content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['+'] : $minus_icons[1]['+'] ) ?>"; |
|
157 | + content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['+'] : $minus_icons[1]['+'] ) ?>"; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | .<?php echo esc_html( $style_class ) ?> .frm_icon_font.frm_minus_icon:before, |
@@ -163,11 +163,11 @@ discard block |
||
163 | 163 | } |
164 | 164 | |
165 | 165 | .<?php echo esc_html( $style_class ) ?> .frm_trigger.active .frm_icon_font.frm_arrow_icon:before{ |
166 | - content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['-'] : $arrow_icons[1]['-'] ) ?>"; |
|
166 | + content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['-'] : $arrow_icons[1]['-'] ) ?>"; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | .<?php echo esc_html( $style_class ) ?> .frm_trigger .frm_icon_font.frm_arrow_icon:before{ |
170 | - content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['+'] : $arrow_icons[1]['+'] ) ?>"; |
|
170 | + content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['+'] : $arrow_icons[1]['+'] ) ?>"; |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | .<?php echo esc_html( $style_class ) ?> .form-field{ |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | .<?php echo esc_html( $style_class ) ?> .chosen-container-single .chosen-single{ |
343 | 343 | color:#<?php echo esc_html( $text_color . $important ) ?>; |
344 | 344 | background-color:<?php echo esc_html( ( empty( $bg_color ) ? 'transparent' : '#' . $bg_color ) . $important ); ?>; |
345 | -<?php if ( ! empty($important) ) { |
|
345 | +<?php if ( ! empty( $important ) ) { |
|
346 | 346 | echo esc_html( 'background-image:none' . $important . ';' ); |
347 | 347 | } |
348 | 348 | ?> |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | line-height:normal<?php echo esc_html( $important ) ?>; |
501 | 501 | text-align:center; |
502 | 502 | background:#<?php echo esc_html( $submit_bg_color ); |
503 | - if ( ! empty($submit_bg_img) ) { |
|
503 | + if ( ! empty( $submit_bg_img ) ) { |
|
504 | 504 | echo esc_html( ' url(' . $submit_bg_img . ')' ); |
505 | 505 | } |
506 | 506 | echo esc_html( $important ); ?>; |
@@ -861,10 +861,10 @@ discard block |
||
861 | 861 | .<?php echo esc_html( $style_class ) ?> .chosen-container-single .chosen-single div{ |
862 | 862 | <?php |
863 | 863 | // calculate the top position based on field padding |
864 | - $top_pad = explode(' ', $field_pad); |
|
865 | - $top_pad = reset($top_pad); // the top padding is listed first |
|
866 | - $pad_unit = preg_replace('/[0-9]+/', '', $top_pad); //px, em, rem... |
|
867 | - $top_margin = (int) str_replace($pad_unit, '', $top_pad) / 2; |
|
864 | + $top_pad = explode( ' ', $field_pad ); |
|
865 | + $top_pad = reset( $top_pad ); // the top padding is listed first |
|
866 | + $pad_unit = preg_replace( '/[0-9]+/', '', $top_pad ); //px, em, rem... |
|
867 | + $top_margin = (int) str_replace( $pad_unit, '', $top_pad ) / 2; |
|
868 | 868 | ?> |
869 | 869 | top:<?php echo esc_html( $top_margin . $pad_unit . $important ) ?>; |
870 | 870 | } |
@@ -1,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if ( ! isset($saving) ) { |
3 | - header( 'Content-type: text/css' ); |
|
3 | + header( 'Content-type: text/css' ); |
|
4 | 4 | |
5 | - if ( isset($css) && $css ) { |
|
6 | - echo $css; |
|
7 | - die(); |
|
8 | - } |
|
5 | + if ( isset($css) && $css ) { |
|
6 | + echo $css; |
|
7 | + die(); |
|
8 | + } |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | if ( ! isset($frm_style) ) { |
12 | - $frm_style = new FrmStyle(); |
|
12 | + $frm_style = new FrmStyle(); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | $styles = $frm_style->get_all(); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | <?php |
188 | 188 | foreach ( $styles as $style ) { |
189 | 189 | include( dirname( __FILE__ ) . '/_single_theme.css.php' ); |
190 | - unset($style); |
|
190 | + unset($style); |
|
191 | 191 | } |
192 | 192 | ?> |
193 | 193 |
@@ -1,19 +1,19 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! isset($saving) ) { |
|
2 | +if ( ! isset( $saving ) ) { |
|
3 | 3 | header( 'Content-type: text/css' ); |
4 | 4 | |
5 | - if ( isset($css) && $css ) { |
|
5 | + if ( isset( $css ) && $css ) { |
|
6 | 6 | echo $css; |
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | } |
10 | 10 | |
11 | -if ( ! isset($frm_style) ) { |
|
11 | +if ( ! isset( $frm_style ) ) { |
|
12 | 12 | $frm_style = new FrmStyle(); |
13 | 13 | } |
14 | 14 | |
15 | 15 | $styles = $frm_style->get_all(); |
16 | -$default_style = $frm_style->get_default_style($styles); |
|
16 | +$default_style = $frm_style->get_default_style( $styles ); |
|
17 | 17 | $defaults = $default_style->post_content; |
18 | 18 | ?> |
19 | 19 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | <?php |
195 | 195 | foreach ( $styles as $style ) { |
196 | 196 | include( dirname( __FILE__ ) . '/_single_theme.css.php' ); |
197 | - unset($style); |
|
197 | + unset( $style ); |
|
198 | 198 | } |
199 | 199 | ?> |
200 | 200 | |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | overflow:hidden!important; |
620 | 620 | } |
621 | 621 | |
622 | -<?php include( dirname(__FILE__) . '/frm_grids.css' ); ?> |
|
622 | +<?php include( dirname( __FILE__ ) . '/frm_grids.css' ); ?> |
|
623 | 623 | |
624 | 624 | /* Left and right label styling for non-Formidable styling - very basic, not responsive */ |
625 | 625 | .frm_form_field.frm_left_container label.frm_primary_label{ |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $display = apply_filters('frm_display_field_options', array( |
4 | - 'type' => $field['type'], 'field_data' => $field, |
|
5 | - 'required' => true, 'unique' => false, 'read_only' => false, |
|
6 | - 'description' => true, 'options' => true, 'label_position' => true, |
|
7 | - 'invalid' => false, 'size' => false, 'clear_on_focus' => false, |
|
8 | - 'default_blank' => true, 'css' => true, 'conf_field' => false, |
|
4 | + 'type' => $field['type'], 'field_data' => $field, |
|
5 | + 'required' => true, 'unique' => false, 'read_only' => false, |
|
6 | + 'description' => true, 'options' => true, 'label_position' => true, |
|
7 | + 'invalid' => false, 'size' => false, 'clear_on_focus' => false, |
|
8 | + 'default_blank' => true, 'css' => true, 'conf_field' => false, |
|
9 | 9 | 'max' => true, 'captcha_size' => false, |
10 | 10 | )); |
11 | 11 | |
@@ -25,19 +25,19 @@ discard block |
||
25 | 25 | $frm_settings = FrmAppHelper::get_settings(); |
26 | 26 | |
27 | 27 | if ( ! isset( $frm_all_field_selection ) ) { |
28 | - if ( isset($frm_field_selection) && isset($pro_field_selection) ) { |
|
29 | - $frm_all_field_selection = array_merge($frm_field_selection, $pro_field_selection); |
|
30 | - } else { |
|
28 | + if ( isset($frm_field_selection) && isset($pro_field_selection) ) { |
|
29 | + $frm_all_field_selection = array_merge($frm_field_selection, $pro_field_selection); |
|
30 | + } else { |
|
31 | 31 | $pro_field_selection = FrmField::pro_field_selection(); |
32 | 32 | $frm_all_field_selection = array_merge( FrmField::field_selection(), $pro_field_selection ); |
33 | - } |
|
33 | + } |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | $disabled_fields = FrmAppHelper::pro_is_installed() ? array() : $pro_field_selection; |
37 | 37 | |
38 | 38 | |
39 | 39 | if ( ! isset( $ajax ) ) { |
40 | - $li_classes .= ' ui-state-default widgets-holder-wrap'; ?> |
|
40 | + $li_classes .= ' ui-state-default widgets-holder-wrap'; ?> |
|
41 | 41 | <li id="frm_field_id_<?php echo esc_attr( $field['id'] ); ?>" class="<?php echo esc_attr( $li_classes ) ?>" data-fid="<?php echo esc_attr( $field['id'] ) ?>" data-formid="<?php echo ( 'divider' == $field['type'] ) ? esc_attr( $field['form_select'] ) : esc_attr( $field['form_id'] ); ?>"> |
42 | 42 | <?php |
43 | 43 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | </span> |
60 | 60 | <?php } |
61 | 61 | |
62 | - ?> |
|
62 | + ?> |
|
63 | 63 | <label class="<?php echo ( $field['type'] == 'end_divider' ) ? '' : 'frm_ipe_field_label'; ?> frm_primary_label <?php echo ( $field['type'] == 'break' ) ? 'button': ''; ?>" id="field_label_<?php echo esc_attr( $field['id'] ); ?>"><?php echo ( $field['name'] == '' ) ? __( '(no label)', 'formidable' ) : force_balance_tags( $field['name'] ); ?></label> |
64 | 64 | |
65 | 65 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | if ( in_array( $field['type'], array( 'select', 'radio', 'checkbox' ) ) ) { ?> |
106 | 106 | <div class="frm-show-click frm_small_top_margin"><?php |
107 | 107 | |
108 | - if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
108 | + if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
109 | 109 | echo '<p class="howto">' . FrmFieldsHelper::get_term_link( $field['taxonomy'] ) . '</p>'; |
110 | 110 | } else if ( ! isset( $field['post_field'] ) || ! in_array( $field['post_field'], array( 'post_category' ) ) ) { |
111 | 111 | ?> |
@@ -117,16 +117,16 @@ discard block |
||
117 | 117 | <a href="javascript:void(0);" id="other_button_<?php echo esc_attr( $field['id'] ); ?>" data-opttype="other" data-ftype="<?php echo esc_attr( $field['type'] ) ?>" class="button frm_cb_button frm_add_opt<?php echo ( in_array( $field['type'], array( 'radio', 'select' ) ) && $field['other'] == true ? ' frm_hidden' : '' ); ?>"><?php _e( 'Add "Other"', 'formidable' ) ?></a> |
118 | 118 | <input type="hidden" value="<?php echo esc_attr( $field['other'] ); ?>" id="other_input_<?php echo esc_attr( $field['id'] ); ?>" name="field_options[other_<?php echo esc_attr( $field['id'] ); ?>]"> |
119 | 119 | <?php |
120 | - } |
|
120 | + } |
|
121 | 121 | |
122 | - if ( ! isset($field['post_field']) || $field['post_field'] != 'post_category' ) { ?> |
|
122 | + if ( ! isset($field['post_field']) || $field['post_field'] != 'post_category' ) { ?> |
|
123 | 123 | <a href="<?php echo esc_url( admin_url( 'admin-ajax.php?action=frm_import_choices&field_id=' . $field['id'] . '&TB_iframe=1' ) ) ?>" title="<?php echo esc_attr( FrmAppHelper::truncate( strip_tags( str_replace( '"', '"', $field['name'] ) ), 20 ) . ' ' . __( 'Field Choices', 'formidable' ) ); ?>" class="thickbox frm_orange"> |
124 | 124 | <?php _e( 'Bulk Edit Options', 'formidable' ) ?> |
125 | 125 | </a> |
126 | 126 | <?php } ?> |
127 | 127 | </div> |
128 | 128 | <?php |
129 | - } |
|
129 | + } |
|
130 | 130 | ?> |
131 | 131 | </div> |
132 | 132 | <?php |
@@ -158,28 +158,28 @@ discard block |
||
158 | 158 | if ( $display['required'] ) { ?> |
159 | 159 | <label for="frm_req_field_<?php echo esc_attr( $field['id'] ) ?>" class="frm_inline_label"><input type="checkbox" id="frm_req_field_<?php echo esc_attr( $field['id'] ) ?>" class="frm_req_field" name="field_options[required_<?php echo esc_attr( $field['id'] ) ?>]" value="1" <?php echo $field['required'] ? 'checked="checked"': ''; ?> /> <?php _e( 'Required', 'formidable' ) ?></label> |
160 | 160 | <?php |
161 | - } |
|
161 | + } |
|
162 | 162 | |
163 | 163 | if ( $display['unique'] ) { |
164 | - if ( ! isset( $field['unique'] ) ) { |
|
165 | - $field['unique'] = false; |
|
166 | - } |
|
167 | - ?> |
|
164 | + if ( ! isset( $field['unique'] ) ) { |
|
165 | + $field['unique'] = false; |
|
166 | + } |
|
167 | + ?> |
|
168 | 168 | <label for="frm_uniq_field_<?php echo esc_attr( $field['id'] ) ?>" class="frm_inline_label frm_help" title="<?php esc_attr_e( 'Unique: Do not allow the same response multiple times. For example, if one user enters \'Joe\', then no one else will be allowed to enter the same name.', 'formidable' ) ?>"><input type="checkbox" name="field_options[unique_<?php echo esc_attr( $field['id'] ) ?>]" id="frm_uniq_field_<?php echo esc_attr( $field['id'] ) ?>" value="1" <?php checked( $field['unique'], 1 ); ?> class="frm_mark_unique" /> <?php _e( 'Unique', 'formidable' ) ?></label> |
169 | 169 | <?php |
170 | - } |
|
170 | + } |
|
171 | 171 | |
172 | 172 | if ( $display['read_only'] ) { |
173 | - if ( ! isset( $field['read_only'] ) ) { |
|
174 | - $field['read_only'] = false; |
|
173 | + if ( ! isset( $field['read_only'] ) ) { |
|
174 | + $field['read_only'] = false; |
|
175 | 175 | } |
176 | - ?> |
|
176 | + ?> |
|
177 | 177 | <label for="frm_read_only_field_<?php echo esc_attr( $field['id'] ) ?>" class="frm_inline_label frm_help" title="<?php esc_attr_e( 'Read Only: Show this field but do not allow the field value to be edited from the front-end.', 'formidable' ) ?>" ><input type="checkbox" id="frm_read_only_field_<?php echo esc_attr( $field['id'] ) ?>" name="field_options[read_only_<?php echo esc_attr( $field['id'] ) ?>]" value="1" <?php echo $field['read_only'] ? ' checked="checked"' : ''; ?>/> <?php _e( 'Read Only', 'formidable' ) ?></label> |
178 | 178 | <?php } |
179 | 179 | |
180 | - do_action('frm_field_options_form_top', $field, $display, $values); |
|
180 | + do_action('frm_field_options_form_top', $field, $display, $values); |
|
181 | 181 | |
182 | - ?> |
|
182 | + ?> |
|
183 | 183 | <?php |
184 | 184 | if ( $display['required'] ) { ?> |
185 | 185 | <div class="frm_required_details<?php echo esc_attr( $field['id'] . ( $field['required'] ? '' : ' frm_hidden' ) ); ?>"> |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | do_action( 'frm_' . $field['type'] . '_field_options_form', $field, $display, $values ); |
266 | 266 | do_action( 'frm_field_options_form', $field, $display, $values ); |
267 | 267 | |
268 | - if ( $display['required'] || $display['invalid'] || $display['unique'] || $display['conf_field'] ) { ?> |
|
268 | + if ( $display['required'] || $display['invalid'] || $display['unique'] || $display['conf_field'] ) { ?> |
|
269 | 269 | <tr class="frm_validation_msg <?php echo ($display['invalid'] || $field['required'] || FrmField::is_option_true( $field, 'unique' ) || FrmField::is_option_true( $field, 'conf_field' ) ) ? '' : 'frm_hidden'; ?>"> |
270 | 270 | <td colspan="2"> |
271 | 271 | <div class="menu-settings"> |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | <input type="text" name="field_options[blank_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['blank'] ); ?>" /> |
279 | 279 | </p> |
280 | 280 | <?php |
281 | - } |
|
281 | + } |
|
282 | 282 | |
283 | 283 | if ( $display['invalid'] ) { ?> |
284 | 284 | <p><label><?php _e( 'Invalid Format', 'formidable' ) ?></label> |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | <input type="text" name="field_options[unique_msg_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['unique_msg'] ); ?>" /> |
294 | 294 | </p> |
295 | 295 | <?php |
296 | - } |
|
296 | + } |
|
297 | 297 | |
298 | 298 | if ( $display['conf_field'] ) { ?> |
299 | 299 | <p class="frm_conf_details<?php echo esc_attr( $field['id'] . ( $field['conf_field'] ? '' : ' frm_hidden' ) ); ?>"> |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | <input type="text" name="field_options[conf_msg_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['conf_msg'] ); ?>" /> |
302 | 302 | </p> |
303 | 303 | <?php |
304 | - } ?> |
|
304 | + } ?> |
|
305 | 305 | </div> |
306 | 306 | </div> |
307 | 307 | </td> |
@@ -1,22 +1,22 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$display = apply_filters('frm_display_field_options', array( |
|
3 | +$display = apply_filters( 'frm_display_field_options', array( |
|
4 | 4 | 'type' => $field['type'], 'field_data' => $field, |
5 | 5 | 'required' => true, 'unique' => false, 'read_only' => false, |
6 | 6 | 'description' => true, 'options' => true, 'label_position' => true, |
7 | 7 | 'invalid' => false, 'size' => false, 'clear_on_focus' => false, |
8 | 8 | 'default_blank' => true, 'css' => true, 'conf_field' => false, |
9 | 9 | 'max' => true, 'captcha_size' => false, |
10 | -)); |
|
10 | +) ); |
|
11 | 11 | |
12 | 12 | $li_classes = 'form-field edit_form_item frm_field_box frm_top_container frm_not_divider edit_field_type_' . $display['type']; |
13 | -$li_classes = apply_filters('frm_build_field_class', $li_classes, $field ); |
|
13 | +$li_classes = apply_filters( 'frm_build_field_class', $li_classes, $field ); |
|
14 | 14 | |
15 | 15 | if ( isset( $values ) && isset( $values['ajax_load'] ) && $values['ajax_load'] && isset( $count ) && $count > 10 && ! in_array( $field['type'], array( 'divider', 'end_divider' ) ) ) { |
16 | 16 | ?> |
17 | 17 | <li id="frm_field_id_<?php echo esc_attr( $field['id'] ); ?>" class="<?php echo esc_attr( $li_classes ) ?> frm_field_loading" data-fid="<?php echo esc_attr( $field['id'] ) ?>" data-formid="<?php echo esc_attr( 'divider' == $field['type'] ? $field['form_select'] : $field['form_id'] ); ?>" data-ftype="<?php echo esc_attr( $display['type'] ) ?>"> |
18 | 18 | <img src="<?php echo FrmAppHelper::plugin_url() ?>/images/ajax_loader.gif" alt="<?php esc_attr_e( 'Loading', 'formidable' ) ?>" /> |
19 | -<span class="frm_hidden_fdata frm_hidden"><?php echo htmlspecialchars(json_encode($field)) ?></span> |
|
19 | +<span class="frm_hidden_fdata frm_hidden"><?php echo htmlspecialchars( json_encode( $field ) ) ?></span> |
|
20 | 20 | </li> |
21 | 21 | <?php |
22 | 22 | return; |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | $frm_settings = FrmAppHelper::get_settings(); |
26 | 26 | |
27 | 27 | if ( ! isset( $frm_all_field_selection ) ) { |
28 | - if ( isset($frm_field_selection) && isset($pro_field_selection) ) { |
|
29 | - $frm_all_field_selection = array_merge($frm_field_selection, $pro_field_selection); |
|
28 | + if ( isset( $frm_field_selection ) && isset( $pro_field_selection ) ) { |
|
29 | + $frm_all_field_selection = array_merge( $frm_field_selection, $pro_field_selection ); |
|
30 | 30 | } else { |
31 | 31 | $pro_field_selection = FrmField::pro_field_selection(); |
32 | 32 | $frm_all_field_selection = array_merge( FrmField::field_selection(), $pro_field_selection ); |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | <a href="javascript:void(0);" class="frm_bstooltip alignright frm-show-hover frm-move frm-hover-icon frm_icon_font frm_move_icon" title="<?php esc_attr_e( 'Move Field', 'formidable' ) ?>"> </a> |
52 | 52 | <a href="#" class="frm_bstooltip alignright frm-show-hover frm-hover-icon frm_icon_font frm_delete_icon frm_delete_field" title="<?php esc_attr_e( 'Delete Field', 'formidable' ) ?>"> </a> |
53 | 53 | <a href="#" class="frm_bstooltip alignright frm-show-hover frm-hover-icon frm_icon_font frm_duplicate_icon" title="<?php ( $field['type'] == 'divider' ) ? esc_attr_e( 'Duplicate Section', 'formidable' ) : esc_attr_e( 'Duplicate Field', 'formidable' ) ?>"> </a> |
54 | - <input type="hidden" name="frm_fields_submitted[]" value="<?php echo esc_attr($field['id']) ?>" /> |
|
55 | - <?php do_action('frm_extra_field_actions', $field['id']); ?> |
|
54 | + <input type="hidden" name="frm_fields_submitted[]" value="<?php echo esc_attr( $field['id'] ) ?>" /> |
|
55 | + <?php do_action( 'frm_extra_field_actions', $field['id'] ); ?> |
|
56 | 56 | <?php if ( $display['required'] ) { ?> |
57 | 57 | <span id="require_field_<?php echo esc_attr( $field['id'] ); ?>"> |
58 | 58 | <a href="javascript:void(0);" class="frm_req_field frm_action_icon frm_required_icon frm_icon_font alignleft frm_required<?php echo (int) $field['required'] ?>" id="req_field_<?php echo esc_attr( $field['id'] ); ?>" title="Click to Mark as <?php echo FrmField::is_required( $field ) ? 'not ' : ''; ?>Required"></a> |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | <?php } |
61 | 61 | |
62 | 62 | ?> |
63 | - <label class="<?php echo ( $field['type'] == 'end_divider' ) ? '' : 'frm_ipe_field_label'; ?> frm_primary_label <?php echo ( $field['type'] == 'break' ) ? 'button': ''; ?>" id="field_label_<?php echo esc_attr( $field['id'] ); ?>"><?php echo ( $field['name'] == '' ) ? __( '(no label)', 'formidable' ) : force_balance_tags( $field['name'] ); ?></label> |
|
63 | + <label class="<?php echo ( $field['type'] == 'end_divider' ) ? '' : 'frm_ipe_field_label'; ?> frm_primary_label <?php echo ( $field['type'] == 'break' ) ? 'button' : ''; ?>" id="field_label_<?php echo esc_attr( $field['id'] ); ?>"><?php echo ( $field['name'] == '' ) ? __( '(no label)', 'formidable' ) : force_balance_tags( $field['name'] ); ?></label> |
|
64 | 64 | |
65 | 65 | |
66 | 66 | <div id="field_<?php echo esc_attr( $field['id'] ) ?>_inner_container" class="frm_inner_field_container"> |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | </div> |
79 | 79 | <?php |
80 | 80 | if ( $display['description'] ) { ?> |
81 | - <div class="frm_ipe_field_desc description <?php echo ($field['description'] == '') ? 'frm-show-click' : '' ?>" id="field_description_<?php echo esc_attr( $field['id'] ); ?>"><?php echo ($field['description'] == '') ? __( '(Click to add description)', 'formidable' ) : force_balance_tags( $field['description'] ); ?></div> |
|
81 | + <div class="frm_ipe_field_desc description <?php echo ( $field['description'] == '' ) ? 'frm-show-click' : '' ?>" id="field_description_<?php echo esc_attr( $field['id'] ); ?>"><?php echo ( $field['description'] == '' ) ? __( '(Click to add description)', 'formidable' ) : force_balance_tags( $field['description'] ); ?></div> |
|
82 | 82 | <input type="hidden" name="field_options[description_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['description'] ); ?>" /> |
83 | 83 | |
84 | 84 | <?php } ?> |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | <div class="frm_form_fields"> |
91 | 91 | <input type="text" id="conf_field_<?php echo esc_attr( $field['field_key'] ) ?>" name="field_options[conf_input_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['conf_input'] ); ?>" class="dyn_default_value" /> |
92 | 92 | </div> |
93 | - <div id="conf_field_description_<?php echo esc_attr( $field['id'] ) ?>" class="frm_ipe_field_conf_desc description <?php echo ($field['conf_desc'] == '') ? 'frm-show-click' : '' ?>"><?php |
|
94 | - echo ($field['conf_desc'] == '') ? __( '(Click to add description)', 'formidable' ) : force_balance_tags($field['conf_desc']); ?></div> |
|
93 | + <div id="conf_field_description_<?php echo esc_attr( $field['id'] ) ?>" class="frm_ipe_field_conf_desc description <?php echo ( $field['conf_desc'] == '' ) ? 'frm-show-click' : '' ?>"><?php |
|
94 | + echo ( $field['conf_desc'] == '' ) ? __( '(Click to add description)', 'formidable' ) : force_balance_tags( $field['conf_desc'] ); ?></div> |
|
95 | 95 | <input type="hidden" name="field_options[conf_desc_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['conf_desc'] ); ?>" /> |
96 | 96 | </div> |
97 | 97 | <?php if ( $display['clear_on_focus'] ) { ?> |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | if ( in_array( $field['type'], array( 'select', 'radio', 'checkbox' ) ) ) { ?> |
107 | 107 | <div class="frm-show-click frm_small_top_margin"><?php |
108 | 108 | |
109 | - if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
109 | + if ( isset( $field['post_field'] ) && $field['post_field'] == 'post_category' ) { |
|
110 | 110 | echo '<p class="howto">' . FrmFieldsHelper::get_term_link( $field['taxonomy'] ) . '</p>'; |
111 | 111 | } else if ( ! isset( $field['post_field'] ) || ! in_array( $field['post_field'], array( 'post_category' ) ) ) { |
112 | 112 | ?> |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | <?php |
121 | 121 | } |
122 | 122 | |
123 | - if ( ! isset($field['post_field']) || $field['post_field'] != 'post_category' ) { ?> |
|
123 | + if ( ! isset( $field['post_field'] ) || $field['post_field'] != 'post_category' ) { ?> |
|
124 | 124 | <a href="<?php echo esc_url( admin_url( 'admin-ajax.php?action=frm_import_choices&field_id=' . $field['id'] . '&TB_iframe=1' ) ) ?>" title="<?php echo esc_attr( FrmAppHelper::truncate( strip_tags( str_replace( '"', '"', $field['name'] ) ), 20 ) . ' ' . __( 'Field Choices', 'formidable' ) ); ?>" class="thickbox frm_orange"> |
125 | 125 | <?php _e( 'Bulk Edit Options', 'formidable' ) ?> |
126 | 126 | </a> |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | <?php |
134 | 134 | } |
135 | 135 | |
136 | -do_action('frm_before_field_options', $field); |
|
136 | +do_action( 'frm_before_field_options', $field ); |
|
137 | 137 | |
138 | 138 | if ( $display['options'] ) { ?> |
139 | 139 | <div class="widget"> |
@@ -143,13 +143,13 @@ discard block |
||
143 | 143 | </div> |
144 | 144 | <div class="widget-inside"> |
145 | 145 | <table class="form-table frm_clear_none"> |
146 | - <?php $field_types = FrmFieldsHelper::get_field_types($field['type']); ?> |
|
146 | + <?php $field_types = FrmFieldsHelper::get_field_types( $field['type'] ); ?> |
|
147 | 147 | <tr><td class="frm_150_width"><label><?php _e( 'Field Type', 'formidable' ) ?></label></td> |
148 | 148 | <td> |
149 | - <select <?php if ( count($field_types) == 1 ) { ?>disabled="disabled"<?php } else { ?>name="field_options[type_<?php echo esc_attr( $field['id'] ) ?>]"<?php } ?>> |
|
149 | + <select <?php if ( count( $field_types ) == 1 ) { ?>disabled="disabled"<?php } else { ?>name="field_options[type_<?php echo esc_attr( $field['id'] ) ?>]"<?php } ?>> |
|
150 | 150 | <?php |
151 | 151 | foreach ( $field_types as $fkey => $ftype ) { ?> |
152 | - <option value="<?php echo esc_attr( $fkey ) ?>" <?php echo ( $fkey == $field['type'] ) ? ' selected="selected"' : ''; ?> <?php echo array_key_exists($fkey, $disabled_fields ) ? 'disabled="disabled"' : ''; ?>><?php echo is_array($ftype) ? $ftype['name'] : $ftype ?> </option> |
|
152 | + <option value="<?php echo esc_attr( $fkey ) ?>" <?php echo ( $fkey == $field['type'] ) ? ' selected="selected"' : ''; ?> <?php echo array_key_exists( $fkey, $disabled_fields ) ? 'disabled="disabled"' : ''; ?>><?php echo is_array( $ftype ) ? $ftype['name'] : $ftype ?> </option> |
|
153 | 153 | <?php |
154 | 154 | unset( $fkey, $ftype ); |
155 | 155 | } ?> |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | </label> |
185 | 185 | <?php } |
186 | 186 | |
187 | - do_action('frm_field_options_form_top', $field, $display, $values); |
|
187 | + do_action( 'frm_field_options_form_top', $field, $display, $values ); |
|
188 | 188 | |
189 | 189 | ?> |
190 | 190 | <?php |
@@ -221,13 +221,13 @@ discard block |
||
221 | 221 | if ( $display['label_position'] ) { ?> |
222 | 222 | <tr><td class="frm_150_width"><label><?php _e( 'Label Position', 'formidable' ) ?></label></td> |
223 | 223 | <td><select name="field_options[label_<?php echo esc_attr( $field['id'] ) ?>]"> |
224 | - <option value=""<?php selected($field['label'], ''); ?>><?php _e( 'Default', 'formidable' ) ?></option> |
|
225 | - <option value="top"<?php selected($field['label'], 'top'); ?>><?php _e( 'Top', 'formidable' ) ?></option> |
|
226 | - <option value="left"<?php selected($field['label'], 'left'); ?>><?php _e( 'Left', 'formidable' ) ?></option> |
|
227 | - <option value="right"<?php selected($field['label'], 'right'); ?>><?php _e( 'Right', 'formidable' ) ?></option> |
|
228 | - <option value="inline"<?php selected($field['label'], 'inline'); ?>><?php _e( 'Inline (left without a set width)', 'formidable' ) ?></option> |
|
229 | - <option value="none"<?php selected($field['label'], 'none'); ?>><?php _e( 'None', 'formidable' ) ?></option> |
|
230 | - <option value="hidden"<?php selected($field['label'], 'hidden'); ?>><?php _e( 'Hidden (but leave the space)', 'formidable' ) ?></option> |
|
224 | + <option value=""<?php selected( $field['label'], '' ); ?>><?php _e( 'Default', 'formidable' ) ?></option> |
|
225 | + <option value="top"<?php selected( $field['label'], 'top' ); ?>><?php _e( 'Top', 'formidable' ) ?></option> |
|
226 | + <option value="left"<?php selected( $field['label'], 'left' ); ?>><?php _e( 'Left', 'formidable' ) ?></option> |
|
227 | + <option value="right"<?php selected( $field['label'], 'right' ); ?>><?php _e( 'Right', 'formidable' ) ?></option> |
|
228 | + <option value="inline"<?php selected( $field['label'], 'inline' ); ?>><?php _e( 'Inline (left without a set width)', 'formidable' ) ?></option> |
|
229 | + <option value="none"<?php selected( $field['label'], 'none' ); ?>><?php _e( 'None', 'formidable' ) ?></option> |
|
230 | + <option value="hidden"<?php selected( $field['label'], 'hidden' ); ?>><?php _e( 'Hidden (but leave the space)', 'formidable' ) ?></option> |
|
231 | 231 | </select> |
232 | 232 | </td> |
233 | 233 | </tr> |
@@ -250,8 +250,8 @@ discard block |
||
250 | 250 | <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Set the size of the captcha field. The compact option is best if your form is in a small area.', 'formidable' ) ?>" ></span> |
251 | 251 | </td> |
252 | 252 | <td><select name="field_options[captcha_size_<?php echo esc_attr( $field['id'] ) ?>]"> |
253 | - <option value="normal"<?php selected($field['captcha_size'], 'normal'); ?>><?php _e( 'Normal', 'formidable' ) ?></option> |
|
254 | - <option value="compact"<?php selected($field['captcha_size'], 'compact'); ?>><?php _e( 'Compact', 'formidable' ) ?></option> |
|
253 | + <option value="normal"<?php selected( $field['captcha_size'], 'normal' ); ?>><?php _e( 'Normal', 'formidable' ) ?></option> |
|
254 | + <option value="compact"<?php selected( $field['captcha_size'], 'compact' ); ?>><?php _e( 'Compact', 'formidable' ) ?></option> |
|
255 | 255 | </select> |
256 | 256 | </td> |
257 | 257 | </tr> |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | do_action( 'frm_field_options_form', $field, $display, $values ); |
274 | 274 | |
275 | 275 | if ( $display['required'] || $display['invalid'] || $display['unique'] || $display['conf_field'] ) { ?> |
276 | - <tr class="frm_validation_msg <?php echo ($display['invalid'] || $field['required'] || FrmField::is_option_true( $field, 'unique' ) || FrmField::is_option_true( $field, 'conf_field' ) ) ? '' : 'frm_hidden'; ?>"> |
|
276 | + <tr class="frm_validation_msg <?php echo ( $display['invalid'] || $field['required'] || FrmField::is_option_true( $field, 'unique' ) || FrmField::is_option_true( $field, 'conf_field' ) ) ? '' : 'frm_hidden'; ?>"> |
|
277 | 277 | <td colspan="2"> |
278 | 278 | <div class="menu-settings"> |
279 | 279 | <h3 class="frm_no_bg"><?php _e( 'Validation', 'formidable' ) ?></h3> |
@@ -337,4 +337,4 @@ discard block |
||
337 | 337 | <?php |
338 | 338 | } |
339 | 339 | |
340 | -unset($display); |
|
340 | +unset( $display ); |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | public $id = 0; // the id of the post |
5 | 5 | |
6 | 6 | /** |
7 | - * @param int|string $id The id of the stylsheet or 'default' |
|
7 | + * @param integer $id The id of the stylsheet or 'default' |
|
8 | 8 | */ |
9 | 9 | public function __construct( $id = 0 ) { |
10 | 10 | $this->id = $id; |
@@ -120,6 +120,9 @@ discard block |
||
120 | 120 | set_transient('frmpro_css', $css); |
121 | 121 | } |
122 | 122 | |
123 | + /** |
|
124 | + * @param string $filename |
|
125 | + */ |
|
123 | 126 | private function get_css_content( $filename ) { |
124 | 127 | $css = '/* ' . __( 'WARNING: Any changes made to this file will be lost when your Formidable settings are updated', 'formidable' ) . ' */' . "\n"; |
125 | 128 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | class FrmStyle { |
3 | - public $number = false; // Unique ID number of the current instance. |
|
3 | + public $number = false; // Unique ID number of the current instance. |
|
4 | 4 | public $id = 0; // the id of the post |
5 | 5 | |
6 | 6 | /** |
@@ -13,9 +13,9 @@ discard block |
||
13 | 13 | public function get_new() { |
14 | 14 | $this->id = 0; |
15 | 15 | |
16 | - $max_slug_value = pow(36, 6); |
|
16 | + $max_slug_value = pow( 36, 6 ); |
|
17 | 17 | $min_slug_value = 37; // we want to have at least 2 characters in the slug |
18 | - $key = base_convert( rand($min_slug_value, $max_slug_value), 10, 36 ); |
|
18 | + $key = base_convert( rand( $min_slug_value, $max_slug_value ), 10, 36 ); |
|
19 | 19 | |
20 | 20 | $style = array( |
21 | 21 | 'post_type' => FrmStylesController::$post_type, |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public function update( $id = 'default' ) { |
42 | 42 | $all_instances = $this->get_all(); |
43 | 43 | |
44 | - if ( empty($id) ) { |
|
44 | + if ( empty( $id ) ) { |
|
45 | 45 | $new_style = (array) $this->get_new(); |
46 | 46 | $all_instances[] = $new_style; |
47 | 47 | } |
@@ -49,15 +49,15 @@ discard block |
||
49 | 49 | $action_ids = array(); |
50 | 50 | |
51 | 51 | foreach ( $all_instances as $number => $new_instance ) { |
52 | - $new_instance = stripslashes_deep( (array) $new_instance); |
|
52 | + $new_instance = stripslashes_deep( (array) $new_instance ); |
|
53 | 53 | $this->id = $new_instance['ID']; |
54 | - if ( $id != $this->id || ! $_POST || ! isset($_POST['frm_style_setting']) ) { |
|
55 | - $all_instances[ $number ] = $new_instance; |
|
54 | + if ( $id != $this->id || ! $_POST || ! isset( $_POST['frm_style_setting'] ) ) { |
|
55 | + $all_instances[$number] = $new_instance; |
|
56 | 56 | |
57 | - if ( $new_instance['menu_order'] && $_POST && empty($_POST['prev_menu_order']) && isset($_POST['frm_style_setting']['menu_order']) ) { |
|
57 | + if ( $new_instance['menu_order'] && $_POST && empty( $_POST['prev_menu_order'] ) && isset( $_POST['frm_style_setting']['menu_order'] ) ) { |
|
58 | 58 | // this style was set to default, so remove default setting on previous default style |
59 | 59 | $new_instance['menu_order'] = 0; |
60 | - $action_ids[] = $this->save($new_instance); |
|
60 | + $action_ids[] = $this->save( $new_instance ); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | // don't continue if not saving this style |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | $new_instance['post_title'] = sanitize_text_field( $_POST['frm_style_setting']['post_title'] ); |
68 | 68 | $new_instance['post_content'] = $_POST['frm_style_setting']['post_content']; |
69 | 69 | $new_instance['post_type'] = FrmStylesController::$post_type; |
70 | - $new_instance['post_status'] = 'publish'; |
|
70 | + $new_instance['post_status'] = 'publish'; |
|
71 | 71 | $new_instance['menu_order'] = isset( $_POST['frm_style_setting']['menu_order'] ) ? absint( $_POST['frm_style_setting']['menu_order'] ) : 0; |
72 | 72 | |
73 | - if ( empty($id) ) { |
|
73 | + if ( empty( $id ) ) { |
|
74 | 74 | $new_instance['post_name'] = $new_instance['post_title']; |
75 | 75 | } |
76 | 76 | |
@@ -79,17 +79,17 @@ discard block |
||
79 | 79 | foreach ( $default_settings as $setting => $default ) { |
80 | 80 | if ( strpos( $setting, 'color' ) !== false || in_array( $setting, array( 'error_bg', 'error_border', 'error_text' ) ) ) { |
81 | 81 | //if is a color |
82 | - $new_instance['post_content'][ $setting ] = str_replace( '#', '', $new_instance['post_content'][ $setting ] ); |
|
83 | - } else if ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ) ) && ! isset( $new_instance['post_content'][ $setting ] ) ) { |
|
84 | - $new_instance['post_content'][ $setting ] = 0; |
|
82 | + $new_instance['post_content'][$setting] = str_replace( '#', '', $new_instance['post_content'][$setting] ); |
|
83 | + } else if ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ) ) && ! isset( $new_instance['post_content'][$setting] ) ) { |
|
84 | + $new_instance['post_content'][$setting] = 0; |
|
85 | 85 | } else if ( $setting == 'font' ) { |
86 | - $new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] ); |
|
86 | + $new_instance['post_content'][$setting] = $this->force_balanced_quotation( $new_instance['post_content'][$setting] ); |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
90 | - $all_instances[ $number ] = $new_instance; |
|
90 | + $all_instances[$number] = $new_instance; |
|
91 | 91 | |
92 | - $action_ids[] = $this->save($new_instance); |
|
92 | + $action_ids[] = $this->save( $new_instance ); |
|
93 | 93 | |
94 | 94 | } |
95 | 95 | |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function save_settings() { |
105 | 105 | $filename = FrmAppHelper::plugin_path() . '/css/custom_theme.css.php'; |
106 | - update_option( 'frm_last_style_update', date('njGi') ); |
|
106 | + update_option( 'frm_last_style_update', date( 'njGi' ) ); |
|
107 | 107 | |
108 | - if ( ! is_file($filename) ) { |
|
108 | + if ( ! is_file( $filename ) ) { |
|
109 | 109 | return; |
110 | 110 | } |
111 | 111 | |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | $create_file = new FrmCreateFile( array( 'folder_name' => 'formidable/css', 'file_name' => 'formidablepro.css' ) ); |
115 | 115 | $create_file->create_file( $css ); |
116 | 116 | |
117 | - update_option('frmpro_css', $css); |
|
117 | + update_option( 'frmpro_css', $css ); |
|
118 | 118 | |
119 | 119 | $this->clear_cache(); |
120 | 120 | |
121 | - set_transient('frmpro_css', $css); |
|
121 | + set_transient( 'frmpro_css', $css ); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | private function get_css_content( $filename ) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | } |
151 | 151 | |
152 | 152 | public function destroy( $id ) { |
153 | - return wp_delete_post($id); |
|
153 | + return wp_delete_post( $id ); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | public function get_one() { |
@@ -164,19 +164,19 @@ discard block |
||
164 | 164 | return $style; |
165 | 165 | } |
166 | 166 | |
167 | - $style = get_post($this->id); |
|
167 | + $style = get_post( $this->id ); |
|
168 | 168 | |
169 | 169 | if ( ! $style ) { |
170 | 170 | return $style; |
171 | 171 | } |
172 | 172 | |
173 | - $style->post_content = FrmAppHelper::maybe_json_decode($style->post_content); |
|
173 | + $style->post_content = FrmAppHelper::maybe_json_decode( $style->post_content ); |
|
174 | 174 | |
175 | 175 | $default_values = $this->get_defaults(); |
176 | 176 | |
177 | 177 | // fill default values |
178 | - $style->post_content = $this->override_defaults($style->post_content); |
|
179 | - $style->post_content = wp_parse_args( $style->post_content, $default_values); |
|
178 | + $style->post_content = $this->override_defaults( $style->post_content ); |
|
179 | + $style->post_content = wp_parse_args( $style->post_content, $default_values ); |
|
180 | 180 | |
181 | 181 | return $style; |
182 | 182 | } |
@@ -190,21 +190,21 @@ discard block |
||
190 | 190 | 'order' => $order, |
191 | 191 | ); |
192 | 192 | |
193 | - $temp_styles = FrmAppHelper::check_cache(serialize($post_atts), 'frm_styles', $post_atts, 'get_posts'); |
|
193 | + $temp_styles = FrmAppHelper::check_cache( serialize( $post_atts ), 'frm_styles', $post_atts, 'get_posts' ); |
|
194 | 194 | |
195 | - if ( empty($temp_styles) ) { |
|
195 | + if ( empty( $temp_styles ) ) { |
|
196 | 196 | global $wpdb; |
197 | 197 | // make sure there wasn't a conflict with the query |
198 | 198 | $query = $wpdb->prepare( 'SELECT * FROM ' . $wpdb->posts . ' WHERE post_type=%s AND post_status=%s ORDER BY post_title ASC LIMIT 99', FrmStylesController::$post_type, 'publish' ); |
199 | - $temp_styles = FrmAppHelper::check_cache('frm_backup_style_check', 'frm_styles', $query, 'get_results'); |
|
199 | + $temp_styles = FrmAppHelper::check_cache( 'frm_backup_style_check', 'frm_styles', $query, 'get_results' ); |
|
200 | 200 | |
201 | - if ( empty($temp_styles) ) { |
|
201 | + if ( empty( $temp_styles ) ) { |
|
202 | 202 | // create a new style if there are none |
203 | 203 | $new = $this->get_new(); |
204 | 204 | $new->post_title = $new->post_name = __( 'Formidable Style', 'formidable' ); |
205 | 205 | $new->menu_order = 1; |
206 | - $new = $this->save( (array) $new); |
|
207 | - $this->update('default'); |
|
206 | + $new = $this->save( (array) $new ); |
|
207 | + $this->update( 'default' ); |
|
208 | 208 | |
209 | 209 | $post_atts['include'] = $new; |
210 | 210 | |
@@ -228,25 +228,25 @@ discard block |
||
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
231 | - $style->post_content = FrmAppHelper::maybe_json_decode($style->post_content); |
|
231 | + $style->post_content = FrmAppHelper::maybe_json_decode( $style->post_content ); |
|
232 | 232 | |
233 | 233 | // fill default values |
234 | - $style->post_content = $this->override_defaults($style->post_content); |
|
235 | - $style->post_content = wp_parse_args( $style->post_content, $default_values); |
|
234 | + $style->post_content = $this->override_defaults( $style->post_content ); |
|
235 | + $style->post_content = wp_parse_args( $style->post_content, $default_values ); |
|
236 | 236 | |
237 | - $styles[ $style->ID ] = $style; |
|
237 | + $styles[$style->ID] = $style; |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | if ( ! $default_style ) { |
241 | - $default_style = reset($styles); |
|
242 | - $styles[ $default_style->ID ]->menu_order = 1; |
|
241 | + $default_style = reset( $styles ); |
|
242 | + $styles[$default_style->ID]->menu_order = 1; |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | return $styles; |
246 | 246 | } |
247 | 247 | |
248 | 248 | public function get_default_style( $styles = null ) { |
249 | - if ( ! isset($styles) ) { |
|
249 | + if ( ! isset( $styles ) ) { |
|
250 | 250 | $styles = $this->get_all( 'menu_order', 'DESC', 1 ); |
251 | 251 | } |
252 | 252 | |
@@ -258,24 +258,24 @@ discard block |
||
258 | 258 | } |
259 | 259 | |
260 | 260 | public function override_defaults( $settings ) { |
261 | - if ( ! is_array($settings) ) { |
|
261 | + if ( ! is_array( $settings ) ) { |
|
262 | 262 | return $settings; |
263 | 263 | } |
264 | 264 | |
265 | - $settings['line_height'] = ( ! isset($settings['field_height']) || $settings['field_height'] == '' || $settings['field_height'] == 'auto') ? 'normal' : $settings['field_height']; |
|
265 | + $settings['line_height'] = ( ! isset( $settings['field_height'] ) || $settings['field_height'] == '' || $settings['field_height'] == 'auto' ) ? 'normal' : $settings['field_height']; |
|
266 | 266 | |
267 | - if ( ! isset($settings['form_desc_size']) && isset($settings['description_font_size']) ) { |
|
267 | + if ( ! isset( $settings['form_desc_size'] ) && isset( $settings['description_font_size'] ) ) { |
|
268 | 268 | $settings['form_desc_size'] = $settings['description_font_size']; |
269 | 269 | $settings['form_desc_color'] = $settings['description_color']; |
270 | 270 | $settings['title_color'] = $settings['label_color']; |
271 | 271 | } |
272 | 272 | |
273 | - if ( ! isset($settings['section_color']) && isset($settings['label_color']) ) { |
|
273 | + if ( ! isset( $settings['section_color'] ) && isset( $settings['label_color'] ) ) { |
|
274 | 274 | $settings['section_color'] = $settings['label_color']; |
275 | 275 | $settings['section_border_color'] = $settings['border_color']; |
276 | 276 | } |
277 | 277 | |
278 | - if ( ! isset($settings['submit_hover_bg_color']) && isset($settings['submit_bg_color']) ) { |
|
278 | + if ( ! isset( $settings['submit_hover_bg_color'] ) && isset( $settings['submit_bg_color'] ) ) { |
|
279 | 279 | $settings['submit_hover_bg_color'] = $settings['submit_bg_color']; |
280 | 280 | $settings['submit_hover_color'] = $settings['submit_text_color']; |
281 | 281 | $settings['submit_hover_border_color'] = $settings['submit_border_color']; |
@@ -1,52 +1,52 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | class FrmStyle { |
3 | - public $number = false; // Unique ID number of the current instance. |
|
3 | + public $number = false; // Unique ID number of the current instance. |
|
4 | 4 | public $id = 0; // the id of the post |
5 | 5 | |
6 | 6 | /** |
7 | 7 | * @param int|string $id The id of the stylsheet or 'default' |
8 | 8 | */ |
9 | 9 | public function __construct( $id = 0 ) { |
10 | - $this->id = $id; |
|
11 | - } |
|
10 | + $this->id = $id; |
|
11 | + } |
|
12 | 12 | |
13 | - public function get_new() { |
|
13 | + public function get_new() { |
|
14 | 14 | $this->id = 0; |
15 | 15 | |
16 | - $max_slug_value = pow(36, 6); |
|
17 | - $min_slug_value = 37; // we want to have at least 2 characters in the slug |
|
18 | - $key = base_convert( rand($min_slug_value, $max_slug_value), 10, 36 ); |
|
19 | - |
|
20 | - $style = array( |
|
21 | - 'post_type' => FrmStylesController::$post_type, |
|
22 | - 'ID' => '', |
|
23 | - 'post_title' => __( 'New Style', 'formidable' ), |
|
24 | - 'post_name' => $key, |
|
25 | - 'post_content' => $this->get_defaults(), |
|
26 | - 'menu_order' => '', |
|
27 | - 'post_status' => 'publish', |
|
28 | - ); |
|
16 | + $max_slug_value = pow(36, 6); |
|
17 | + $min_slug_value = 37; // we want to have at least 2 characters in the slug |
|
18 | + $key = base_convert( rand($min_slug_value, $max_slug_value), 10, 36 ); |
|
19 | + |
|
20 | + $style = array( |
|
21 | + 'post_type' => FrmStylesController::$post_type, |
|
22 | + 'ID' => '', |
|
23 | + 'post_title' => __( 'New Style', 'formidable' ), |
|
24 | + 'post_name' => $key, |
|
25 | + 'post_content' => $this->get_defaults(), |
|
26 | + 'menu_order' => '', |
|
27 | + 'post_status' => 'publish', |
|
28 | + ); |
|
29 | 29 | |
30 | - return (object) $style; |
|
31 | - } |
|
30 | + return (object) $style; |
|
31 | + } |
|
32 | 32 | |
33 | 33 | public function save( $settings ) { |
34 | 34 | return FrmAppHelper::save_settings( $settings, 'frm_styles' ); |
35 | - } |
|
35 | + } |
|
36 | 36 | |
37 | 37 | public function duplicate( $id ) { |
38 | - // duplicating is a pro feature |
|
39 | - } |
|
38 | + // duplicating is a pro feature |
|
39 | + } |
|
40 | 40 | |
41 | - public function update( $id = 'default' ) { |
|
41 | + public function update( $id = 'default' ) { |
|
42 | 42 | $all_instances = $this->get_all(); |
43 | 43 | |
44 | 44 | if ( empty($id) ) { |
45 | - $new_style = (array) $this->get_new(); |
|
46 | - $all_instances[] = $new_style; |
|
45 | + $new_style = (array) $this->get_new(); |
|
46 | + $all_instances[] = $new_style; |
|
47 | 47 | } |
48 | 48 | |
49 | - $action_ids = array(); |
|
49 | + $action_ids = array(); |
|
50 | 50 | |
51 | 51 | foreach ( $all_instances as $number => $new_instance ) { |
52 | 52 | $new_instance = stripslashes_deep( (array) $new_instance); |
@@ -54,42 +54,42 @@ discard block |
||
54 | 54 | if ( $id != $this->id || ! $_POST || ! isset($_POST['frm_style_setting']) ) { |
55 | 55 | $all_instances[ $number ] = $new_instance; |
56 | 56 | |
57 | - if ( $new_instance['menu_order'] && $_POST && empty($_POST['prev_menu_order']) && isset($_POST['frm_style_setting']['menu_order']) ) { |
|
58 | - // this style was set to default, so remove default setting on previous default style |
|
59 | - $new_instance['menu_order'] = 0; |
|
60 | - $action_ids[] = $this->save($new_instance); |
|
61 | - } |
|
57 | + if ( $new_instance['menu_order'] && $_POST && empty($_POST['prev_menu_order']) && isset($_POST['frm_style_setting']['menu_order']) ) { |
|
58 | + // this style was set to default, so remove default setting on previous default style |
|
59 | + $new_instance['menu_order'] = 0; |
|
60 | + $action_ids[] = $this->save($new_instance); |
|
61 | + } |
|
62 | 62 | |
63 | - // don't continue if not saving this style |
|
64 | - continue; |
|
63 | + // don't continue if not saving this style |
|
64 | + continue; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | $new_instance['post_title'] = sanitize_text_field( $_POST['frm_style_setting']['post_title'] ); |
68 | 68 | $new_instance['post_content'] = $_POST['frm_style_setting']['post_content']; |
69 | 69 | $new_instance['post_type'] = FrmStylesController::$post_type; |
70 | - $new_instance['post_status'] = 'publish'; |
|
70 | + $new_instance['post_status'] = 'publish'; |
|
71 | 71 | $new_instance['menu_order'] = isset( $_POST['frm_style_setting']['menu_order'] ) ? absint( $_POST['frm_style_setting']['menu_order'] ) : 0; |
72 | 72 | |
73 | - if ( empty($id) ) { |
|
74 | - $new_instance['post_name'] = $new_instance['post_title']; |
|
75 | - } |
|
73 | + if ( empty($id) ) { |
|
74 | + $new_instance['post_name'] = $new_instance['post_title']; |
|
75 | + } |
|
76 | 76 | |
77 | - $default_settings = $this->get_defaults(); |
|
77 | + $default_settings = $this->get_defaults(); |
|
78 | 78 | |
79 | - foreach ( $default_settings as $setting => $default ) { |
|
79 | + foreach ( $default_settings as $setting => $default ) { |
|
80 | 80 | if ( strpos( $setting, 'color' ) !== false || in_array( $setting, array( 'error_bg', 'error_border', 'error_text' ) ) ) { |
81 | - //if is a color |
|
81 | + //if is a color |
|
82 | 82 | $new_instance['post_content'][ $setting ] = str_replace( '#', '', $new_instance['post_content'][ $setting ] ); |
83 | 83 | } else if ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ) ) && ! isset( $new_instance['post_content'][ $setting ] ) ) { |
84 | 84 | $new_instance['post_content'][ $setting ] = 0; |
85 | - } else if ( $setting == 'font' ) { |
|
86 | - $new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] ); |
|
87 | - } |
|
88 | - } |
|
85 | + } else if ( $setting == 'font' ) { |
|
86 | + $new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] ); |
|
87 | + } |
|
88 | + } |
|
89 | 89 | |
90 | 90 | $all_instances[ $number ] = $new_instance; |
91 | 91 | |
92 | - $action_ids[] = $this->save($new_instance); |
|
92 | + $action_ids[] = $this->save($new_instance); |
|
93 | 93 | |
94 | 94 | } |
95 | 95 | |
@@ -98,16 +98,16 @@ discard block |
||
98 | 98 | return $action_ids; |
99 | 99 | } |
100 | 100 | |
101 | - /** |
|
102 | - * Create static css file |
|
103 | - */ |
|
101 | + /** |
|
102 | + * Create static css file |
|
103 | + */ |
|
104 | 104 | public function save_settings() { |
105 | 105 | $filename = FrmAppHelper::plugin_path() . '/css/custom_theme.css.php'; |
106 | 106 | update_option( 'frm_last_style_update', date('njGi') ); |
107 | 107 | |
108 | - if ( ! is_file($filename) ) { |
|
109 | - return; |
|
110 | - } |
|
108 | + if ( ! is_file($filename) ) { |
|
109 | + return; |
|
110 | + } |
|
111 | 111 | |
112 | 112 | $this->clear_cache(); |
113 | 113 | |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | $create_file = new FrmCreateFile( array( 'folder_name' => 'formidable/css', 'file_name' => 'formidablepro.css' ) ); |
117 | 117 | $create_file->create_file( $css ); |
118 | 118 | |
119 | - update_option('frmpro_css', $css); |
|
119 | + update_option('frmpro_css', $css); |
|
120 | 120 | |
121 | - set_transient('frmpro_css', $css); |
|
121 | + set_transient('frmpro_css', $css); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | private function get_css_content( $filename ) { |
@@ -127,10 +127,10 @@ discard block |
||
127 | 127 | $saving = true; |
128 | 128 | $frm_style = $this; |
129 | 129 | |
130 | - ob_start(); |
|
131 | - include( $filename ); |
|
130 | + ob_start(); |
|
131 | + include( $filename ); |
|
132 | 132 | $css .= preg_replace( '/\/\*(.|\s)*?\*\//', '', str_replace( array( "\r\n", "\r", "\n", "\t", ' ' ), '', ob_get_contents() ) ); |
133 | - ob_end_clean(); |
|
133 | + ob_end_clean(); |
|
134 | 134 | |
135 | 135 | return $css; |
136 | 136 | } |
@@ -150,273 +150,273 @@ discard block |
||
150 | 150 | } |
151 | 151 | |
152 | 152 | public function destroy( $id ) { |
153 | - return wp_delete_post($id); |
|
154 | - } |
|
153 | + return wp_delete_post($id); |
|
154 | + } |
|
155 | 155 | |
156 | - public function get_one() { |
|
157 | - if ( 'default' == $this->id ) { |
|
158 | - $style = $this->get_default_style(); |
|
159 | - if ( $style ) { |
|
160 | - $this->id = $style->ID; |
|
161 | - } else { |
|
162 | - $this->id = 0; |
|
163 | - } |
|
164 | - return $style; |
|
165 | - } |
|
156 | + public function get_one() { |
|
157 | + if ( 'default' == $this->id ) { |
|
158 | + $style = $this->get_default_style(); |
|
159 | + if ( $style ) { |
|
160 | + $this->id = $style->ID; |
|
161 | + } else { |
|
162 | + $this->id = 0; |
|
163 | + } |
|
164 | + return $style; |
|
165 | + } |
|
166 | 166 | |
167 | - $style = get_post($this->id); |
|
167 | + $style = get_post($this->id); |
|
168 | 168 | |
169 | - if ( ! $style ) { |
|
170 | - return $style; |
|
171 | - } |
|
169 | + if ( ! $style ) { |
|
170 | + return $style; |
|
171 | + } |
|
172 | 172 | |
173 | - $style->post_content = FrmAppHelper::maybe_json_decode($style->post_content); |
|
173 | + $style->post_content = FrmAppHelper::maybe_json_decode($style->post_content); |
|
174 | 174 | |
175 | - $default_values = $this->get_defaults(); |
|
175 | + $default_values = $this->get_defaults(); |
|
176 | 176 | |
177 | - // fill default values |
|
178 | - $style->post_content = $this->override_defaults($style->post_content); |
|
179 | - $style->post_content = wp_parse_args( $style->post_content, $default_values); |
|
177 | + // fill default values |
|
178 | + $style->post_content = $this->override_defaults($style->post_content); |
|
179 | + $style->post_content = wp_parse_args( $style->post_content, $default_values); |
|
180 | 180 | |
181 | - return $style; |
|
182 | - } |
|
181 | + return $style; |
|
182 | + } |
|
183 | 183 | |
184 | - public function get_all( $orderby = 'title', $order = 'ASC', $limit = 99 ) { |
|
185 | - $post_atts = array( |
|
184 | + public function get_all( $orderby = 'title', $order = 'ASC', $limit = 99 ) { |
|
185 | + $post_atts = array( |
|
186 | 186 | 'post_type' => FrmStylesController::$post_type, |
187 | 187 | 'post_status' => 'publish', |
188 | 188 | 'numberposts' => $limit, |
189 | 189 | 'orderby' => $orderby, |
190 | 190 | 'order' => $order, |
191 | - ); |
|
191 | + ); |
|
192 | 192 | |
193 | - $temp_styles = FrmAppHelper::check_cache(serialize($post_atts), 'frm_styles', $post_atts, 'get_posts'); |
|
193 | + $temp_styles = FrmAppHelper::check_cache(serialize($post_atts), 'frm_styles', $post_atts, 'get_posts'); |
|
194 | 194 | |
195 | - if ( empty($temp_styles) ) { |
|
196 | - global $wpdb; |
|
197 | - // make sure there wasn't a conflict with the query |
|
195 | + if ( empty($temp_styles) ) { |
|
196 | + global $wpdb; |
|
197 | + // make sure there wasn't a conflict with the query |
|
198 | 198 | $query = $wpdb->prepare( 'SELECT * FROM ' . $wpdb->posts . ' WHERE post_type=%s AND post_status=%s ORDER BY post_title ASC LIMIT 99', FrmStylesController::$post_type, 'publish' ); |
199 | - $temp_styles = FrmAppHelper::check_cache('frm_backup_style_check', 'frm_styles', $query, 'get_results'); |
|
199 | + $temp_styles = FrmAppHelper::check_cache('frm_backup_style_check', 'frm_styles', $query, 'get_results'); |
|
200 | 200 | |
201 | - if ( empty($temp_styles) ) { |
|
202 | - // create a new style if there are none |
|
203 | - $new = $this->get_new(); |
|
201 | + if ( empty($temp_styles) ) { |
|
202 | + // create a new style if there are none |
|
203 | + $new = $this->get_new(); |
|
204 | 204 | $new->post_title = __( 'Formidable Style', 'formidable' ); |
205 | 205 | $new->post_name = $new->post_title; |
206 | - $new->menu_order = 1; |
|
207 | - $new = $this->save( (array) $new); |
|
208 | - $this->update('default'); |
|
209 | - |
|
210 | - $post_atts['include'] = $new; |
|
211 | - |
|
212 | - $temp_styles = get_posts( $post_atts ); |
|
213 | - } |
|
214 | - } |
|
215 | - |
|
216 | - $default_values = $this->get_defaults(); |
|
217 | - $default_style = false; |
|
218 | - |
|
219 | - $styles = array(); |
|
220 | - foreach ( $temp_styles as $style ) { |
|
221 | - $this->id = $style->ID; |
|
222 | - if ( $style->menu_order ) { |
|
223 | - if ( $default_style ) { |
|
224 | - // only return one default |
|
225 | - $style->menu_order = 0; |
|
226 | - } else { |
|
227 | - // check for a default style |
|
228 | - $default_style = $style->ID; |
|
229 | - } |
|
230 | - } |
|
231 | - |
|
232 | - $style->post_content = FrmAppHelper::maybe_json_decode($style->post_content); |
|
233 | - |
|
234 | - // fill default values |
|
235 | - $style->post_content = $this->override_defaults($style->post_content); |
|
236 | - $style->post_content = wp_parse_args( $style->post_content, $default_values); |
|
206 | + $new->menu_order = 1; |
|
207 | + $new = $this->save( (array) $new); |
|
208 | + $this->update('default'); |
|
209 | + |
|
210 | + $post_atts['include'] = $new; |
|
211 | + |
|
212 | + $temp_styles = get_posts( $post_atts ); |
|
213 | + } |
|
214 | + } |
|
215 | + |
|
216 | + $default_values = $this->get_defaults(); |
|
217 | + $default_style = false; |
|
218 | + |
|
219 | + $styles = array(); |
|
220 | + foreach ( $temp_styles as $style ) { |
|
221 | + $this->id = $style->ID; |
|
222 | + if ( $style->menu_order ) { |
|
223 | + if ( $default_style ) { |
|
224 | + // only return one default |
|
225 | + $style->menu_order = 0; |
|
226 | + } else { |
|
227 | + // check for a default style |
|
228 | + $default_style = $style->ID; |
|
229 | + } |
|
230 | + } |
|
231 | + |
|
232 | + $style->post_content = FrmAppHelper::maybe_json_decode($style->post_content); |
|
233 | + |
|
234 | + // fill default values |
|
235 | + $style->post_content = $this->override_defaults($style->post_content); |
|
236 | + $style->post_content = wp_parse_args( $style->post_content, $default_values); |
|
237 | 237 | |
238 | 238 | $styles[ $style->ID ] = $style; |
239 | - } |
|
239 | + } |
|
240 | 240 | |
241 | - if ( ! $default_style ) { |
|
242 | - $default_style = reset($styles); |
|
241 | + if ( ! $default_style ) { |
|
242 | + $default_style = reset($styles); |
|
243 | 243 | $styles[ $default_style->ID ]->menu_order = 1; |
244 | - } |
|
244 | + } |
|
245 | 245 | |
246 | - return $styles; |
|
247 | - } |
|
246 | + return $styles; |
|
247 | + } |
|
248 | 248 | |
249 | 249 | public function get_default_style( $styles = null ) { |
250 | - if ( ! isset($styles) ) { |
|
250 | + if ( ! isset($styles) ) { |
|
251 | 251 | $styles = $this->get_all( 'menu_order', 'DESC', 1 ); |
252 | - } |
|
252 | + } |
|
253 | 253 | |
254 | - foreach ( $styles as $style ) { |
|
255 | - if ( $style->menu_order ) { |
|
256 | - return $style; |
|
257 | - } |
|
258 | - } |
|
259 | - } |
|
254 | + foreach ( $styles as $style ) { |
|
255 | + if ( $style->menu_order ) { |
|
256 | + return $style; |
|
257 | + } |
|
258 | + } |
|
259 | + } |
|
260 | 260 | |
261 | 261 | public function override_defaults( $settings ) { |
262 | - if ( ! is_array($settings) ) { |
|
263 | - return $settings; |
|
264 | - } |
|
265 | - |
|
266 | - $settings['line_height'] = ( ! isset($settings['field_height']) || $settings['field_height'] == '' || $settings['field_height'] == 'auto') ? 'normal' : $settings['field_height']; |
|
267 | - |
|
268 | - if ( ! isset($settings['form_desc_size']) && isset($settings['description_font_size']) ) { |
|
269 | - $settings['form_desc_size'] = $settings['description_font_size']; |
|
270 | - $settings['form_desc_color'] = $settings['description_color']; |
|
271 | - $settings['title_color'] = $settings['label_color']; |
|
272 | - } |
|
273 | - |
|
274 | - if ( ! isset($settings['section_color']) && isset($settings['label_color']) ) { |
|
275 | - $settings['section_color'] = $settings['label_color']; |
|
276 | - $settings['section_border_color'] = $settings['border_color']; |
|
277 | - } |
|
278 | - |
|
279 | - if ( ! isset($settings['submit_hover_bg_color']) && isset($settings['submit_bg_color']) ) { |
|
280 | - $settings['submit_hover_bg_color'] = $settings['submit_bg_color']; |
|
281 | - $settings['submit_hover_color'] = $settings['submit_text_color']; |
|
282 | - $settings['submit_hover_border_color'] = $settings['submit_border_color']; |
|
283 | - |
|
284 | - $settings['submit_active_bg_color'] = $settings['submit_bg_color']; |
|
285 | - $settings['submit_active_color'] = $settings['submit_text_color']; |
|
286 | - $settings['submit_active_border_color'] = $settings['submit_border_color']; |
|
287 | - } |
|
288 | - |
|
289 | - return $settings; |
|
262 | + if ( ! is_array($settings) ) { |
|
263 | + return $settings; |
|
264 | + } |
|
265 | + |
|
266 | + $settings['line_height'] = ( ! isset($settings['field_height']) || $settings['field_height'] == '' || $settings['field_height'] == 'auto') ? 'normal' : $settings['field_height']; |
|
267 | + |
|
268 | + if ( ! isset($settings['form_desc_size']) && isset($settings['description_font_size']) ) { |
|
269 | + $settings['form_desc_size'] = $settings['description_font_size']; |
|
270 | + $settings['form_desc_color'] = $settings['description_color']; |
|
271 | + $settings['title_color'] = $settings['label_color']; |
|
272 | + } |
|
273 | + |
|
274 | + if ( ! isset($settings['section_color']) && isset($settings['label_color']) ) { |
|
275 | + $settings['section_color'] = $settings['label_color']; |
|
276 | + $settings['section_border_color'] = $settings['border_color']; |
|
277 | + } |
|
278 | + |
|
279 | + if ( ! isset($settings['submit_hover_bg_color']) && isset($settings['submit_bg_color']) ) { |
|
280 | + $settings['submit_hover_bg_color'] = $settings['submit_bg_color']; |
|
281 | + $settings['submit_hover_color'] = $settings['submit_text_color']; |
|
282 | + $settings['submit_hover_border_color'] = $settings['submit_border_color']; |
|
283 | + |
|
284 | + $settings['submit_active_bg_color'] = $settings['submit_bg_color']; |
|
285 | + $settings['submit_active_color'] = $settings['submit_text_color']; |
|
286 | + $settings['submit_active_border_color'] = $settings['submit_border_color']; |
|
287 | + } |
|
288 | + |
|
289 | + return $settings; |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | public function get_defaults() { |
293 | - return array( |
|
294 | - 'theme_css' => 'ui-lightness', |
|
295 | - 'theme_name' => 'UI Lightness', |
|
293 | + return array( |
|
294 | + 'theme_css' => 'ui-lightness', |
|
295 | + 'theme_name' => 'UI Lightness', |
|
296 | 296 | |
297 | 297 | 'center_form' => '', |
298 | - 'form_width' => '100%', |
|
299 | - 'form_align' => 'left', |
|
300 | - 'direction' => is_rtl() ? 'rtl' : 'ltr', |
|
301 | - 'fieldset' => '0px', |
|
302 | - 'fieldset_color' => '000000', |
|
303 | - 'fieldset_padding' => '0 0 15px 0', |
|
304 | - 'fieldset_bg_color' => '', |
|
305 | - |
|
306 | - 'title_size' => '20px', |
|
307 | - 'title_color' => '444444', |
|
298 | + 'form_width' => '100%', |
|
299 | + 'form_align' => 'left', |
|
300 | + 'direction' => is_rtl() ? 'rtl' : 'ltr', |
|
301 | + 'fieldset' => '0px', |
|
302 | + 'fieldset_color' => '000000', |
|
303 | + 'fieldset_padding' => '0 0 15px 0', |
|
304 | + 'fieldset_bg_color' => '', |
|
305 | + |
|
306 | + 'title_size' => '20px', |
|
307 | + 'title_color' => '444444', |
|
308 | 308 | 'title_margin_top' => '10px', |
309 | 309 | 'title_margin_bottom' => '10px', |
310 | - 'form_desc_size' => '14px', |
|
311 | - 'form_desc_color' => '666666', |
|
310 | + 'form_desc_size' => '14px', |
|
311 | + 'form_desc_color' => '666666', |
|
312 | 312 | 'form_desc_margin_top' => '10px', |
313 | 313 | 'form_desc_margin_bottom' => '25px', |
314 | 314 | |
315 | - 'font' => '"Lucida Grande","Lucida Sans Unicode",Tahoma,sans-serif', |
|
316 | - 'font_size' => '14px', |
|
317 | - 'label_color' => '444444', |
|
318 | - 'weight' => 'bold', |
|
319 | - 'position' => 'none', |
|
320 | - 'align' => 'left', |
|
321 | - 'width' => '150px', |
|
322 | - 'required_color' => 'B94A48', |
|
323 | - 'required_weight' => 'bold', |
|
324 | - 'label_padding' => '0 0 3px 0', |
|
325 | - |
|
326 | - 'description_font_size' => '12px', |
|
327 | - 'description_color' => '666666', |
|
328 | - 'description_weight' => 'normal', |
|
329 | - 'description_style' => 'normal', |
|
330 | - 'description_align' => 'left', |
|
315 | + 'font' => '"Lucida Grande","Lucida Sans Unicode",Tahoma,sans-serif', |
|
316 | + 'font_size' => '14px', |
|
317 | + 'label_color' => '444444', |
|
318 | + 'weight' => 'bold', |
|
319 | + 'position' => 'none', |
|
320 | + 'align' => 'left', |
|
321 | + 'width' => '150px', |
|
322 | + 'required_color' => 'B94A48', |
|
323 | + 'required_weight' => 'bold', |
|
324 | + 'label_padding' => '0 0 3px 0', |
|
325 | + |
|
326 | + 'description_font_size' => '12px', |
|
327 | + 'description_color' => '666666', |
|
328 | + 'description_weight' => 'normal', |
|
329 | + 'description_style' => 'normal', |
|
330 | + 'description_align' => 'left', |
|
331 | 331 | 'description_margin' => '0', |
332 | 332 | |
333 | - 'field_font_size' => '14px', |
|
334 | - 'field_height' => '32px', |
|
335 | - 'line_height' => 'normal', |
|
336 | - 'field_width' => '100%', |
|
337 | - 'auto_width' => false, |
|
338 | - 'field_pad' => '6px 10px', |
|
339 | - 'field_margin' => '20px', |
|
333 | + 'field_font_size' => '14px', |
|
334 | + 'field_height' => '32px', |
|
335 | + 'line_height' => 'normal', |
|
336 | + 'field_width' => '100%', |
|
337 | + 'auto_width' => false, |
|
338 | + 'field_pad' => '6px 10px', |
|
339 | + 'field_margin' => '20px', |
|
340 | 340 | 'field_weight' => 'normal', |
341 | - 'text_color' => '555555', |
|
342 | - //'border_color_hv' => 'cccccc', |
|
343 | - 'border_color' => 'cccccc', |
|
344 | - 'field_border_width' => '1px', |
|
345 | - 'field_border_style' => 'solid', |
|
346 | - |
|
347 | - 'bg_color' => 'ffffff', |
|
348 | - //'bg_color_hv' => 'ffffff', |
|
341 | + 'text_color' => '555555', |
|
342 | + //'border_color_hv' => 'cccccc', |
|
343 | + 'border_color' => 'cccccc', |
|
344 | + 'field_border_width' => '1px', |
|
345 | + 'field_border_style' => 'solid', |
|
346 | + |
|
347 | + 'bg_color' => 'ffffff', |
|
348 | + //'bg_color_hv' => 'ffffff', |
|
349 | 349 | 'remove_box_shadow' => '', |
350 | - 'bg_color_active' => 'ffffff', |
|
350 | + 'bg_color_active' => 'ffffff', |
|
351 | 351 | 'border_color_active' => '66afe9', |
352 | 352 | 'remove_box_shadow_active' => '', |
353 | - 'text_color_error' => '444444', |
|
354 | - 'bg_color_error' => 'ffffff', |
|
353 | + 'text_color_error' => '444444', |
|
354 | + 'bg_color_error' => 'ffffff', |
|
355 | 355 | 'border_color_error' => 'B94A48', |
356 | 356 | 'border_width_error' => '1px', |
357 | 357 | 'border_style_error' => 'solid', |
358 | - 'bg_color_disabled' => 'ffffff', |
|
359 | - 'border_color_disabled' => 'E5E5E5', |
|
360 | - 'text_color_disabled' => 'A1A1A1', |
|
361 | - |
|
362 | - 'radio_align' => 'block', |
|
363 | - 'check_align' => 'block', |
|
364 | - 'check_font_size' => '13px', |
|
365 | - 'check_label_color' => '444444', |
|
366 | - 'check_weight' => 'normal', |
|
367 | - |
|
368 | - 'section_font_size' => '18px', |
|
369 | - 'section_color' => '444444', |
|
370 | - 'section_weight' => 'bold', |
|
371 | - 'section_pad' => '15px 0 3px 0', |
|
372 | - 'section_mar_top' => '15px', |
|
358 | + 'bg_color_disabled' => 'ffffff', |
|
359 | + 'border_color_disabled' => 'E5E5E5', |
|
360 | + 'text_color_disabled' => 'A1A1A1', |
|
361 | + |
|
362 | + 'radio_align' => 'block', |
|
363 | + 'check_align' => 'block', |
|
364 | + 'check_font_size' => '13px', |
|
365 | + 'check_label_color' => '444444', |
|
366 | + 'check_weight' => 'normal', |
|
367 | + |
|
368 | + 'section_font_size' => '18px', |
|
369 | + 'section_color' => '444444', |
|
370 | + 'section_weight' => 'bold', |
|
371 | + 'section_pad' => '15px 0 3px 0', |
|
372 | + 'section_mar_top' => '15px', |
|
373 | 373 | 'section_mar_bottom' => '12px', |
374 | - 'section_bg_color' => '', |
|
375 | - 'section_border_color' => 'e8e8e8', |
|
376 | - 'section_border_width' => '2px', |
|
377 | - 'section_border_style' => 'solid', |
|
378 | - 'section_border_loc' => '-top', |
|
379 | - 'collapse_icon' => '6', |
|
380 | - 'collapse_pos' => 'after', |
|
381 | - 'repeat_icon' => '1', |
|
382 | - |
|
383 | - 'submit_style' => false, |
|
384 | - 'submit_font_size' => '14px', |
|
385 | - 'submit_width' => 'auto', |
|
386 | - 'submit_height' => 'auto', |
|
387 | - 'submit_bg_color' => 'ffffff', |
|
388 | - 'submit_border_color' => 'cccccc', |
|
389 | - 'submit_border_width' => '1px', |
|
390 | - 'submit_text_color' => '444444', |
|
391 | - 'submit_weight' => 'normal', |
|
392 | - 'submit_border_radius' => '4px', |
|
393 | - 'submit_bg_img' => '', |
|
394 | - 'submit_margin' => '10px', |
|
395 | - 'submit_padding' => '6px 11px', |
|
396 | - 'submit_shadow_color' => 'eeeeee', |
|
397 | - 'submit_hover_bg_color' => 'efefef', |
|
398 | - 'submit_hover_color' => '444444', |
|
399 | - 'submit_hover_border_color' => 'cccccc', |
|
400 | - 'submit_active_bg_color' => 'efefef', |
|
401 | - 'submit_active_color' => '444444', |
|
402 | - 'submit_active_border_color' => 'cccccc', |
|
403 | - |
|
404 | - 'border_radius' => '4px', |
|
405 | - 'error_bg' => 'F2DEDE', |
|
406 | - 'error_border' => 'EBCCD1', |
|
407 | - 'error_text' => 'B94A48', |
|
408 | - 'error_font_size' => '14px', |
|
409 | - |
|
410 | - 'success_bg_color' => 'DFF0D8', |
|
411 | - 'success_border_color' => 'D6E9C6', |
|
412 | - 'success_text_color' => '468847', |
|
413 | - 'success_font_size' => '14px', |
|
414 | - |
|
415 | - 'important_style' => false, |
|
416 | - |
|
417 | - 'custom_css' => '', |
|
418 | - ); |
|
419 | - } |
|
374 | + 'section_bg_color' => '', |
|
375 | + 'section_border_color' => 'e8e8e8', |
|
376 | + 'section_border_width' => '2px', |
|
377 | + 'section_border_style' => 'solid', |
|
378 | + 'section_border_loc' => '-top', |
|
379 | + 'collapse_icon' => '6', |
|
380 | + 'collapse_pos' => 'after', |
|
381 | + 'repeat_icon' => '1', |
|
382 | + |
|
383 | + 'submit_style' => false, |
|
384 | + 'submit_font_size' => '14px', |
|
385 | + 'submit_width' => 'auto', |
|
386 | + 'submit_height' => 'auto', |
|
387 | + 'submit_bg_color' => 'ffffff', |
|
388 | + 'submit_border_color' => 'cccccc', |
|
389 | + 'submit_border_width' => '1px', |
|
390 | + 'submit_text_color' => '444444', |
|
391 | + 'submit_weight' => 'normal', |
|
392 | + 'submit_border_radius' => '4px', |
|
393 | + 'submit_bg_img' => '', |
|
394 | + 'submit_margin' => '10px', |
|
395 | + 'submit_padding' => '6px 11px', |
|
396 | + 'submit_shadow_color' => 'eeeeee', |
|
397 | + 'submit_hover_bg_color' => 'efefef', |
|
398 | + 'submit_hover_color' => '444444', |
|
399 | + 'submit_hover_border_color' => 'cccccc', |
|
400 | + 'submit_active_bg_color' => 'efefef', |
|
401 | + 'submit_active_color' => '444444', |
|
402 | + 'submit_active_border_color' => 'cccccc', |
|
403 | + |
|
404 | + 'border_radius' => '4px', |
|
405 | + 'error_bg' => 'F2DEDE', |
|
406 | + 'error_border' => 'EBCCD1', |
|
407 | + 'error_text' => 'B94A48', |
|
408 | + 'error_font_size' => '14px', |
|
409 | + |
|
410 | + 'success_bg_color' => 'DFF0D8', |
|
411 | + 'success_border_color' => 'D6E9C6', |
|
412 | + 'success_text_color' => '468847', |
|
413 | + 'success_font_size' => '14px', |
|
414 | + |
|
415 | + 'important_style' => false, |
|
416 | + |
|
417 | + 'custom_css' => '', |
|
418 | + ); |
|
419 | + } |
|
420 | 420 | |
421 | 421 | public function get_field_name( $field_name, $post_field = 'post_content' ) { |
422 | 422 | return 'frm_style_setting' . ( empty( $post_field ) ? '' : '[' . $post_field . ']' ) . '[' . $field_name . ']'; |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | $this->file_name = $atts['file_name']; |
19 | 19 | $this->error_message = isset( $atts['error_message'] ) ? $atts['error_message'] : ''; |
20 | 20 | $this->uploads = wp_upload_dir(); |
21 | - $this->chmod_dir = defined('FS_CHMOD_DIR') ? FS_CHMOD_DIR : ( fileperms( ABSPATH ) & 0777 | 0755 ); |
|
22 | - $this->chmod_file = defined('FS_CHMOD_FILE') ? FS_CHMOD_FILE : ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ); |
|
21 | + $this->chmod_dir = defined( 'FS_CHMOD_DIR' ) ? FS_CHMOD_DIR : ( fileperms( ABSPATH ) & 0777 | 0755 ); |
|
22 | + $this->chmod_file = defined( 'FS_CHMOD_FILE' ) ? FS_CHMOD_FILE : ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | public function create_file( $file_content ) { |
@@ -85,13 +85,13 @@ discard block |
||
85 | 85 | private function get_ftp_creds( $type ) { |
86 | 86 | $credentials = get_option( 'ftp_credentials', array( 'hostname' => '', 'username' => '' ) ); |
87 | 87 | |
88 | - $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : $credentials['hostname']; |
|
89 | - $credentials['username'] = defined('FTP_USER') ? FTP_USER : $credentials['username']; |
|
90 | - $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : ''; |
|
88 | + $credentials['hostname'] = defined( 'FTP_HOST' ) ? FTP_HOST : $credentials['hostname']; |
|
89 | + $credentials['username'] = defined( 'FTP_USER' ) ? FTP_USER : $credentials['username']; |
|
90 | + $credentials['password'] = defined( 'FTP_PASS' ) ? FTP_PASS : ''; |
|
91 | 91 | |
92 | 92 | // Check to see if we are setting the public/private keys for ssh |
93 | - $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : ''; |
|
94 | - $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : ''; |
|
93 | + $credentials['public_key'] = defined( 'FTP_PUBKEY' ) ? FTP_PUBKEY : ''; |
|
94 | + $credentials['private_key'] = defined( 'FTP_PRIKEY' ) ? FTP_PRIKEY : ''; |
|
95 | 95 | |
96 | 96 | // Sanitize the hostname, Some people might pass in odd-data: |
97 | 97 | $credentials['hostname'] = preg_replace( '|\w+://|', '', $credentials['hostname'] ); //Strip any schemes off |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <li id="frm_delete_field_<?php echo esc_attr( $field['id'] ); ?>-<?php echo esc_attr( $opt_key ) ?>_container" class="frm_single_option"> |
2 | 2 | <a href="javascript:void(0)" class="frm_single_visible_hover frm_icon_font frm_delete_icon" data-fid="<?php echo esc_attr( $field['id'] ); ?>"> </a> |
3 | 3 | <?php if ( $field['type'] != 'select' ) { ?> |
4 | - <input type="<?php echo esc_attr( $field['type'] ) ?>" name="<?php echo esc_attr( $field_name ) ?><?php echo ( $field['type'] == 'checkbox' ) ? '[]' : ''; ?>" value="<?php echo esc_attr($field_val) ?>"<?php echo isset( $checked ) ? $checked : ''; ?>/> |
|
4 | + <input type="<?php echo esc_attr( $field['type'] ) ?>" name="<?php echo esc_attr( $field_name ) ?><?php echo ( $field['type'] == 'checkbox' ) ? '[]' : ''; ?>" value="<?php echo esc_attr( $field_val ) ?>"<?php echo isset( $checked ) ? $checked : ''; ?>/> |
|
5 | 5 | <?php } ?> |
6 | - <label class="frm_ipe_field_option field_<?php echo esc_attr( $field['id'] ) ?>_option <?php echo esc_attr( $field['separate_value'] ? 'frm_with_key' : '' ); ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key ) ?>"><?php echo ($opt == '') ? __( '(Blank)', 'formidable' ) : $opt ?></label> |
|
6 | + <label class="frm_ipe_field_option field_<?php echo esc_attr( $field['id'] ) ?>_option <?php echo esc_attr( $field['separate_value'] ? 'frm_with_key' : '' ); ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key ) ?>"><?php echo ( $opt == '' ) ? __( '(Blank)', 'formidable' ) : $opt ?></label> |
|
7 | 7 | <span class="frm_option_key field_<?php echo esc_attr( $field['id'] ) ?>_option_key<?php echo esc_attr( $field['separate_value'] ? '' : ' frm_hidden' ); ?>"> |
8 | 8 | <label class="frm-show-click frm_ipe_field_option_key" id="field_key_<?php echo esc_attr( $field['id'] . '-' . $opt_key ) ?>"><?php echo ( $field_val == '' ) ? esc_html__( '(Blank)', 'formidable' ) : $field_val ?></label> |
9 | 9 | </span> |
10 | 10 | </li> |
11 | 11 | <?php |
12 | -unset($field_val, $opt, $opt_key); |
|
12 | +unset( $field_val, $opt, $opt_key ); |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <div class="field-group field-group-background clearfix frm-first-row"> |
2 | 2 | <label><?php _e( 'Color', 'formidable' ) ?></label> |
3 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('label_color') ) ?>" id="frm_label_color" class="hex" value="<?php echo esc_attr( $style->post_content['label_color'] ) ?>" /> |
|
3 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'label_color' ) ) ?>" id="frm_label_color" class="hex" value="<?php echo esc_attr( $style->post_content['label_color'] ) ?>" /> |
|
4 | 4 | </div> |
5 | 5 | <div class="field-group clearfix frm-first-row"> |
6 | 6 | <label><?php _e( 'Weight', 'formidable' ) ?></label> |
7 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('weight') ) ?>" id="frm_weight"> |
|
7 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'weight' ) ) ?>" id="frm_weight"> |
|
8 | 8 | <?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?> |
9 | 9 | <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['weight'], $value ) ?>><?php echo esc_html( $name ) ?></option> |
10 | 10 | <?php } ?> |
@@ -12,45 +12,45 @@ discard block |
||
12 | 12 | </div> |
13 | 13 | <div class="field-group clearfix frm-first-row"> |
14 | 14 | <label><?php _e( 'Size', 'formidable' ) ?></label> |
15 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('font_size') ) ?>" id="frm_font_size" value="<?php echo esc_attr($style->post_content['font_size']) ?>" size="3" /> |
|
15 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'font_size' ) ) ?>" id="frm_font_size" value="<?php echo esc_attr( $style->post_content['font_size'] ) ?>" size="3" /> |
|
16 | 16 | </div> |
17 | 17 | |
18 | 18 | <div class="field-group clearfix frm_clear"> |
19 | 19 | <label><?php _e( 'Position', 'formidable' ) ?></label> |
20 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('position') ) ?>" id="frm_position"> |
|
20 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'position' ) ) ?>" id="frm_position"> |
|
21 | 21 | <?php foreach ( array( 'none' => __( 'top', 'formidable' ), 'left' => __( 'left', 'formidable' ), 'right' => __( 'right', 'formidable' ), 'no_label' => __( 'none', 'formidable' ) ) as $pos => $pos_label ) { ?> |
22 | - <option value="<?php echo esc_attr( $pos ) ?>" <?php selected($style->post_content['position'], $pos) ?>><?php echo esc_html( $pos_label ) ?></option> |
|
22 | + <option value="<?php echo esc_attr( $pos ) ?>" <?php selected( $style->post_content['position'], $pos ) ?>><?php echo esc_html( $pos_label ) ?></option> |
|
23 | 23 | <?php } ?> |
24 | 24 | </select> |
25 | 25 | </div> |
26 | 26 | |
27 | 27 | <div class="field-group clearfix"> |
28 | 28 | <label><?php _e( 'Align', 'formidable' ) ?></label> |
29 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('align') ) ?>" id="frm_align"> |
|
30 | - <option value="left" <?php selected($style->post_content['align'], 'left') ?>><?php _e( 'left', 'formidable' ) ?></option> |
|
31 | - <option value="right" <?php selected($style->post_content['align'], 'right') ?>><?php _e( 'right', 'formidable' ) ?></option> |
|
29 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'align' ) ) ?>" id="frm_align"> |
|
30 | + <option value="left" <?php selected( $style->post_content['align'], 'left' ) ?>><?php _e( 'left', 'formidable' ) ?></option> |
|
31 | + <option value="right" <?php selected( $style->post_content['align'], 'right' ) ?>><?php _e( 'right', 'formidable' ) ?></option> |
|
32 | 32 | </select> |
33 | 33 | </div> |
34 | 34 | |
35 | 35 | <div class="field-group clearfix"> |
36 | 36 | <label><?php _e( 'Width', 'formidable' ) ?></label> |
37 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('width') ) ?>" id="frm_width" value="<?php echo esc_attr( $style->post_content['width'] ) ?>" /> |
|
37 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'width' ) ) ?>" id="frm_width" value="<?php echo esc_attr( $style->post_content['width'] ) ?>" /> |
|
38 | 38 | </div> |
39 | 39 | |
40 | 40 | <div class="field-group clearfix frm_clear"> |
41 | 41 | <label><?php _e( 'Padding', 'formidable' ) ?></label> |
42 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('label_padding') ) ?>" id="frm_label_padding" value="<?php echo esc_attr( $style->post_content['label_padding'] ) ?>" /> |
|
42 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'label_padding' ) ) ?>" id="frm_label_padding" value="<?php echo esc_attr( $style->post_content['label_padding'] ) ?>" /> |
|
43 | 43 | </div> |
44 | 44 | |
45 | 45 | <div class="clear"></div> |
46 | 46 | <h3><?php _e( 'Required Indicator', 'formidable' ) ?></h3> |
47 | 47 | <div class="field-group field-group-border clearfix after-h3"> |
48 | 48 | <label class="background"><?php _e( 'Color', 'formidable' ) ?></label> |
49 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('required_color') ) ?>" id="frm_required_color" class="hex" value="<?php echo esc_attr( $style->post_content['required_color'] ) ?>" /> |
|
49 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'required_color' ) ) ?>" id="frm_required_color" class="hex" value="<?php echo esc_attr( $style->post_content['required_color'] ) ?>" /> |
|
50 | 50 | </div> |
51 | 51 | <div class="field-group clearfix after-h3"> |
52 | 52 | <label><?php _e( 'Weight', 'formidable' ) ?></label> |
53 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('required_weight') ) ?>" id="frm_required_weight"> |
|
53 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'required_weight' ) ) ?>" id="frm_required_weight"> |
|
54 | 54 | <?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?> |
55 | 55 | <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['required_weight'], $value ) ?>><?php echo esc_html( $name ) ?></option> |
56 | 56 | <?php } ?> |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <p class="frm_no_top_margin"> |
2 | 2 | <label for="frm_submit_style"> |
3 | - <input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('submit_style') ) ?>" id="frm_submit_style" <?php checked( $style->post_content['submit_style'], 1 ) ?> value="1" /> |
|
3 | + <input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_style' ) ) ?>" id="frm_submit_style" <?php checked( $style->post_content['submit_style'], 1 ) ?> value="1" /> |
|
4 | 4 | <?php esc_html_e( 'Disable submit button styling', 'formidable' ); ?> |
5 | 5 | <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Note: If disabled, you may not see the change take effect until you make 2 more styling changes or click "Update Options".', 'formidable' ) ?>"></span> |
6 | 6 | </label> |
@@ -9,10 +9,10 @@ discard block |
||
9 | 9 | <div class="posttypediv"> |
10 | 10 | <ul class="posttype-tabs add-menu-item-tabs"> |
11 | 11 | <li <?php echo ( 'default' == $current_tab ? ' class="tabs"' : '' ); ?>> |
12 | - <a href="<?php echo esc_url('?page=formidable-styles&page-tab=default#tabs-panel-button-default') ?>" class="nav-tab-link" data-type="tabs-panel-button-default" ><?php _e( 'Default', 'formidable' ) ?></a> |
|
12 | + <a href="<?php echo esc_url( '?page=formidable-styles&page-tab=default#tabs-panel-button-default' ) ?>" class="nav-tab-link" data-type="tabs-panel-button-default" ><?php _e( 'Default', 'formidable' ) ?></a> |
|
13 | 13 | </li> |
14 | 14 | <li <?php echo ( 'button-hover' == $current_tab ? ' class="tabs"' : '' ); ?>> |
15 | - <a href="<?php echo esc_url('?page=formidable-styles&page-tab=button-hover#page-button-hover') ?>" class="nav-tab-link" data-type="tabs-panel-button-hover" ><?php _e( 'Hover', 'formidable' ) ?></a> |
|
15 | + <a href="<?php echo esc_url( '?page=formidable-styles&page-tab=button-hover#page-button-hover' ) ?>" class="nav-tab-link" data-type="tabs-panel-button-hover" ><?php _e( 'Hover', 'formidable' ) ?></a> |
|
16 | 16 | </li> |
17 | 17 | <li <?php echo ( 'button-click' == $current_tab ? ' class="tabs"' : '' ); ?>> |
18 | 18 | <a href="?page=formidable-styles&page-tab=button-click#tabs-panel-button-click" class="nav-tab-link" data-type="tabs-panel-button-click"><?php _e( 'Click', 'formidable' ) ?></a> |
@@ -24,22 +24,22 @@ discard block |
||
24 | 24 | ?>"> |
25 | 25 | <div class="field-group field-group-border clearfix"> |
26 | 26 | <label><?php _e( 'Size', 'formidable' ) ?></label> |
27 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_font_size') ) ?>" id="frm_submit_font_size" value="<?php echo esc_attr( $style->post_content['submit_font_size'] ) ?>" size="3" /> |
|
27 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_font_size' ) ) ?>" id="frm_submit_font_size" value="<?php echo esc_attr( $style->post_content['submit_font_size'] ) ?>" size="3" /> |
|
28 | 28 | </div> |
29 | 29 | |
30 | 30 | <div class="field-group clearfix"> |
31 | 31 | <label><?php _e( 'Width', 'formidable' ) ?></label> |
32 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_width') ) ?>" id="frm_submit_width" value="<?php echo esc_attr( $style->post_content['submit_width'] ) ?>" size="5" /> |
|
32 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_width' ) ) ?>" id="frm_submit_width" value="<?php echo esc_attr( $style->post_content['submit_width'] ) ?>" size="5" /> |
|
33 | 33 | </div> |
34 | 34 | |
35 | 35 | <div class="field-group clearfix"> |
36 | 36 | <label><?php _e( 'Height', 'formidable' ) ?></label> |
37 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_height') ) ?>" id="frm_submit_height" value="<?php echo esc_attr( $style->post_content['submit_height'] ) ?>" size="5" /> |
|
37 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_height' ) ) ?>" id="frm_submit_height" value="<?php echo esc_attr( $style->post_content['submit_height'] ) ?>" size="5" /> |
|
38 | 38 | </div> |
39 | 39 | |
40 | 40 | <div class="field-group clearfix"> |
41 | 41 | <label><?php _e( 'Weight', 'formidable' ) ?></label> |
42 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('submit_weight') ) ?>" id="frm_submit_weight"> |
|
42 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_weight' ) ) ?>" id="frm_submit_weight"> |
|
43 | 43 | <?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?> |
44 | 44 | <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['submit_weight'], $value ) ?>><?php echo esc_html( $name ) ?></option> |
45 | 45 | <?php } ?> |
@@ -48,48 +48,48 @@ discard block |
||
48 | 48 | |
49 | 49 | <div class="field-group clearfix"> |
50 | 50 | <label><?php _e( 'Corners', 'formidable' ) ?></label> |
51 | - <input type="text" value="<?php echo esc_attr( $style->post_content['submit_border_radius'] ) ?>" name="<?php echo esc_attr( $frm_style->get_field_name('submit_border_radius') ) ?>" id="frm_submit_border_radius" size="4"/> |
|
51 | + <input type="text" value="<?php echo esc_attr( $style->post_content['submit_border_radius'] ) ?>" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_border_radius' ) ) ?>" id="frm_submit_border_radius" size="4"/> |
|
52 | 52 | </div> |
53 | 53 | |
54 | 54 | <div class="field-group field-group-border clearfix"> |
55 | 55 | <label><?php _e( 'BG Color', 'formidable' ) ?></label> |
56 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_bg_color') ) ?>" id="frm_submit_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_bg_color'] ) ?>" /> |
|
56 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_bg_color' ) ) ?>" id="frm_submit_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_bg_color'] ) ?>" /> |
|
57 | 57 | </div> |
58 | 58 | |
59 | 59 | <div class="field-group clearfix"> |
60 | 60 | <label><?php _e( 'Text', 'formidable' ) ?></label> |
61 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_text_color') ) ?>" id="frm_submit_text_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_text_color'] ) ?>" /> |
|
61 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_text_color' ) ) ?>" id="frm_submit_text_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_text_color'] ) ?>" /> |
|
62 | 62 | </div> |
63 | 63 | |
64 | 64 | <div class="field-group field-group-border clearfix"> |
65 | 65 | <label><?php _e( 'Border', 'formidable' ) ?></label> |
66 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_border_color') ) ?>" id="frm_submit_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_border_color'] ) ?>" /> |
|
66 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_border_color' ) ) ?>" id="frm_submit_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_border_color'] ) ?>" /> |
|
67 | 67 | </div> |
68 | 68 | |
69 | 69 | <div class="field-group clearfix"> |
70 | 70 | <label><?php _e( 'Thickness', 'formidable' ) ?></label> |
71 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_border_width') ) ?>" id="frm_submit_border_width" value="<?php echo esc_attr( $style->post_content['submit_border_width'] ) ?>" size="4" /> |
|
71 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_border_width' ) ) ?>" id="frm_submit_border_width" value="<?php echo esc_attr( $style->post_content['submit_border_width'] ) ?>" size="4" /> |
|
72 | 72 | </div> |
73 | 73 | |
74 | 74 | <div class="field-group clearfix"> |
75 | 75 | <label><?php _e( 'Shadow', 'formidable' ) ?></label> |
76 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_shadow_color') ) ?>" id="frm_submit_shadow_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_shadow_color'] ) ?>" /> |
|
76 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_shadow_color' ) ) ?>" id="frm_submit_shadow_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_shadow_color'] ) ?>" /> |
|
77 | 77 | </div> |
78 | 78 | |
79 | 79 | <div class="clear"></div> |
80 | 80 | <div class="field-group field-group-border frm-full"> |
81 | 81 | <label><?php _e( 'BG Image', 'formidable' ) ?></label> |
82 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_bg_img') ) ?>" id="frm_submit_bg_img" value="<?php echo esc_attr( $style->post_content['submit_bg_img'] ) ?>" /> |
|
82 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_bg_img' ) ) ?>" id="frm_submit_bg_img" value="<?php echo esc_attr( $style->post_content['submit_bg_img'] ) ?>" /> |
|
83 | 83 | </div> |
84 | 84 | |
85 | 85 | <div class="field-group field-group-border clearfix"> |
86 | 86 | <label><?php _e( 'Margin', 'formidable' ) ?></label> |
87 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_margin') ) ?>" id="frm_submit_margin" value="<?php echo esc_attr( $style->post_content['submit_margin'] ) ?>" size="6" /> |
|
87 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_margin' ) ) ?>" id="frm_submit_margin" value="<?php echo esc_attr( $style->post_content['submit_margin'] ) ?>" size="6" /> |
|
88 | 88 | </div> |
89 | 89 | |
90 | 90 | <div class="field-group clearfix"> |
91 | 91 | <label><?php _e( 'Padding', 'formidable' ) ?></label> |
92 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_padding') ) ?>" id="frm_submit_padding" value="<?php echo esc_attr( $style->post_content['submit_padding'] ) ?>" size="6" /> |
|
92 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_padding' ) ) ?>" id="frm_submit_padding" value="<?php echo esc_attr( $style->post_content['submit_padding'] ) ?>" size="6" /> |
|
93 | 93 | </div> |
94 | 94 | <div class="clear"></div> |
95 | 95 | </div><!-- /.tabs-panel --> |
@@ -99,17 +99,17 @@ discard block |
||
99 | 99 | ?>"> |
100 | 100 | <div class="field-group clearfix"> |
101 | 101 | <label><?php _e( 'BG Color', 'formidable' ) ?></label> |
102 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_hover_bg_color') ) ?>" id="frm_submit_hover_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_hover_bg_color'] ) ?>" /> |
|
102 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_hover_bg_color' ) ) ?>" id="frm_submit_hover_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_hover_bg_color'] ) ?>" /> |
|
103 | 103 | </div> |
104 | 104 | |
105 | 105 | <div class="field-group clearfix"> |
106 | 106 | <label><?php _e( 'Text', 'formidable' ) ?></label> |
107 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_hover_color') ) ?>" id="frm_submit_hover_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_hover_color'] ) ?>" /> |
|
107 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_hover_color' ) ) ?>" id="frm_submit_hover_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_hover_color'] ) ?>" /> |
|
108 | 108 | </div> |
109 | 109 | |
110 | 110 | <div class="field-group clearfix"> |
111 | 111 | <label><?php _e( 'Border', 'formidable' ) ?></label> |
112 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_hover_border_color') ) ?>" id="frm_submit_hover_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_hover_border_color'] ) ?>" /> |
|
112 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_hover_border_color' ) ) ?>" id="frm_submit_hover_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_hover_border_color'] ) ?>" /> |
|
113 | 113 | </div> |
114 | 114 | |
115 | 115 | <div class="clear"></div> |
@@ -120,17 +120,17 @@ discard block |
||
120 | 120 | ?>"> |
121 | 121 | <div class="field-group clearfix"> |
122 | 122 | <label><?php _e( 'BG Color', 'formidable' ) ?></label> |
123 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_active_bg_color') ) ?>" id="frm_submit_active_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_active_bg_color'] ) ?>" /> |
|
123 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_active_bg_color' ) ) ?>" id="frm_submit_active_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_active_bg_color'] ) ?>" /> |
|
124 | 124 | </div> |
125 | 125 | |
126 | 126 | <div class="field-group clearfix"> |
127 | 127 | <label><?php _e( 'Text', 'formidable' ) ?></label> |
128 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_active_color') ) ?>" id="frm_submit_active_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_active_color'] ) ?>" /> |
|
128 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_active_color' ) ) ?>" id="frm_submit_active_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_active_color'] ) ?>" /> |
|
129 | 129 | </div> |
130 | 130 | |
131 | 131 | <div class="field-group clearfix"> |
132 | 132 | <label><?php _e( 'Border', 'formidable' ) ?></label> |
133 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('submit_active_border_color') ) ?>" id="frm_submit_active_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_active_border_color'] ) ?>" /> |
|
133 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'submit_active_border_color' ) ) ?>" id="frm_submit_active_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['submit_active_border_color'] ) ?>" /> |
|
134 | 134 | </div> |
135 | 135 | |
136 | 136 | <div class="clear"></div> |