@@ -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,40 +54,40 @@ 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 | - } |
|
86 | - } |
|
85 | + } |
|
86 | + } |
|
87 | 87 | |
88 | 88 | $all_instances[ $number ] = $new_instance; |
89 | 89 | |
90 | - $action_ids[] = $this->save($new_instance); |
|
90 | + $action_ids[] = $this->save($new_instance); |
|
91 | 91 | |
92 | 92 | } |
93 | 93 | |
@@ -96,74 +96,74 @@ discard block |
||
96 | 96 | return $action_ids; |
97 | 97 | } |
98 | 98 | |
99 | - /** |
|
100 | - * Create static css file |
|
101 | - */ |
|
99 | + /** |
|
100 | + * Create static css file |
|
101 | + */ |
|
102 | 102 | public function save_settings( $styles ) { |
103 | - $filename = FrmAppHelper::plugin_path() .'/css/custom_theme.css.php'; |
|
103 | + $filename = FrmAppHelper::plugin_path() .'/css/custom_theme.css.php'; |
|
104 | 104 | |
105 | - if ( ! is_file($filename) ) { |
|
106 | - return; |
|
107 | - } |
|
105 | + if ( ! is_file($filename) ) { |
|
106 | + return; |
|
107 | + } |
|
108 | 108 | |
109 | - $defaults = $this->get_defaults(); |
|
110 | - $uploads = wp_upload_dir(); |
|
111 | - $target_path = $uploads['basedir'] .'/formidable'; |
|
112 | - $needed_dirs = array( $target_path, $target_path .'/css' ); |
|
113 | - $dirs_exist = true; |
|
109 | + $defaults = $this->get_defaults(); |
|
110 | + $uploads = wp_upload_dir(); |
|
111 | + $target_path = $uploads['basedir'] .'/formidable'; |
|
112 | + $needed_dirs = array( $target_path, $target_path .'/css' ); |
|
113 | + $dirs_exist = true; |
|
114 | 114 | |
115 | - $saving = true; |
|
116 | - $css = '/* '. __( 'WARNING: Any changes made to this file will be lost when your Formidable settings are updated', 'formidable' ) .' */'. "\n"; |
|
115 | + $saving = true; |
|
116 | + $css = '/* '. __( 'WARNING: Any changes made to this file will be lost when your Formidable settings are updated', 'formidable' ) .' */'. "\n"; |
|
117 | 117 | |
118 | - ob_start(); |
|
119 | - $frm_style = $this; |
|
120 | - include($filename); |
|
118 | + ob_start(); |
|
119 | + $frm_style = $this; |
|
120 | + include($filename); |
|
121 | 121 | $css .= preg_replace( '/\/\*(.|\s)*?\*\//', '', str_replace( array( "\r\n", "\r", "\n", "\t", ' ' ), '', ob_get_contents() ) ); |
122 | - ob_end_clean(); |
|
122 | + ob_end_clean(); |
|
123 | 123 | |
124 | - $access_type = get_filesystem_method(); |
|
125 | - if ( $access_type === 'direct' ) { |
|
126 | - $creds = request_filesystem_credentials( site_url() .'/wp-admin/', '', false, false, array() ); |
|
124 | + $access_type = get_filesystem_method(); |
|
125 | + if ( $access_type === 'direct' ) { |
|
126 | + $creds = request_filesystem_credentials( site_url() .'/wp-admin/', '', false, false, array() ); |
|
127 | 127 | } else { |
128 | 128 | $creds = $this->get_ftp_creds( $access_type ); |
129 | 129 | } |
130 | 130 | |
131 | 131 | if ( ! empty( $creds ) ) { |
132 | - // initialize the API |
|
133 | - if ( ! WP_Filesystem( $creds ) ) { |
|
134 | - // any problems and we exit |
|
135 | - $dirs_exist = false; |
|
132 | + // initialize the API |
|
133 | + if ( ! WP_Filesystem( $creds ) ) { |
|
134 | + // any problems and we exit |
|
135 | + $dirs_exist = false; |
|
136 | 136 | } |
137 | 137 | |
138 | - if ( $dirs_exist ) { |
|
139 | - global $wp_filesystem; |
|
138 | + if ( $dirs_exist ) { |
|
139 | + global $wp_filesystem; |
|
140 | 140 | |
141 | - $chmod_dir = defined('FS_CHMOD_DIR') ? FS_CHMOD_DIR : ( fileperms( ABSPATH ) & 0777 | 0755 ); |
|
142 | - $chmod_file = defined('FS_CHMOD_FILE') ? FS_CHMOD_FILE : ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ); |
|
141 | + $chmod_dir = defined('FS_CHMOD_DIR') ? FS_CHMOD_DIR : ( fileperms( ABSPATH ) & 0777 | 0755 ); |
|
142 | + $chmod_file = defined('FS_CHMOD_FILE') ? FS_CHMOD_FILE : ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ); |
|
143 | 143 | |
144 | - // Create the directories if need be: |
|
145 | - foreach ( $needed_dirs as $_dir ) { |
|
146 | - // Only check to see if the Dir exists upon creation failure. Less I/O this way. |
|
147 | - if ( ! $wp_filesystem->mkdir( $_dir, $chmod_dir ) && ! $wp_filesystem->is_dir( $_dir ) ) { |
|
148 | - $dirs_exist = false; |
|
149 | - } |
|
150 | - } |
|
144 | + // Create the directories if need be: |
|
145 | + foreach ( $needed_dirs as $_dir ) { |
|
146 | + // Only check to see if the Dir exists upon creation failure. Less I/O this way. |
|
147 | + if ( ! $wp_filesystem->mkdir( $_dir, $chmod_dir ) && ! $wp_filesystem->is_dir( $_dir ) ) { |
|
148 | + $dirs_exist = false; |
|
149 | + } |
|
150 | + } |
|
151 | 151 | |
152 | - $index_path = $target_path .'/index.php'; |
|
153 | - $wp_filesystem->put_contents( $index_path, "<?php\n// Silence is golden.\n?>", $chmod_file ); |
|
152 | + $index_path = $target_path .'/index.php'; |
|
153 | + $wp_filesystem->put_contents( $index_path, "<?php\n// Silence is golden.\n?>", $chmod_file ); |
|
154 | 154 | |
155 | - // only write the file if the folders exist |
|
156 | - if ( $dirs_exist ) { |
|
157 | - $css_file = $target_path .'/css/formidablepro.css'; |
|
158 | - $wp_filesystem->put_contents( $css_file, $css, $chmod_file ); |
|
159 | - } |
|
160 | - } |
|
161 | - } |
|
155 | + // only write the file if the folders exist |
|
156 | + if ( $dirs_exist ) { |
|
157 | + $css_file = $target_path .'/css/formidablepro.css'; |
|
158 | + $wp_filesystem->put_contents( $css_file, $css, $chmod_file ); |
|
159 | + } |
|
160 | + } |
|
161 | + } |
|
162 | 162 | |
163 | - update_option('frmpro_css', $css); |
|
163 | + update_option('frmpro_css', $css); |
|
164 | 164 | |
165 | - delete_transient('frmpro_css'); |
|
166 | - set_transient('frmpro_css', $css); |
|
165 | + delete_transient('frmpro_css'); |
|
166 | + set_transient('frmpro_css', $css); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | private function get_ftp_creds( $type ) { |
@@ -217,267 +217,267 @@ discard block |
||
217 | 217 | } |
218 | 218 | |
219 | 219 | public function destroy( $id ) { |
220 | - return wp_delete_post($id); |
|
221 | - } |
|
220 | + return wp_delete_post($id); |
|
221 | + } |
|
222 | 222 | |
223 | - public function get_one() { |
|
224 | - if ( 'default' == $this->id ) { |
|
225 | - $style = $this->get_default_style(); |
|
226 | - if ( $style ) { |
|
227 | - $this->id = $style->ID; |
|
228 | - } else { |
|
229 | - $this->id = 0; |
|
230 | - } |
|
231 | - return $style; |
|
232 | - } |
|
223 | + public function get_one() { |
|
224 | + if ( 'default' == $this->id ) { |
|
225 | + $style = $this->get_default_style(); |
|
226 | + if ( $style ) { |
|
227 | + $this->id = $style->ID; |
|
228 | + } else { |
|
229 | + $this->id = 0; |
|
230 | + } |
|
231 | + return $style; |
|
232 | + } |
|
233 | 233 | |
234 | - $style = get_post($this->id); |
|
234 | + $style = get_post($this->id); |
|
235 | 235 | |
236 | - if ( ! $style ) { |
|
237 | - return $style; |
|
238 | - } |
|
236 | + if ( ! $style ) { |
|
237 | + return $style; |
|
238 | + } |
|
239 | 239 | |
240 | - $style->post_content = FrmAppHelper::maybe_json_decode($style->post_content); |
|
240 | + $style->post_content = FrmAppHelper::maybe_json_decode($style->post_content); |
|
241 | 241 | |
242 | - $default_values = $this->get_defaults(); |
|
242 | + $default_values = $this->get_defaults(); |
|
243 | 243 | |
244 | - // fill default values |
|
245 | - $style->post_content = $this->override_defaults($style->post_content); |
|
246 | - $style->post_content = wp_parse_args( $style->post_content, $default_values); |
|
244 | + // fill default values |
|
245 | + $style->post_content = $this->override_defaults($style->post_content); |
|
246 | + $style->post_content = wp_parse_args( $style->post_content, $default_values); |
|
247 | 247 | |
248 | - return $style; |
|
249 | - } |
|
248 | + return $style; |
|
249 | + } |
|
250 | 250 | |
251 | - public function get_all( $orderby = 'title', $order = 'ASC', $limit = 99 ) { |
|
252 | - $post_atts = array( |
|
251 | + public function get_all( $orderby = 'title', $order = 'ASC', $limit = 99 ) { |
|
252 | + $post_atts = array( |
|
253 | 253 | 'post_type' => FrmStylesController::$post_type, |
254 | 254 | 'post_status' => 'publish', |
255 | 255 | 'numberposts' => $limit, |
256 | 256 | 'orderby' => $orderby, |
257 | 257 | 'order' => $order, |
258 | - ); |
|
259 | - |
|
260 | - $temp_styles = FrmAppHelper::check_cache(serialize($post_atts), 'frm_styles', $post_atts, 'get_posts'); |
|
261 | - |
|
262 | - if ( empty($temp_styles) ) { |
|
263 | - global $wpdb; |
|
264 | - // make sure there wasn't a conflict with the query |
|
265 | - $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'); |
|
266 | - $temp_styles = FrmAppHelper::check_cache('frm_backup_style_check', 'frm_styles', $query, 'get_results'); |
|
267 | - |
|
268 | - if ( empty($temp_styles) ) { |
|
269 | - // create a new style if there are none |
|
270 | - $new = $this->get_new(); |
|
271 | - $new->post_title = $new->post_name = __( 'Formidable Style', 'formidable' ); |
|
272 | - $new->menu_order = 1; |
|
273 | - $new = $this->save( (array) $new); |
|
274 | - $this->update('default'); |
|
275 | - |
|
276 | - $post_atts['include'] = $new; |
|
277 | - |
|
278 | - $temp_styles = get_posts( $post_atts ); |
|
279 | - } |
|
280 | - } |
|
281 | - |
|
282 | - $default_values = $this->get_defaults(); |
|
283 | - $default_style = false; |
|
284 | - |
|
285 | - $styles = array(); |
|
286 | - foreach ( $temp_styles as $style ) { |
|
287 | - $this->id = $style->ID; |
|
288 | - if ( $style->menu_order ) { |
|
289 | - if ( $default_style ) { |
|
290 | - // only return one default |
|
291 | - $style->menu_order = 0; |
|
292 | - } else { |
|
293 | - // check for a default style |
|
294 | - $default_style = $style->ID; |
|
295 | - } |
|
296 | - } |
|
297 | - |
|
298 | - $style->post_content = FrmAppHelper::maybe_json_decode($style->post_content); |
|
299 | - |
|
300 | - // fill default values |
|
301 | - $style->post_content = $this->override_defaults($style->post_content); |
|
302 | - $style->post_content = wp_parse_args( $style->post_content, $default_values); |
|
258 | + ); |
|
259 | + |
|
260 | + $temp_styles = FrmAppHelper::check_cache(serialize($post_atts), 'frm_styles', $post_atts, 'get_posts'); |
|
261 | + |
|
262 | + if ( empty($temp_styles) ) { |
|
263 | + global $wpdb; |
|
264 | + // make sure there wasn't a conflict with the query |
|
265 | + $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'); |
|
266 | + $temp_styles = FrmAppHelper::check_cache('frm_backup_style_check', 'frm_styles', $query, 'get_results'); |
|
267 | + |
|
268 | + if ( empty($temp_styles) ) { |
|
269 | + // create a new style if there are none |
|
270 | + $new = $this->get_new(); |
|
271 | + $new->post_title = $new->post_name = __( 'Formidable Style', 'formidable' ); |
|
272 | + $new->menu_order = 1; |
|
273 | + $new = $this->save( (array) $new); |
|
274 | + $this->update('default'); |
|
275 | + |
|
276 | + $post_atts['include'] = $new; |
|
277 | + |
|
278 | + $temp_styles = get_posts( $post_atts ); |
|
279 | + } |
|
280 | + } |
|
281 | + |
|
282 | + $default_values = $this->get_defaults(); |
|
283 | + $default_style = false; |
|
284 | + |
|
285 | + $styles = array(); |
|
286 | + foreach ( $temp_styles as $style ) { |
|
287 | + $this->id = $style->ID; |
|
288 | + if ( $style->menu_order ) { |
|
289 | + if ( $default_style ) { |
|
290 | + // only return one default |
|
291 | + $style->menu_order = 0; |
|
292 | + } else { |
|
293 | + // check for a default style |
|
294 | + $default_style = $style->ID; |
|
295 | + } |
|
296 | + } |
|
297 | + |
|
298 | + $style->post_content = FrmAppHelper::maybe_json_decode($style->post_content); |
|
299 | + |
|
300 | + // fill default values |
|
301 | + $style->post_content = $this->override_defaults($style->post_content); |
|
302 | + $style->post_content = wp_parse_args( $style->post_content, $default_values); |
|
303 | 303 | |
304 | 304 | $styles[ $style->ID ] = $style; |
305 | - } |
|
305 | + } |
|
306 | 306 | |
307 | - if ( ! $default_style ) { |
|
308 | - $default_style = reset($styles); |
|
307 | + if ( ! $default_style ) { |
|
308 | + $default_style = reset($styles); |
|
309 | 309 | $styles[ $default_style->ID ]->menu_order = 1; |
310 | - } |
|
310 | + } |
|
311 | 311 | |
312 | - return $styles; |
|
313 | - } |
|
312 | + return $styles; |
|
313 | + } |
|
314 | 314 | |
315 | 315 | public function get_default_style( $styles = null ) { |
316 | - if ( ! isset($styles) ) { |
|
316 | + if ( ! isset($styles) ) { |
|
317 | 317 | $styles = $this->get_all( 'menu_order', 'DESC', 1 ); |
318 | - } |
|
318 | + } |
|
319 | 319 | |
320 | - foreach ( $styles as $style ) { |
|
321 | - if ( $style->menu_order ) { |
|
322 | - return $style; |
|
323 | - } |
|
324 | - } |
|
325 | - } |
|
320 | + foreach ( $styles as $style ) { |
|
321 | + if ( $style->menu_order ) { |
|
322 | + return $style; |
|
323 | + } |
|
324 | + } |
|
325 | + } |
|
326 | 326 | |
327 | 327 | public function override_defaults( $settings ) { |
328 | - if ( ! is_array($settings) ) { |
|
329 | - return $settings; |
|
330 | - } |
|
331 | - |
|
332 | - $settings['line_height'] = ( ! isset($settings['field_height']) || $settings['field_height'] == '' || $settings['field_height'] == 'auto') ? 'normal' : $settings['field_height']; |
|
333 | - |
|
334 | - if ( ! isset($settings['form_desc_size']) && isset($settings['description_font_size']) ) { |
|
335 | - $settings['form_desc_size'] = $settings['description_font_size']; |
|
336 | - $settings['form_desc_color'] = $settings['description_color']; |
|
337 | - $settings['title_color'] = $settings['label_color']; |
|
338 | - } |
|
339 | - |
|
340 | - if ( ! isset($settings['section_color']) && isset($settings['label_color']) ) { |
|
341 | - $settings['section_color'] = $settings['label_color']; |
|
342 | - $settings['section_border_color'] = $settings['border_color']; |
|
343 | - } |
|
344 | - |
|
345 | - if ( ! isset($settings['submit_hover_bg_color']) && isset($settings['submit_bg_color']) ) { |
|
346 | - $settings['submit_hover_bg_color'] = $settings['submit_bg_color']; |
|
347 | - $settings['submit_hover_color'] = $settings['submit_text_color']; |
|
348 | - $settings['submit_hover_border_color'] = $settings['submit_border_color']; |
|
349 | - |
|
350 | - $settings['submit_active_bg_color'] = $settings['submit_bg_color']; |
|
351 | - $settings['submit_active_color'] = $settings['submit_text_color']; |
|
352 | - $settings['submit_active_border_color'] = $settings['submit_border_color']; |
|
353 | - } |
|
354 | - |
|
355 | - return $settings; |
|
328 | + if ( ! is_array($settings) ) { |
|
329 | + return $settings; |
|
330 | + } |
|
331 | + |
|
332 | + $settings['line_height'] = ( ! isset($settings['field_height']) || $settings['field_height'] == '' || $settings['field_height'] == 'auto') ? 'normal' : $settings['field_height']; |
|
333 | + |
|
334 | + if ( ! isset($settings['form_desc_size']) && isset($settings['description_font_size']) ) { |
|
335 | + $settings['form_desc_size'] = $settings['description_font_size']; |
|
336 | + $settings['form_desc_color'] = $settings['description_color']; |
|
337 | + $settings['title_color'] = $settings['label_color']; |
|
338 | + } |
|
339 | + |
|
340 | + if ( ! isset($settings['section_color']) && isset($settings['label_color']) ) { |
|
341 | + $settings['section_color'] = $settings['label_color']; |
|
342 | + $settings['section_border_color'] = $settings['border_color']; |
|
343 | + } |
|
344 | + |
|
345 | + if ( ! isset($settings['submit_hover_bg_color']) && isset($settings['submit_bg_color']) ) { |
|
346 | + $settings['submit_hover_bg_color'] = $settings['submit_bg_color']; |
|
347 | + $settings['submit_hover_color'] = $settings['submit_text_color']; |
|
348 | + $settings['submit_hover_border_color'] = $settings['submit_border_color']; |
|
349 | + |
|
350 | + $settings['submit_active_bg_color'] = $settings['submit_bg_color']; |
|
351 | + $settings['submit_active_color'] = $settings['submit_text_color']; |
|
352 | + $settings['submit_active_border_color'] = $settings['submit_border_color']; |
|
353 | + } |
|
354 | + |
|
355 | + return $settings; |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | public function get_defaults() { |
359 | - return array( |
|
360 | - 'theme_css' => 'ui-lightness', |
|
361 | - 'theme_name' => 'UI Lightness', |
|
359 | + return array( |
|
360 | + 'theme_css' => 'ui-lightness', |
|
361 | + 'theme_name' => 'UI Lightness', |
|
362 | 362 | |
363 | 363 | 'center_form' => '', |
364 | - 'form_width' => '100%', |
|
365 | - 'form_align' => 'left', |
|
366 | - 'direction' => is_rtl() ? 'rtl' : 'ltr', |
|
367 | - 'fieldset' => '0px', |
|
368 | - 'fieldset_color' => '000000', |
|
369 | - 'fieldset_padding' => '0 0 15px 0', |
|
370 | - 'fieldset_bg_color' => '', |
|
371 | - |
|
372 | - 'title_size' => '20px', |
|
373 | - 'title_color' => '444444', |
|
374 | - 'form_desc_size' => '14px', |
|
375 | - 'form_desc_color' => '666666', |
|
376 | - |
|
377 | - 'font' => '"Lucida Grande","Lucida Sans Unicode",Tahoma,sans-serif', |
|
378 | - 'font_size' => '14px', |
|
379 | - 'label_color' => '444444', |
|
380 | - 'weight' => 'bold', |
|
381 | - 'position' => 'none', |
|
382 | - 'align' => 'left', |
|
383 | - 'width' => '150px', |
|
384 | - 'required_color' => 'B94A48', |
|
385 | - 'required_weight' => 'bold', |
|
386 | - 'label_padding' => '0 0 3px 0', |
|
387 | - |
|
388 | - 'description_font_size' => '12px', |
|
389 | - 'description_color' => '666666', |
|
390 | - 'description_weight' => 'normal', |
|
391 | - 'description_style' => 'normal', |
|
392 | - 'description_align' => 'left', |
|
393 | - |
|
394 | - 'field_font_size' => '14px', |
|
395 | - 'field_height' => '32px', |
|
396 | - 'line_height' => 'normal', |
|
397 | - 'field_width' => '100%', |
|
398 | - 'auto_width' => false, |
|
399 | - 'field_pad' => '6px 10px', |
|
400 | - 'field_margin' => '20px', |
|
364 | + 'form_width' => '100%', |
|
365 | + 'form_align' => 'left', |
|
366 | + 'direction' => is_rtl() ? 'rtl' : 'ltr', |
|
367 | + 'fieldset' => '0px', |
|
368 | + 'fieldset_color' => '000000', |
|
369 | + 'fieldset_padding' => '0 0 15px 0', |
|
370 | + 'fieldset_bg_color' => '', |
|
371 | + |
|
372 | + 'title_size' => '20px', |
|
373 | + 'title_color' => '444444', |
|
374 | + 'form_desc_size' => '14px', |
|
375 | + 'form_desc_color' => '666666', |
|
376 | + |
|
377 | + 'font' => '"Lucida Grande","Lucida Sans Unicode",Tahoma,sans-serif', |
|
378 | + 'font_size' => '14px', |
|
379 | + 'label_color' => '444444', |
|
380 | + 'weight' => 'bold', |
|
381 | + 'position' => 'none', |
|
382 | + 'align' => 'left', |
|
383 | + 'width' => '150px', |
|
384 | + 'required_color' => 'B94A48', |
|
385 | + 'required_weight' => 'bold', |
|
386 | + 'label_padding' => '0 0 3px 0', |
|
387 | + |
|
388 | + 'description_font_size' => '12px', |
|
389 | + 'description_color' => '666666', |
|
390 | + 'description_weight' => 'normal', |
|
391 | + 'description_style' => 'normal', |
|
392 | + 'description_align' => 'left', |
|
393 | + |
|
394 | + 'field_font_size' => '14px', |
|
395 | + 'field_height' => '32px', |
|
396 | + 'line_height' => 'normal', |
|
397 | + 'field_width' => '100%', |
|
398 | + 'auto_width' => false, |
|
399 | + 'field_pad' => '6px 10px', |
|
400 | + 'field_margin' => '20px', |
|
401 | 401 | 'field_weight' => 'normal', |
402 | - 'text_color' => '555555', |
|
403 | - //'border_color_hv' => 'cccccc', |
|
404 | - 'border_color' => 'cccccc', |
|
405 | - 'field_border_width' => '1px', |
|
406 | - 'field_border_style' => 'solid', |
|
407 | - |
|
408 | - 'bg_color' => 'ffffff', |
|
409 | - //'bg_color_hv' => 'ffffff', |
|
402 | + 'text_color' => '555555', |
|
403 | + //'border_color_hv' => 'cccccc', |
|
404 | + 'border_color' => 'cccccc', |
|
405 | + 'field_border_width' => '1px', |
|
406 | + 'field_border_style' => 'solid', |
|
407 | + |
|
408 | + 'bg_color' => 'ffffff', |
|
409 | + //'bg_color_hv' => 'ffffff', |
|
410 | 410 | 'remove_box_shadow' => '', |
411 | - 'bg_color_active' => 'ffffff', |
|
411 | + 'bg_color_active' => 'ffffff', |
|
412 | 412 | 'border_color_active' => '66afe9', |
413 | 413 | 'remove_box_shadow_active' => '', |
414 | - 'text_color_error' => '444444', |
|
415 | - 'bg_color_error' => 'ffffff', |
|
414 | + 'text_color_error' => '444444', |
|
415 | + 'bg_color_error' => 'ffffff', |
|
416 | 416 | 'border_color_error' => 'B94A48', |
417 | 417 | 'border_width_error' => '1px', |
418 | 418 | 'border_style_error' => 'solid', |
419 | - 'bg_color_disabled' => 'ffffff', |
|
420 | - 'border_color_disabled' => 'E5E5E5', |
|
421 | - 'text_color_disabled' => 'A1A1A1', |
|
422 | - |
|
423 | - 'radio_align' => 'block', |
|
424 | - 'check_align' => 'block', |
|
425 | - 'check_font_size' => '13px', |
|
426 | - 'check_label_color' => '444444', |
|
427 | - 'check_weight' => 'normal', |
|
428 | - |
|
429 | - 'section_font_size' => '18px', |
|
430 | - 'section_color' => '444444', |
|
431 | - 'section_weight' => 'bold', |
|
432 | - 'section_pad' => '15px 0 3px 0', |
|
433 | - 'section_mar_top' => '15px', |
|
419 | + 'bg_color_disabled' => 'ffffff', |
|
420 | + 'border_color_disabled' => 'E5E5E5', |
|
421 | + 'text_color_disabled' => 'A1A1A1', |
|
422 | + |
|
423 | + 'radio_align' => 'block', |
|
424 | + 'check_align' => 'block', |
|
425 | + 'check_font_size' => '13px', |
|
426 | + 'check_label_color' => '444444', |
|
427 | + 'check_weight' => 'normal', |
|
428 | + |
|
429 | + 'section_font_size' => '18px', |
|
430 | + 'section_color' => '444444', |
|
431 | + 'section_weight' => 'bold', |
|
432 | + 'section_pad' => '15px 0 3px 0', |
|
433 | + 'section_mar_top' => '15px', |
|
434 | 434 | 'section_mar_bottom' => '12px', |
435 | - 'section_bg_color' => '', |
|
436 | - 'section_border_color' => 'e8e8e8', |
|
437 | - 'section_border_width' => '2px', |
|
438 | - 'section_border_style' => 'solid', |
|
439 | - 'section_border_loc' => '-top', |
|
440 | - 'collapse_icon' => '6', |
|
441 | - 'collapse_pos' => 'after', |
|
442 | - 'repeat_icon' => '1', |
|
443 | - |
|
444 | - 'submit_style' => false, |
|
445 | - 'submit_font_size' => '14px', |
|
446 | - 'submit_width' => 'auto', |
|
447 | - 'submit_height' => 'auto', |
|
448 | - 'submit_bg_color' => 'ffffff', |
|
449 | - 'submit_border_color' => 'cccccc', |
|
450 | - 'submit_border_width' => '1px', |
|
451 | - 'submit_text_color' => '444444', |
|
452 | - 'submit_weight' => 'normal', |
|
453 | - 'submit_border_radius' => '4px', |
|
454 | - 'submit_bg_img' => '', |
|
455 | - 'submit_margin' => '10px', |
|
456 | - 'submit_padding' => '6px 11px', |
|
457 | - 'submit_shadow_color' => 'eeeeee', |
|
458 | - 'submit_hover_bg_color' => 'efefef', |
|
459 | - 'submit_hover_color' => '444444', |
|
460 | - 'submit_hover_border_color' => 'cccccc', |
|
461 | - 'submit_active_bg_color' => 'efefef', |
|
462 | - 'submit_active_color' => '444444', |
|
463 | - 'submit_active_border_color' => 'cccccc', |
|
464 | - |
|
465 | - 'border_radius' => '4px', |
|
466 | - 'error_bg' => 'F2DEDE', |
|
467 | - 'error_border' => 'EBCCD1', |
|
468 | - 'error_text' => 'B94A48', |
|
469 | - 'error_font_size' => '14px', |
|
470 | - |
|
471 | - 'success_bg_color' => 'DFF0D8', |
|
472 | - 'success_border_color' => 'D6E9C6', |
|
473 | - 'success_text_color' => '468847', |
|
474 | - 'success_font_size' => '14px', |
|
475 | - |
|
476 | - 'important_style' => false, |
|
477 | - |
|
478 | - 'custom_css' => '', |
|
479 | - ); |
|
480 | - } |
|
435 | + 'section_bg_color' => '', |
|
436 | + 'section_border_color' => 'e8e8e8', |
|
437 | + 'section_border_width' => '2px', |
|
438 | + 'section_border_style' => 'solid', |
|
439 | + 'section_border_loc' => '-top', |
|
440 | + 'collapse_icon' => '6', |
|
441 | + 'collapse_pos' => 'after', |
|
442 | + 'repeat_icon' => '1', |
|
443 | + |
|
444 | + 'submit_style' => false, |
|
445 | + 'submit_font_size' => '14px', |
|
446 | + 'submit_width' => 'auto', |
|
447 | + 'submit_height' => 'auto', |
|
448 | + 'submit_bg_color' => 'ffffff', |
|
449 | + 'submit_border_color' => 'cccccc', |
|
450 | + 'submit_border_width' => '1px', |
|
451 | + 'submit_text_color' => '444444', |
|
452 | + 'submit_weight' => 'normal', |
|
453 | + 'submit_border_radius' => '4px', |
|
454 | + 'submit_bg_img' => '', |
|
455 | + 'submit_margin' => '10px', |
|
456 | + 'submit_padding' => '6px 11px', |
|
457 | + 'submit_shadow_color' => 'eeeeee', |
|
458 | + 'submit_hover_bg_color' => 'efefef', |
|
459 | + 'submit_hover_color' => '444444', |
|
460 | + 'submit_hover_border_color' => 'cccccc', |
|
461 | + 'submit_active_bg_color' => 'efefef', |
|
462 | + 'submit_active_color' => '444444', |
|
463 | + 'submit_active_border_color' => 'cccccc', |
|
464 | + |
|
465 | + 'border_radius' => '4px', |
|
466 | + 'error_bg' => 'F2DEDE', |
|
467 | + 'error_border' => 'EBCCD1', |
|
468 | + 'error_text' => 'B94A48', |
|
469 | + 'error_font_size' => '14px', |
|
470 | + |
|
471 | + 'success_bg_color' => 'DFF0D8', |
|
472 | + 'success_border_color' => 'D6E9C6', |
|
473 | + 'success_text_color' => '468847', |
|
474 | + 'success_font_size' => '14px', |
|
475 | + |
|
476 | + 'important_style' => false, |
|
477 | + |
|
478 | + 'custom_css' => '', |
|
479 | + ); |
|
480 | + } |
|
481 | 481 | |
482 | 482 | public function get_field_name( $field_name, $post_field = 'post_content' ) { |
483 | 483 | return 'frm_style_setting'. ( empty($post_field) ? '' : '['. $post_field .']' ) .'[' . $field_name . ']'; |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | <a href="?page=formidable-styles&page-tab=default#tabs-panel-default-color" class="nav-tab-link" data-type="tabs-panel-default-color"><?php _e( 'Default', 'formidable' ) ?></a> |
5 | 5 | </li> |
6 | 6 | <li <?php echo ( 'active-color' == $current_tab ? ' class="tabs"' : '' ); ?>> |
7 | - <a href="<?php echo esc_url('?page=formidable-styles&page-tab=active-color#page-active-color') ?>" class="nav-tab-link" data-type="tabs-panel-active-color"><?php _e( 'Active', 'formidable' ) ?></a> |
|
7 | + <a href="<?php echo esc_url( '?page=formidable-styles&page-tab=active-color#page-active-color' ) ?>" class="nav-tab-link" data-type="tabs-panel-active-color"><?php _e( 'Active', 'formidable' ) ?></a> |
|
8 | 8 | </li> |
9 | 9 | <li <?php echo ( 'active-error' == $current_tab ? ' class="tabs"' : '' ); ?>> |
10 | 10 | <a href="?page=formidable-styles&page-tab=active-error#tabs-panel-active-error" class="nav-tab-link" data-type="tabs-panel-active-error"><?php _e( 'Error', 'formidable' ) ?></a> |
@@ -19,34 +19,34 @@ discard block |
||
19 | 19 | ?>"> |
20 | 20 | <div class="field-group field-group-border clearfix"> |
21 | 21 | <label class="background"><?php _e( 'BG color', 'formidable' ) ?></label> |
22 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color') ) ?>" id="frm_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color'] ) ?>" /> |
|
22 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color' ) ) ?>" id="frm_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color'] ) ?>" /> |
|
23 | 23 | </div> |
24 | 24 | <div class="field-group clearfix"> |
25 | 25 | <label><?php _e( 'Text', 'formidable' ) ?></label> |
26 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('text_color') ) ?>" id="frm_text_color" class="hex" value="<?php echo esc_attr( $style->post_content['text_color'] ) ?>" /> |
|
26 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'text_color' ) ) ?>" id="frm_text_color" class="hex" value="<?php echo esc_attr( $style->post_content['text_color'] ) ?>" /> |
|
27 | 27 | </div> |
28 | 28 | |
29 | 29 | <div class="field-group field-group-border clearfix"> |
30 | 30 | <label><?php _e( 'Border', 'formidable' ) ?></label> |
31 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color') ) ?>" id="frm_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['border_color'] ) ?>" /> |
|
31 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color' ) ) ?>" id="frm_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['border_color'] ) ?>" /> |
|
32 | 32 | </div> |
33 | 33 | <div class="field-group clearfix"> |
34 | 34 | <label><?php _e( 'Thickness', 'formidable' ) ?></label> |
35 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_border_width') ) ?>" id="frm_field_border_width" value="<?php echo esc_attr( $style->post_content['field_border_width'] ) ?>" size="4" /> |
|
35 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_border_width' ) ) ?>" id="frm_field_border_width" value="<?php echo esc_attr( $style->post_content['field_border_width'] ) ?>" size="4" /> |
|
36 | 36 | </div> |
37 | 37 | <div class="field-group clearfix"> |
38 | 38 | <label><?php _e( 'Style', 'formidable' ) ?></label> |
39 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('field_border_style') ) ?>" id="frm_field_border_style"> |
|
40 | - <option value="solid" <?php selected($style->post_content['field_border_style'], 'solid') ?>><?php _e( 'solid', 'formidable' ) ?></option> |
|
41 | - <option value="dotted" <?php selected($style->post_content['field_border_style'], 'dotted') ?>><?php _e( 'dotted', 'formidable' ) ?></option> |
|
42 | - <option value="dashed" <?php selected($style->post_content['field_border_style'], 'dashed') ?>><?php _e( 'dashed', 'formidable' ) ?></option> |
|
43 | - <option value="double" <?php selected($style->post_content['field_border_style'], 'double') ?>><?php _e( 'double', 'formidable' ) ?></option> |
|
39 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'field_border_style' ) ) ?>" id="frm_field_border_style"> |
|
40 | + <option value="solid" <?php selected( $style->post_content['field_border_style'], 'solid' ) ?>><?php _e( 'solid', 'formidable' ) ?></option> |
|
41 | + <option value="dotted" <?php selected( $style->post_content['field_border_style'], 'dotted' ) ?>><?php _e( 'dotted', 'formidable' ) ?></option> |
|
42 | + <option value="dashed" <?php selected( $style->post_content['field_border_style'], 'dashed' ) ?>><?php _e( 'dashed', 'formidable' ) ?></option> |
|
43 | + <option value="double" <?php selected( $style->post_content['field_border_style'], 'double' ) ?>><?php _e( 'double', 'formidable' ) ?></option> |
|
44 | 44 | </select> |
45 | 45 | </div> |
46 | 46 | <div class="clear"></div> |
47 | 47 | <p class="frm_no_bottom_margin"> |
48 | 48 | <label> |
49 | - <input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('remove_box_shadow') ) ?>" id="frm_remove_box_shadow" value="1" <?php checked($style->post_content['remove_box_shadow'], 1) ?> /> |
|
49 | + <input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'remove_box_shadow' ) ) ?>" id="frm_remove_box_shadow" value="1" <?php checked( $style->post_content['remove_box_shadow'], 1 ) ?> /> |
|
50 | 50 | <?php _e( 'Remove box shadow', 'formidable' ) ?> |
51 | 51 | </label> |
52 | 52 | </p> |
@@ -57,16 +57,16 @@ discard block |
||
57 | 57 | ?>"> |
58 | 58 | <div class="field-group field-group-border clearfix"> |
59 | 59 | <label class="background"><?php _e( 'BG color', 'formidable' ) ?></label> |
60 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color_active') ) ?>" id="frm_bg_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_active'] ) ?>" /> |
|
60 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color_active' ) ) ?>" id="frm_bg_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_active'] ) ?>" /> |
|
61 | 61 | </div> |
62 | 62 | <div class="field-group clearfix"> |
63 | 63 | <label><?php _e( 'Border', 'formidable' ) ?></label> |
64 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color_active') ) ?>" id="frm_border_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_active'] ) ?>" /> |
|
64 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color_active' ) ) ?>" id="frm_border_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_active'] ) ?>" /> |
|
65 | 65 | </div> |
66 | 66 | <div class="clear"></div> |
67 | 67 | <p class="frm_no_bottom_margin"> |
68 | 68 | <label> |
69 | - <input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('remove_box_shadow_active') ) ?>" id="frm_remove_box_shadow_active" value="1" <?php checked($style->post_content['remove_box_shadow_active'], 1) ?> /> |
|
69 | + <input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'remove_box_shadow_active' ) ) ?>" id="frm_remove_box_shadow_active" value="1" <?php checked( $style->post_content['remove_box_shadow_active'], 1 ) ?> /> |
|
70 | 70 | <?php _e( 'Remove box shadow', 'formidable' ) ?> |
71 | 71 | </label> |
72 | 72 | </p> |
@@ -77,28 +77,28 @@ discard block |
||
77 | 77 | ?>"> |
78 | 78 | <div class="field-group field-group-border clearfix"> |
79 | 79 | <label class="background"><?php _e( 'BG color', 'formidable' ) ?></label> |
80 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color_error') ) ?>" id="frm_bg_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_error'] ) ?>" /> |
|
80 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color_error' ) ) ?>" id="frm_bg_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_error'] ) ?>" /> |
|
81 | 81 | </div> |
82 | 82 | <div class="field-group clearfix"> |
83 | 83 | <label><?php _e( 'Text', 'formidable' ) ?></label> |
84 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('text_color_error') ) ?>" id="frm_text_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_error'] ) ?>" /> |
|
84 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'text_color_error' ) ) ?>" id="frm_text_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_error'] ) ?>" /> |
|
85 | 85 | </div> |
86 | 86 | |
87 | 87 | <div class="field-group field-group-border clearfix"> |
88 | 88 | <label><?php _e( 'Border', 'formidable' ) ?></label> |
89 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color_error') ) ?>" id="frm_border_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_error'] ) ?>" /> |
|
89 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color_error' ) ) ?>" id="frm_border_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_error'] ) ?>" /> |
|
90 | 90 | </div> |
91 | 91 | <div class="field-group clearfix"> |
92 | 92 | <label><?php _e( 'Thickness', 'formidable' ) ?></label> |
93 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_width_error') ) ?>" id="frm_border_width_error" value="<?php echo esc_attr( $style->post_content['border_width_error'] ) ?>" size="4" /> |
|
93 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_width_error' ) ) ?>" id="frm_border_width_error" value="<?php echo esc_attr( $style->post_content['border_width_error'] ) ?>" size="4" /> |
|
94 | 94 | </div> |
95 | 95 | <div class="field-group clearfix"> |
96 | 96 | <label><?php _e( 'Style', 'formidable' ) ?></label> |
97 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('border_style_error') ) ?>" id="frm_border_style_error"> |
|
98 | - <option value="solid" <?php selected($style->post_content['border_style_error'], 'solid') ?>><?php _e( 'solid', 'formidable' ) ?></option> |
|
99 | - <option value="dotted" <?php selected($style->post_content['border_style_error'], 'dotted') ?>><?php _e( 'dotted', 'formidable' ) ?></option> |
|
100 | - <option value="dashed" <?php selected($style->post_content['border_style_error'], 'dashed') ?>><?php _e( 'dashed', 'formidable' ) ?></option> |
|
101 | - <option value="double" <?php selected($style->post_content['border_style_error'], 'double') ?>><?php _e( 'double', 'formidable' ) ?></option> |
|
97 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'border_style_error' ) ) ?>" id="frm_border_style_error"> |
|
98 | + <option value="solid" <?php selected( $style->post_content['border_style_error'], 'solid' ) ?>><?php _e( 'solid', 'formidable' ) ?></option> |
|
99 | + <option value="dotted" <?php selected( $style->post_content['border_style_error'], 'dotted' ) ?>><?php _e( 'dotted', 'formidable' ) ?></option> |
|
100 | + <option value="dashed" <?php selected( $style->post_content['border_style_error'], 'dashed' ) ?>><?php _e( 'dashed', 'formidable' ) ?></option> |
|
101 | + <option value="double" <?php selected( $style->post_content['border_style_error'], 'double' ) ?>><?php _e( 'double', 'formidable' ) ?></option> |
|
102 | 102 | </select> |
103 | 103 | </div> |
104 | 104 | |
@@ -110,16 +110,16 @@ discard block |
||
110 | 110 | ?>"> |
111 | 111 | <div class="field-group field-group-border clearfix"> |
112 | 112 | <label class="background"><?php _e( 'BG color', 'formidable' ) ?></label> |
113 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color_disabled') ) ?>" id="frm_bg_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_disabled'] ) ?>" /> |
|
113 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color_disabled' ) ) ?>" id="frm_bg_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_disabled'] ) ?>" /> |
|
114 | 114 | </div> |
115 | 115 | <div class="field-group clearfix"> |
116 | 116 | <label><?php _e( 'Text', 'formidable' ) ?></label> |
117 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('text_color_disabled') ) ?>" id="frm_text_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_disabled'] ) ?>" /> |
|
117 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'text_color_disabled' ) ) ?>" id="frm_text_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_disabled'] ) ?>" /> |
|
118 | 118 | </div> |
119 | 119 | |
120 | 120 | <div class="field-group clearfix"> |
121 | 121 | <label><?php _e( 'Border', 'formidable' ) ?></label> |
122 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color_disabled') ) ?>" id="frm_border_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_disabled'] ) ?>" /> |
|
122 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color_disabled' ) ) ?>" id="frm_border_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_disabled'] ) ?>" /> |
|
123 | 123 | </div> |
124 | 124 | <div class="clear"></div> |
125 | 125 | </div><!-- /.tabs-panel --> |
@@ -1,42 +1,42 @@ |
||
1 | 1 | <div class="field-group clearfix frm-first-row"> |
2 | 2 | <label><?php _e( 'Size', 'formidable' ) ?></label> |
3 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_font_size') ) ?>" id="frm_field_font_size" value="<?php echo esc_attr( $style->post_content['field_font_size'] ) ?>" /> |
|
3 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_font_size' ) ) ?>" id="frm_field_font_size" value="<?php echo esc_attr( $style->post_content['field_font_size'] ) ?>" /> |
|
4 | 4 | </div> |
5 | 5 | |
6 | 6 | <div class="field-group clearfix frm-first-row"> |
7 | 7 | <label><?php _e( 'Height', 'formidable' ) ?></label> |
8 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_height') ) ?>" id="frm_field_height" value="<?php echo esc_attr( $style->post_content['field_height'] ) ?>" /> |
|
8 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_height' ) ) ?>" id="frm_field_height" value="<?php echo esc_attr( $style->post_content['field_height'] ) ?>" /> |
|
9 | 9 | </div> |
10 | 10 | |
11 | 11 | <div class="field-group clearfix frm-first-row"> |
12 | 12 | <label><?php _e( 'Width', 'formidable' ) ?></label> |
13 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_width') ) ?>" id="frm_field_width" value="<?php echo esc_attr( $style->post_content['field_width'] ) ?>" /> |
|
13 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_width' ) ) ?>" id="frm_field_width" value="<?php echo esc_attr( $style->post_content['field_width'] ) ?>" /> |
|
14 | 14 | </div> |
15 | 15 | |
16 | 16 | <div class="clear"></div> |
17 | 17 | <p class="frm_no_bottom_margin"> |
18 | - <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('auto_width') ) ?>" id="frm_auto_width" value="1" <?php checked( $style->post_content['auto_width'], 1 ) ?> /> |
|
18 | + <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'auto_width' ) ) ?>" id="frm_auto_width" value="1" <?php checked( $style->post_content['auto_width'], 1 ) ?> /> |
|
19 | 19 | <?php _e( 'Automatic Width for drop-down fields', 'formidable' ) ?></label> |
20 | 20 | </p> |
21 | 21 | |
22 | 22 | <div class="field-group clearfix"> |
23 | 23 | <label><?php _e( 'Padding', 'formidable' ) ?></label> |
24 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_pad') ) ?>" id="frm_field_pad" value="<?php echo esc_attr( $style->post_content['field_pad'] ) ?>" /> |
|
24 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_pad' ) ) ?>" id="frm_field_pad" value="<?php echo esc_attr( $style->post_content['field_pad'] ) ?>" /> |
|
25 | 25 | </div> |
26 | 26 | |
27 | 27 | <div class="field-group clearfix"> |
28 | 28 | <label><?php _e( 'Margin', 'formidable' ) ?></label> |
29 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_margin') ) ?>" id="frm_field_margin" value="<?php echo esc_attr( $style->post_content['field_margin'] ) ?>" /> |
|
29 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_margin' ) ) ?>" id="frm_field_margin" value="<?php echo esc_attr( $style->post_content['field_margin'] ) ?>" /> |
|
30 | 30 | </div> |
31 | 31 | |
32 | 32 | <div class="field-group clearfix"> |
33 | 33 | <label><?php _e( 'Corners', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Formidable uses CSS3 border-radius for corner rounding, which is not currently supported by Internet Explorer.', 'formidable' ) ?>" ></span></label> |
34 | - <input type="text" value="<?php echo esc_attr( $style->post_content['border_radius'] ) ?>" name="<?php echo esc_attr( $frm_style->get_field_name('border_radius') ) ?>" id="frm_border_radius" /> |
|
34 | + <input type="text" value="<?php echo esc_attr( $style->post_content['border_radius'] ) ?>" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_radius' ) ) ?>" id="frm_border_radius" /> |
|
35 | 35 | </div> |
36 | 36 | |
37 | 37 | <div class="field-group clearfix frm-first-row"> |
38 | 38 | <label><?php _e( 'Weight', 'formidable' ) ?></label> |
39 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('field_weight') ) ?>" id="frm_field_weight"> |
|
39 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'field_weight' ) ) ?>" id="frm_field_weight"> |
|
40 | 40 | <?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?> |
41 | 41 | <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['field_weight'], $value ) ?>><?php echo $name ?></option> |
42 | 42 | <?php } ?> |
@@ -1,80 +1,80 @@ |
||
1 | 1 | <p> |
2 | - <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('center_form') ) ?>" id="frm_center_form" value="1" <?php checked($style->post_content['center_form'], 1) ?> /> |
|
2 | + <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'center_form' ) ) ?>" id="frm_center_form" value="1" <?php checked( $style->post_content['center_form'], 1 ) ?> /> |
|
3 | 3 | <?php _e( 'Center form on page', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'This will center your form on the page where it is published if the form width is less than the available width on the page.', 'formidable' ) ?>" ></span> |
4 | 4 | </label> |
5 | 5 | </p> |
6 | 6 | |
7 | 7 | <div class="field-group clearfix frm-first-row"> |
8 | 8 | <label><?php _e( 'Alignment', 'formidable' ) ?></label> |
9 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('form_align') ) ?>" id="frm_form_align"> |
|
10 | - <option value="left" <?php selected($style->post_content['form_align'], 'left') ?>><?php _e( 'left', 'formidable' ) ?></option> |
|
11 | - <option value="right" <?php selected($style->post_content['form_align'], 'right') ?>><?php _e( 'right', 'formidable' ) ?></option> |
|
12 | - <option value="center" <?php selected($style->post_content['form_align'], 'center') ?>><?php _e( 'center', 'formidable' ) ?></option> |
|
9 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'form_align' ) ) ?>" id="frm_form_align"> |
|
10 | + <option value="left" <?php selected( $style->post_content['form_align'], 'left' ) ?>><?php _e( 'left', 'formidable' ) ?></option> |
|
11 | + <option value="right" <?php selected( $style->post_content['form_align'], 'right' ) ?>><?php _e( 'right', 'formidable' ) ?></option> |
|
12 | + <option value="center" <?php selected( $style->post_content['form_align'], 'center' ) ?>><?php _e( 'center', 'formidable' ) ?></option> |
|
13 | 13 | </select> |
14 | 14 | </div> |
15 | 15 | |
16 | 16 | <div class="field-group clearfix frm-first-row"> |
17 | 17 | <label><?php _e( 'Max Width', 'formidable' ) ?></label> |
18 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_width') ) ?>" value="<?php echo esc_attr( $style->post_content['form_width'] ) ?>"/> |
|
18 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'form_width' ) ) ?>" value="<?php echo esc_attr( $style->post_content['form_width'] ) ?>"/> |
|
19 | 19 | </div> |
20 | 20 | |
21 | 21 | <div class="field-group clearfix frm-first-row"> |
22 | 22 | <label><?php _e( 'Background', 'formidable' ) ?></label> |
23 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset_bg_color') ) ?>" id="frm_fieldset_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_bg_color'] ) ?>" size="4" /> |
|
23 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset_bg_color' ) ) ?>" id="frm_fieldset_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_bg_color'] ) ?>" size="4" /> |
|
24 | 24 | </div> |
25 | 25 | |
26 | 26 | <div class="field-group field-group-border clearfix"> |
27 | 27 | <label><?php _e( 'Border', 'formidable' ) ?></label> |
28 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset') ) ?>" id="frm_fieldset" value="<?php echo esc_attr( $style->post_content['fieldset'] ) ?>" size="4" /> |
|
28 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset' ) ) ?>" id="frm_fieldset" value="<?php echo esc_attr( $style->post_content['fieldset'] ) ?>" size="4" /> |
|
29 | 29 | </div> |
30 | 30 | |
31 | 31 | <div class="field-group clearfix"> |
32 | 32 | <label><?php _e( 'Color', 'formidable' ) ?></label> |
33 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset_color') ) ?>" id="frm_fieldset_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_color'] ) ?>" /> |
|
33 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset_color' ) ) ?>" id="frm_fieldset_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_color'] ) ?>" /> |
|
34 | 34 | </div> |
35 | 35 | |
36 | 36 | <div class="field-group clearfix"> |
37 | 37 | <label><?php _e( 'Padding', 'formidable' ) ?></label> |
38 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset_padding') ) ?>" id="frm_fieldset_padding" value="<?php echo esc_attr( $style->post_content['fieldset_padding'] ) ?>" size="4" /> |
|
38 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset_padding' ) ) ?>" id="frm_fieldset_padding" value="<?php echo esc_attr( $style->post_content['fieldset_padding'] ) ?>" size="4" /> |
|
39 | 39 | </div> |
40 | 40 | |
41 | 41 | <div id="frm_gen_font_box" class="field-group clearfix"> |
42 | 42 | <label><?php _e( 'Font Family', 'formidable' ) ?></label> |
43 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('font') ) ?>" id="frm_font" value="<?php echo esc_attr( $style->post_content['font'] ) ?>" class="frm_full_width" /> |
|
43 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'font' ) ) ?>" id="frm_font" value="<?php echo esc_attr( $style->post_content['font'] ) ?>" class="frm_full_width" /> |
|
44 | 44 | </div> |
45 | 45 | |
46 | 46 | <div class="field-group clearfix frm-half"> |
47 | 47 | <label><?php _e( 'Direction', 'formidable' ) ?></label> |
48 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('direction') ) ?>" id="frm_direction"> |
|
49 | - <option value="ltr" <?php selected($style->post_content['direction'], 'ltr') ?>><?php _e( 'Left to Right', 'formidable' ) ?></option> |
|
50 | - <option value="rtl" <?php selected($style->post_content['direction'], 'rtl') ?>><?php _e( 'Right to Left', 'formidable' ) ?></option> |
|
48 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'direction' ) ) ?>" id="frm_direction"> |
|
49 | + <option value="ltr" <?php selected( $style->post_content['direction'], 'ltr' ) ?>><?php _e( 'Left to Right', 'formidable' ) ?></option> |
|
50 | + <option value="rtl" <?php selected( $style->post_content['direction'], 'rtl' ) ?>><?php _e( 'Right to Left', 'formidable' ) ?></option> |
|
51 | 51 | </select> |
52 | 52 | </div> |
53 | 53 | |
54 | 54 | <div class="clear"></div> |
55 | 55 | <div class="field-group clearfix frm-half"> |
56 | 56 | <label><?php _e( 'Title Size', 'formidable' ) ?></label> |
57 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_size') ) ?>" id="frm_title_size" value="<?php echo esc_attr( $style->post_content['title_size'] ) ?>" /> |
|
57 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'title_size' ) ) ?>" id="frm_title_size" value="<?php echo esc_attr( $style->post_content['title_size'] ) ?>" /> |
|
58 | 58 | </div> |
59 | 59 | |
60 | 60 | <div class="field-group clearfix frm-half"> |
61 | 61 | <label><?php _e( 'Color', 'formidable' ) ?></label> |
62 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_color') ) ?>" id="frm_title_color" class="hex" value="<?php echo esc_attr( $style->post_content['title_color'] ) ?>" /> |
|
62 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'title_color' ) ) ?>" id="frm_title_color" class="hex" value="<?php echo esc_attr( $style->post_content['title_color'] ) ?>" /> |
|
63 | 63 | </div> |
64 | 64 | |
65 | 65 | <div class="field-group clearfix frm-half"> |
66 | 66 | <label><?php _e( 'Description Size', 'formidable' ) ?></label> |
67 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_size') ) ?>" id="frm_form_desc_size" value="<?php echo esc_attr( $style->post_content['form_desc_size'] ) ?>" /> |
|
67 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'form_desc_size' ) ) ?>" id="frm_form_desc_size" value="<?php echo esc_attr( $style->post_content['form_desc_size'] ) ?>" /> |
|
68 | 68 | </div> |
69 | 69 | |
70 | 70 | <div class="field-group clearfix frm-half"> |
71 | 71 | <label><?php _e( 'Color', 'formidable' ) ?></label> |
72 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_color') ) ?>" id="frm_form_desc_color" class="hex" value="<?php echo esc_attr( $style->post_content['form_desc_color'] ) ?>" /> |
|
72 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'form_desc_color' ) ) ?>" id="frm_form_desc_color" class="hex" value="<?php echo esc_attr( $style->post_content['form_desc_color'] ) ?>" /> |
|
73 | 73 | </div> |
74 | 74 | |
75 | 75 | <div class="clear"></div> |
76 | 76 | <p class="frm_no_bottom_margin"> |
77 | - <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('important_style') ) ?>" id="frm_important_style" value="1" <?php checked($style->post_content['important_style'], 1) ?> /> |
|
77 | + <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'important_style' ) ) ?>" id="frm_important_style" value="1" <?php checked( $style->post_content['important_style'], 1 ) ?> /> |
|
78 | 78 | <?php _e( 'Override theme styling', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'This will add !important to many of the lines in the Formidable styling to make sure it will be used.', 'formidable' ) ?>" ></span> |
79 | 79 | </label> |
80 | 80 | </p> |