@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | if ( ! $item_ids ) { |
4 | - return; |
|
4 | + return; |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | // fetch 20 posts at a time rather than loading the entire table into memory |
@@ -45,6 +45,6 @@ discard block |
||
45 | 45 | <?php } ?> |
46 | 46 | </form> |
47 | 47 | <?php |
48 | - unset( $fields ); |
|
48 | + unset( $fields ); |
|
49 | 49 | } |
50 | 50 | } |
@@ -13,16 +13,16 @@ discard block |
||
13 | 13 | ?> |
14 | 14 | <form> |
15 | 15 | <id><?php echo $form->id ?></id> |
16 | - <form_key><?php echo FrmXMLHelper::cdata($form->form_key) ?></form_key> |
|
17 | - <name><?php echo FrmXMLHelper::cdata($form->name) ?></name> |
|
18 | - <description><?php echo FrmXMLHelper::cdata($form->description) ?></description> |
|
16 | + <form_key><?php echo FrmXMLHelper::cdata( $form->form_key ) ?></form_key> |
|
17 | + <name><?php echo FrmXMLHelper::cdata( $form->name ) ?></name> |
|
18 | + <description><?php echo FrmXMLHelper::cdata( $form->description ) ?></description> |
|
19 | 19 | <created_at><?php echo $form->created_at ?></created_at> |
20 | 20 | <logged_in><?php echo $form->logged_in ?></logged_in> |
21 | 21 | <is_template><?php echo $form->is_template ?></is_template> |
22 | 22 | <default_template><?php echo $form->default_template ?></default_template> |
23 | 23 | <editable><?php echo $form->editable ?></editable> |
24 | - <options><?php echo FrmXMLHelper::prepare_form_options_for_export($form->options) ?></options> |
|
25 | - <status><?php echo FrmXMLHelper::cdata($form->status) ?></status> |
|
24 | + <options><?php echo FrmXMLHelper::prepare_form_options_for_export( $form->options ) ?></options> |
|
25 | + <status><?php echo FrmXMLHelper::cdata( $form->status ) ?></status> |
|
26 | 26 | <parent_form_id><?php echo $form->parent_form_id ?></parent_form_id> |
27 | 27 | <?php |
28 | 28 | |
@@ -31,16 +31,16 @@ discard block |
||
31 | 31 | foreach ( $fields as $field ) { ?> |
32 | 32 | <field> |
33 | 33 | <id><?php echo $field->id ?></id> |
34 | - <field_key><?php echo FrmXMLHelper::cdata($field->field_key) ?></field_key> |
|
35 | - <name><?php echo FrmXMLHelper::cdata($field->name) ?></name> |
|
36 | - <description><?php echo FrmXMLHelper::cdata($field->description) ?></description> |
|
37 | - <type><?php echo FrmXMLHelper::cdata($field->type) ?></type> |
|
38 | - <default_value><?php echo FrmXMLHelper::cdata($field->default_value) ?></default_value> |
|
34 | + <field_key><?php echo FrmXMLHelper::cdata( $field->field_key ) ?></field_key> |
|
35 | + <name><?php echo FrmXMLHelper::cdata( $field->name ) ?></name> |
|
36 | + <description><?php echo FrmXMLHelper::cdata( $field->description ) ?></description> |
|
37 | + <type><?php echo FrmXMLHelper::cdata( $field->type ) ?></type> |
|
38 | + <default_value><?php echo FrmXMLHelper::cdata( $field->default_value ) ?></default_value> |
|
39 | 39 | <field_order><?php echo $field->field_order ?></field_order> |
40 | 40 | <form_id><?php echo $field->form_id ?></form_id> |
41 | 41 | <required><?php echo (bool) $field->required ?></required> |
42 | - <options><?php echo FrmXMLHelper::cdata($field->options) ?></options> |
|
43 | - <field_options><?php echo FrmXMLHelper::cdata($field->field_options) ?></field_options> |
|
42 | + <options><?php echo FrmXMLHelper::cdata( $field->options ) ?></options> |
|
43 | + <field_options><?php echo FrmXMLHelper::cdata( $field->field_options ) ?></field_options> |
|
44 | 44 | </field> |
45 | 45 | <?php } ?> |
46 | 46 | </form> |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | if ( ! $item_ids ) { |
4 | - return; |
|
4 | + return; |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | global $wp_query; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | if ( empty( $taxonomies ) ) { |
68 | - return; |
|
68 | + return; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | global $frm_inc_tax; |
@@ -75,18 +75,18 @@ discard block |
||
75 | 75 | |
76 | 76 | foreach ( (array) $terms as $term ) { |
77 | 77 | if ( in_array( $term->term_id, $frm_inc_tax ) ) { |
78 | - return; |
|
78 | + return; |
|
79 | 79 | } |
80 | 80 | |
81 | - $frm_inc_tax[] = $term->term_id; |
|
82 | - $label = ($term->taxonomy == 'category' || $term->taxonomy == 'tag') ? $term->taxonomy : 'term'; ?> |
|
81 | + $frm_inc_tax[] = $term->term_id; |
|
82 | + $label = ($term->taxonomy == 'category' || $term->taxonomy == 'tag') ? $term->taxonomy : 'term'; ?> |
|
83 | 83 | <term><term_id><?php echo $term->term_id ?></term_id><term_taxonomy><?php echo $term->taxonomy; ?></term_taxonomy><?php |
84 | - if ( ! empty( $term->name ) ) { |
|
85 | - echo '<term_name>' . FrmXMLHelper::cdata( $term->name ) . '</term_name>'; |
|
86 | - } |
|
87 | - if ( ! empty( $term->description ) ) { |
|
88 | - ?><term_description><?php echo FrmXMLHelper::cdata( $term->description ) ?></term_description><?php |
|
89 | - } |
|
90 | - ?><term_slug><?php echo $term->slug; ?></term_slug></term> |
|
84 | + if ( ! empty( $term->name ) ) { |
|
85 | + echo '<term_name>' . FrmXMLHelper::cdata( $term->name ) . '</term_name>'; |
|
86 | + } |
|
87 | + if ( ! empty( $term->description ) ) { |
|
88 | + ?><term_description><?php echo FrmXMLHelper::cdata( $term->description ) ?></term_description><?php |
|
89 | + } |
|
90 | + ?><term_slug><?php echo $term->slug; ?></term_slug></term> |
|
91 | 91 | <?php |
92 | 92 | } |
@@ -79,7 +79,7 @@ |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | $frm_inc_tax[] = $term->term_id; |
82 | - $label = ($term->taxonomy == 'category' || $term->taxonomy == 'tag') ? $term->taxonomy : 'term'; ?> |
|
82 | + $label = ( $term->taxonomy == 'category' || $term->taxonomy == 'tag' ) ? $term->taxonomy : 'term'; ?> |
|
83 | 83 | <term><term_id><?php echo $term->term_id ?></term_id><term_taxonomy><?php echo $term->taxonomy; ?></term_taxonomy><?php |
84 | 84 | if ( ! empty( $term->name ) ) { |
85 | 85 | echo '<term_name>' . FrmXMLHelper::cdata( $term->name ) . '</term_name>'; |
@@ -7,24 +7,24 @@ |
||
7 | 7 | <?php |
8 | 8 | foreach ( $type as $tb_type ) { |
9 | 9 | |
10 | - if ( ! isset( $tables[ $tb_type ] ) ) { |
|
11 | - do_action('frm_xml_import_'. $tb_type, $args); |
|
12 | - continue; |
|
13 | - } |
|
10 | + if ( ! isset( $tables[ $tb_type ] ) ) { |
|
11 | + do_action('frm_xml_import_'. $tb_type, $args); |
|
12 | + continue; |
|
13 | + } |
|
14 | 14 | |
15 | - //no records |
|
16 | - if ( ! isset( $records[ $tb_type ] ) ) { |
|
17 | - continue; |
|
18 | - } |
|
15 | + //no records |
|
16 | + if ( ! isset( $records[ $tb_type ] ) ) { |
|
17 | + continue; |
|
18 | + } |
|
19 | 19 | |
20 | 20 | $item_ids = $records[ $tb_type ]; |
21 | 21 | if ( in_array( $tb_type, array( 'styles', 'actions' ) ) ) { |
22 | - include(dirname(__FILE__) .'/posts_xml.php'); |
|
23 | - } else if ( file_exists(dirname(__FILE__) .'/'. $tb_type .'_xml.php') ) { |
|
24 | - include(dirname(__FILE__) .'/'. $tb_type .'_xml.php'); |
|
22 | + include(dirname(__FILE__) .'/posts_xml.php'); |
|
23 | + } else if ( file_exists(dirname(__FILE__) .'/'. $tb_type .'_xml.php') ) { |
|
24 | + include(dirname(__FILE__) .'/'. $tb_type .'_xml.php'); |
|
25 | 25 | } else if ( file_exists( FrmAppHelper::plugin_path() . '/pro/classes/views/xml/' . $tb_type . '_xml.php' ) ) { |
26 | - include( FrmAppHelper::plugin_path() .'/pro/classes/views/xml/'. $tb_type .'_xml.php' ); |
|
27 | - } |
|
26 | + include( FrmAppHelper::plugin_path() .'/pro/classes/views/xml/'. $tb_type .'_xml.php' ); |
|
27 | + } |
|
28 | 28 | |
29 | 29 | unset( $item_ids, $records[ $tb_type ], $tb_type ); |
30 | 30 | } |
@@ -7,26 +7,26 @@ |
||
7 | 7 | <?php |
8 | 8 | foreach ( $type as $tb_type ) { |
9 | 9 | |
10 | - if ( ! isset( $tables[ $tb_type ] ) ) { |
|
11 | - do_action('frm_xml_import_'. $tb_type, $args); |
|
10 | + if ( ! isset( $tables[$tb_type] ) ) { |
|
11 | + do_action( 'frm_xml_import_' . $tb_type, $args ); |
|
12 | 12 | continue; |
13 | 13 | } |
14 | 14 | |
15 | 15 | //no records |
16 | - if ( ! isset( $records[ $tb_type ] ) ) { |
|
16 | + if ( ! isset( $records[$tb_type] ) ) { |
|
17 | 17 | continue; |
18 | 18 | } |
19 | 19 | |
20 | - $item_ids = $records[ $tb_type ]; |
|
20 | + $item_ids = $records[$tb_type]; |
|
21 | 21 | if ( in_array( $tb_type, array( 'styles', 'actions' ) ) ) { |
22 | - include(dirname(__FILE__) .'/posts_xml.php'); |
|
23 | - } else if ( file_exists(dirname(__FILE__) .'/'. $tb_type .'_xml.php') ) { |
|
24 | - include(dirname(__FILE__) .'/'. $tb_type .'_xml.php'); |
|
22 | + include( dirname( __FILE__ ) . '/posts_xml.php' ); |
|
23 | + } else if ( file_exists( dirname( __FILE__ ) . '/' . $tb_type . '_xml.php' ) ) { |
|
24 | + include( dirname( __FILE__ ) . '/' . $tb_type . '_xml.php' ); |
|
25 | 25 | } else if ( file_exists( FrmAppHelper::plugin_path() . '/pro/classes/views/xml/' . $tb_type . '_xml.php' ) ) { |
26 | - include( FrmAppHelper::plugin_path() .'/pro/classes/views/xml/'. $tb_type .'_xml.php' ); |
|
26 | + include( FrmAppHelper::plugin_path() . '/pro/classes/views/xml/' . $tb_type . '_xml.php' ); |
|
27 | 27 | } |
28 | 28 | |
29 | - unset( $item_ids, $records[ $tb_type ], $tb_type ); |
|
29 | + unset( $item_ids, $records[$tb_type], $tb_type ); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | ?> |
@@ -8,14 +8,14 @@ discard block |
||
8 | 8 | } |
9 | 9 | |
10 | 10 | public function widget( $args, $instance ) { |
11 | - if ( empty($instance['title']) ) { |
|
12 | - $title = FrmForm::getName( $instance['form'] ); |
|
13 | - } else { |
|
14 | - $title = $instance['title']; |
|
15 | - } |
|
16 | - $title = apply_filters('widget_title', $title); |
|
11 | + if ( empty($instance['title']) ) { |
|
12 | + $title = FrmForm::getName( $instance['form'] ); |
|
13 | + } else { |
|
14 | + $title = $instance['title']; |
|
15 | + } |
|
16 | + $title = apply_filters('widget_title', $title); |
|
17 | 17 | |
18 | - $instance['description'] = isset($instance['description']) ? $instance['description'] : false; |
|
18 | + $instance['description'] = isset($instance['description']) ? $instance['description'] : false; |
|
19 | 19 | |
20 | 20 | echo $args['before_widget']; |
21 | 21 | |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | public function form( $instance ) { |
38 | - //Defaults |
|
38 | + //Defaults |
|
39 | 39 | $instance = wp_parse_args( (array) $instance, array( |
40 | - 'title' => false, 'form' => false, 'description' => false, |
|
40 | + 'title' => false, 'form' => false, 'description' => false, |
|
41 | 41 | ) ); |
42 | 42 | ?> |
43 | 43 | <p><label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php _e( 'Title', 'formidable' ) ?>:</label><br/> |
@@ -45,10 +45,10 @@ discard block |
||
45 | 45 | |
46 | 46 | <p><label for="<?php echo esc_attr( $this->get_field_id('form') ); ?>"><?php _e( 'Form', 'formidable' ) ?>:</label><br/> |
47 | 47 | <?php |
48 | - FrmFormsHelper::forms_dropdown( $this->get_field_name('form'), $instance['form'], array( |
|
49 | - 'blank' => false, 'field_id' => $this->get_field_id('form'), |
|
50 | - 'class' => 'widefat', |
|
51 | - ) ); |
|
48 | + FrmFormsHelper::forms_dropdown( $this->get_field_name('form'), $instance['form'], array( |
|
49 | + 'blank' => false, 'field_id' => $this->get_field_id('form'), |
|
50 | + 'class' => 'widefat', |
|
51 | + ) ); |
|
52 | 52 | ?> |
53 | 53 | </p> |
54 | 54 |
@@ -4,27 +4,27 @@ discard block |
||
4 | 4 | |
5 | 5 | public function __construct() { |
6 | 6 | $widget_ops = array( 'description' => __( 'Display a Formidable Form', 'formidable' ) ); |
7 | - parent::__construct('frm_show_form', __( 'Formidable Form', 'formidable' ), $widget_ops); |
|
7 | + parent::__construct( 'frm_show_form', __( 'Formidable Form', 'formidable' ), $widget_ops ); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | public function widget( $args, $instance ) { |
11 | - if ( empty($instance['title']) ) { |
|
11 | + if ( empty( $instance['title'] ) ) { |
|
12 | 12 | $title = FrmForm::getName( $instance['form'] ); |
13 | 13 | } else { |
14 | 14 | $title = $instance['title']; |
15 | 15 | } |
16 | - $title = apply_filters('widget_title', $title); |
|
16 | + $title = apply_filters( 'widget_title', $title ); |
|
17 | 17 | |
18 | - $instance['description'] = isset($instance['description']) ? $instance['description'] : false; |
|
18 | + $instance['description'] = isset( $instance['description'] ) ? $instance['description'] : false; |
|
19 | 19 | |
20 | 20 | echo $args['before_widget']; |
21 | 21 | |
22 | 22 | echo '<div class="frm_form_widget">'; |
23 | 23 | if ( $title ) { |
24 | - echo $args['before_title'] . stripslashes($title) . $args['after_title']; |
|
24 | + echo $args['before_title'] . stripslashes( $title ) . $args['after_title']; |
|
25 | 25 | } |
26 | 26 | |
27 | - echo FrmFormsController::show_form($instance['form'], '', false, $instance['description']); |
|
27 | + echo FrmFormsController::show_form( $instance['form'], '', false, $instance['description'] ); |
|
28 | 28 | |
29 | 29 | echo '</div>'; |
30 | 30 | echo $args['after_widget']; |
@@ -40,19 +40,19 @@ discard block |
||
40 | 40 | 'title' => false, 'form' => false, 'description' => false, |
41 | 41 | ) ); |
42 | 42 | ?> |
43 | - <p><label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php _e( 'Title', 'formidable' ) ?>:</label><br/> |
|
44 | - <input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id('title') ); ?>" name="<?php echo esc_attr( $this->get_field_name('title') ); ?>" value="<?php echo esc_attr( stripslashes($instance['title']) ); ?>" /></p> |
|
43 | + <p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title', 'formidable' ) ?>:</label><br/> |
|
44 | + <input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( stripslashes( $instance['title'] ) ); ?>" /></p> |
|
45 | 45 | |
46 | - <p><label for="<?php echo esc_attr( $this->get_field_id('form') ); ?>"><?php _e( 'Form', 'formidable' ) ?>:</label><br/> |
|
46 | + <p><label for="<?php echo esc_attr( $this->get_field_id( 'form' ) ); ?>"><?php _e( 'Form', 'formidable' ) ?>:</label><br/> |
|
47 | 47 | <?php |
48 | - FrmFormsHelper::forms_dropdown( $this->get_field_name('form'), $instance['form'], array( |
|
49 | - 'blank' => false, 'field_id' => $this->get_field_id('form'), |
|
48 | + FrmFormsHelper::forms_dropdown( $this->get_field_name( 'form' ), $instance['form'], array( |
|
49 | + 'blank' => false, 'field_id' => $this->get_field_id( 'form' ), |
|
50 | 50 | 'class' => 'widefat', |
51 | 51 | ) ); |
52 | 52 | ?> |
53 | 53 | </p> |
54 | 54 | |
55 | - <p><label for="<?php echo esc_attr( $this->get_field_id('description') ); ?>"><input class="checkbox" type="checkbox" <?php checked($instance['description'], true) ?> id="<?php echo esc_attr( $this->get_field_id('description') ); ?>" name="<?php echo esc_attr( $this->get_field_name('description') ); ?>" value="1" /> |
|
55 | + <p><label for="<?php echo esc_attr( $this->get_field_id( 'description' ) ); ?>"><input class="checkbox" type="checkbox" <?php checked( $instance['description'], true ) ?> id="<?php echo esc_attr( $this->get_field_id( 'description' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'description' ) ); ?>" value="1" /> |
|
56 | 56 | <?php _e( 'Show Description', 'formidable' ) ?></label></p> |
57 | 57 | <?php |
58 | 58 | } |
@@ -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 | - $style_class = 'frm_style_'. $style->post_name .'.with_frm_style'; |
|
22 | - extract($style->post_content); |
|
21 | + $style_class = 'frm_style_'. $style->post_name .'.with_frm_style'; |
|
22 | + extract($style->post_content); |
|
23 | 23 | } |
24 | 24 | |
25 | 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 ) ) { |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | color:#<?php echo esc_html( $text_color . $important ) ?>; |
324 | 324 | background-color:#<?php echo esc_html( $bg_color . $important ); ?>; |
325 | 325 | <?php if ( ! empty($important) ) { |
326 | - echo esc_html( 'background-image:none' . $important . ';' ); |
|
326 | + echo esc_html( 'background-image:none' . $important . ';' ); |
|
327 | 327 | } |
328 | 328 | ?> |
329 | 329 | border-color:#<?php echo esc_html( $border_color . $important ) ?>; |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | color:#<?php echo esc_html( $submit_active_color . $important ) ?>; |
531 | 531 | } |
532 | 532 | <?php |
533 | - } |
|
533 | + } |
|
534 | 534 | } |
535 | 535 | ?> |
536 | 536 | |
@@ -832,11 +832,11 @@ discard block |
||
832 | 832 | |
833 | 833 | .<?php echo esc_html( $style_class ) ?> .chosen-container-single .chosen-single div{ |
834 | 834 | <?php |
835 | - // calculate the top position based on field padding |
|
836 | - $top_pad = explode(' ', $field_pad); |
|
837 | - $top_pad = reset($top_pad); // the top padding is listed first |
|
838 | - $pad_unit = preg_replace('/[0-9]+/', '', $top_pad); //px, em, rem... |
|
839 | - $top_margin = (int) str_replace($pad_unit, '', $top_pad) / 2; |
|
835 | + // calculate the top position based on field padding |
|
836 | + $top_pad = explode(' ', $field_pad); |
|
837 | + $top_pad = reset($top_pad); // the top padding is listed first |
|
838 | + $pad_unit = preg_replace('/[0-9]+/', '', $top_pad); //px, em, rem... |
|
839 | + $top_margin = (int) str_replace($pad_unit, '', $top_pad) / 2; |
|
840 | 840 | ?> |
841 | 841 | top:<?php echo esc_html( $top_margin . $pad_unit . $important ) ?>; |
842 | 842 | } |
@@ -1,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if ( isset($_GET['frm_style_setting']) || isset($_GET['flat']) ) { |
|
3 | +if ( isset( $_GET['frm_style_setting'] ) || isset( $_GET['flat'] ) ) { |
|
4 | 4 | if ( isset( $_GET['frm_style_setting'] ) ) { |
5 | 5 | extract( $_GET['frm_style_setting']['post_content'] ); |
6 | 6 | } else { |
7 | - extract($_GET); |
|
7 | + extract( $_GET ); |
|
8 | 8 | } |
9 | 9 | |
10 | - $important_style = isset($important_style) ? $important_style : 0; |
|
11 | - $auto_width = isset($auto_width) ? $auto_width : 0; |
|
12 | - $submit_style = isset($submit_style) ? $submit_style : 0; |
|
10 | + $important_style = isset( $important_style ) ? $important_style : 0; |
|
11 | + $auto_width = isset( $auto_width ) ? $auto_width : 0; |
|
12 | + $submit_style = isset( $submit_style ) ? $submit_style : 0; |
|
13 | 13 | |
14 | 14 | $style_name = FrmAppHelper::simple_get( 'style_name', 'sanitize_title' ); |
15 | 15 | if ( ! empty( $style_name ) ) { |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | $style_class = 'with_frm_style'; |
19 | 19 | } |
20 | 20 | } else { |
21 | - $style_class = 'frm_style_'. $style->post_name .'.with_frm_style'; |
|
22 | - extract($style->post_content); |
|
21 | + $style_class = 'frm_style_' . $style->post_name . '.with_frm_style'; |
|
22 | + extract( $style->post_content ); |
|
23 | 23 | } |
24 | 24 | |
25 | -$important = empty($important_style) ? '' : ' !important'; |
|
25 | +$important = empty( $important_style ) ? '' : ' !important'; |
|
26 | 26 | $label_margin = (int) $width + 10; |
27 | 27 | |
28 | 28 | $minus_icons = FrmStylesHelper::minus_icons(); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $change_margin = 650 . 'px'; |
40 | 40 | } |
41 | 41 | |
42 | -if ( ! isset($collapse_icon) ) { |
|
42 | +if ( ! isset( $collapse_icon ) ) { |
|
43 | 43 | $collapse_icon = 0; |
44 | 44 | } |
45 | 45 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | border:<?php echo esc_html( $fieldset ) ?> solid #<?php echo esc_html( $fieldset_color . $important ) ?>; |
76 | 76 | margin:0; |
77 | 77 | padding:<?php echo esc_html( $fieldset_padding . $important ) ?>; |
78 | - background-color:<?php echo esc_html( empty($fieldset_bg_color) ? 'transparent' : '#'. $fieldset_bg_color ); ?>; |
|
78 | + background-color:<?php echo esc_html( empty( $fieldset_bg_color ) ? 'transparent' : '#' . $fieldset_bg_color ); ?>; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | .<?php echo esc_html( $style_class ) ?> .frm-show-form > h3{ |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | } |
116 | 116 | |
117 | 117 | .<?php echo esc_html( $style_class ) ?> .frm_repeat_sec{ |
118 | - margin-bottom:<?php echo esc_html( $field_margin. $important ) ?>; |
|
119 | - margin-top:<?php echo esc_html( $field_margin. $important ) ?>; |
|
118 | + margin-bottom:<?php echo esc_html( $field_margin . $important ) ?>; |
|
119 | + margin-top:<?php echo esc_html( $field_margin . $important ) ?>; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | .<?php echo esc_html( $style_class ) ?> label.frm_primary_label, |
@@ -137,11 +137,11 @@ discard block |
||
137 | 137 | } |
138 | 138 | |
139 | 139 | .<?php echo esc_html( $style_class ) ?> .frm_icon_font.frm_minus_icon:before{ |
140 | - content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['-'] : $minus_icons[1]['-'] ) ?>"; |
|
140 | + content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['-'] : $minus_icons[1]['-'] ) ?>"; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | .<?php echo esc_html( $style_class ) ?> .frm_icon_font.frm_plus_icon:before{ |
144 | - content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['+'] : $minus_icons[1]['+'] ) ?>"; |
|
144 | + content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['+'] : $minus_icons[1]['+'] ) ?>"; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | .<?php echo esc_html( $style_class ) ?> .frm_icon_font.frm_minus_icon:before, |
@@ -150,15 +150,15 @@ discard block |
||
150 | 150 | } |
151 | 151 | |
152 | 152 | .<?php echo esc_html( $style_class ) ?> .frm_trigger.active .frm_icon_font.frm_arrow_icon:before{ |
153 | - content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['-'] : $arrow_icons[1]['-'] ) ?>"; |
|
153 | + content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['-'] : $arrow_icons[1]['-'] ) ?>"; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | .<?php echo esc_html( $style_class ) ?> .frm_trigger .frm_icon_font.frm_arrow_icon:before{ |
157 | - content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['+'] : $arrow_icons[1]['+'] ) ?>"; |
|
157 | + content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['+'] : $arrow_icons[1]['+'] ) ?>"; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | .<?php echo esc_html( $style_class ) ?> .form-field{ |
161 | - margin-bottom:<?php echo esc_html( $field_margin. $important ) ?>; |
|
161 | + margin-bottom:<?php echo esc_html( $field_margin . $important ) ?>; |
|
162 | 162 | } |
163 | 163 | .<?php echo esc_html( $style_class ) ?> .frm_grid, |
164 | 164 | .<?php echo esc_html( $style_class ) ?> .frm_grid_first, |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | .<?php echo esc_html( $style_class ) ?> .frm_error{ |
177 | 177 | margin:0; |
178 | 178 | padding:0; |
179 | - font-family:<?php echo FrmAppHelper::kses( stripslashes($font) . $important ) ?>; |
|
179 | + font-family:<?php echo FrmAppHelper::kses( stripslashes( $font ) . $important ) ?>; |
|
180 | 180 | font-size:<?php echo esc_html( $description_font_size . $important ) ?>; |
181 | 181 | color:#<?php echo esc_html( $description_color . $important ) ?>; |
182 | 182 | font-weight:<?php echo esc_html( $description_weight . $important ) ?>; |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | } |
255 | 255 | |
256 | 256 | .<?php echo esc_html( $style_class ) ?> .form-field.frm_col_field div.frm_description{ |
257 | - width:<?php echo esc_html( ( $field_width == '' ? 'auto' : $field_width ) . $important ) ?>; |
|
257 | + width:<?php echo esc_html( ( $field_width == '' ? 'auto' : $field_width ) . $important ) ?>; |
|
258 | 258 | max-width:100%; |
259 | 259 | } |
260 | 260 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | |
280 | 280 | .<?php echo esc_html( $style_class ) ?> .frm_scale label{ |
281 | 281 | font-weight:<?php echo esc_html( $check_weight . $important ) ?>; |
282 | - font-family:<?php echo FrmAppHelper::kses( stripslashes($font) . $important ) ?>; |
|
282 | + font-family:<?php echo FrmAppHelper::kses( stripslashes( $font ) . $important ) ?>; |
|
283 | 283 | font-size:<?php echo esc_html( $check_font_size . $important ) ?>; |
284 | 284 | color:#<?php echo esc_html( $check_label_color . $important ) ?>; |
285 | 285 | } |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | .<?php echo esc_html( $style_class ) ?> select, |
300 | 300 | .<?php echo esc_html( $style_class ) ?> textarea, |
301 | 301 | .<?php echo esc_html( $style_class ) ?> .chosen-container{ |
302 | - font-family:<?php echo FrmAppHelper::kses( stripslashes($font) . $important ) ?>; |
|
302 | + font-family:<?php echo FrmAppHelper::kses( stripslashes( $font ) . $important ) ?>; |
|
303 | 303 | font-size:<?php echo esc_html( $field_font_size ) ?>; |
304 | 304 | margin-bottom:0<?php echo esc_html( $important ) ?>; |
305 | 305 | } |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | .<?php echo esc_html( $style_class ) ?> .chosen-container-single .chosen-single{ |
323 | 323 | color:#<?php echo esc_html( $text_color . $important ) ?>; |
324 | 324 | background-color:#<?php echo esc_html( $bg_color . $important ); ?>; |
325 | -<?php if ( ! empty($important) ) { |
|
325 | +<?php if ( ! empty( $important ) ) { |
|
326 | 326 | echo esc_html( 'background-image:none' . $important . ';' ); |
327 | 327 | } |
328 | 328 | ?> |
@@ -476,8 +476,8 @@ discard block |
||
476 | 476 | line-height:normal<?php echo esc_html( $important ) ?>; |
477 | 477 | text-align:center; |
478 | 478 | background:#<?php echo esc_html( $submit_bg_color ); |
479 | - if ( ! empty($submit_bg_img) ) { |
|
480 | - echo esc_html( ' url('. $submit_bg_img .')' ); |
|
479 | + if ( ! empty( $submit_bg_img ) ) { |
|
480 | + echo esc_html( ' url(' . $submit_bg_img . ')' ); |
|
481 | 481 | } |
482 | 482 | echo esc_html( $important ); ?>; |
483 | 483 | border-width:<?php echo esc_html( $submit_border_width ) ?>; |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | |
575 | 575 | .<?php echo esc_html( $style_class ) ?> .frm_radio label, |
576 | 576 | .<?php echo esc_html( $style_class ) ?> .frm_checkbox label{ |
577 | - font-family:<?php echo FrmAppHelper::kses( stripslashes($font) . $important ) ?>; |
|
577 | + font-family:<?php echo FrmAppHelper::kses( stripslashes( $font ) . $important ) ?>; |
|
578 | 578 | font-size:<?php echo esc_html( $check_font_size . $important ) ?>; |
579 | 579 | color:#<?php echo esc_html( $check_label_color . $important ) ?>; |
580 | 580 | font-weight:<?php echo esc_html( $check_weight . $important ) ?>; |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | -webkit-border-radius:<?php echo esc_html( $border_radius . $important ) ?>; |
715 | 715 | border-radius:<?php echo esc_html( $border_radius . $important ) ?>; |
716 | 716 | font-size:<?php echo esc_html( $submit_font_size . $important ) ?>; |
717 | - font-family:<?php echo FrmAppHelper::kses( stripslashes($font) . $important ) ?>; |
|
717 | + font-family:<?php echo FrmAppHelper::kses( stripslashes( $font ) . $important ) ?>; |
|
718 | 718 | font-weight:<?php echo esc_html( $submit_weight . $important ) ?>; |
719 | 719 | color:#<?php echo esc_html( $submit_text_color . $important ) ?>; |
720 | 720 | background:#<?php echo esc_html( $submit_bg_color . $important ) ?>; |
@@ -833,10 +833,10 @@ discard block |
||
833 | 833 | .<?php echo esc_html( $style_class ) ?> .chosen-container-single .chosen-single div{ |
834 | 834 | <?php |
835 | 835 | // calculate the top position based on field padding |
836 | - $top_pad = explode(' ', $field_pad); |
|
837 | - $top_pad = reset($top_pad); // the top padding is listed first |
|
838 | - $pad_unit = preg_replace('/[0-9]+/', '', $top_pad); //px, em, rem... |
|
839 | - $top_margin = (int) str_replace($pad_unit, '', $top_pad) / 2; |
|
836 | + $top_pad = explode( ' ', $field_pad ); |
|
837 | + $top_pad = reset( $top_pad ); // the top padding is listed first |
|
838 | + $pad_unit = preg_replace( '/[0-9]+/', '', $top_pad ); //px, em, rem... |
|
839 | + $top_margin = (int) str_replace( $pad_unit, '', $top_pad ) / 2; |
|
840 | 840 | ?> |
841 | 841 | top:<?php echo esc_html( $top_margin . $pad_unit . $important ) ?>; |
842 | 842 | } |
@@ -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(); |
@@ -178,8 +178,8 @@ discard block |
||
178 | 178 | |
179 | 179 | <?php |
180 | 180 | foreach ( $styles as $style ) { |
181 | - include(dirname(__FILE__) .'/_single_theme.css.php'); |
|
182 | - unset($style); |
|
181 | + include(dirname(__FILE__) .'/_single_theme.css.php'); |
|
182 | + unset($style); |
|
183 | 183 | } |
184 | 184 | ?> |
185 | 185 |
@@ -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 | |
@@ -178,8 +178,8 @@ discard block |
||
178 | 178 | |
179 | 179 | <?php |
180 | 180 | foreach ( $styles as $style ) { |
181 | - include(dirname(__FILE__) .'/_single_theme.css.php'); |
|
182 | - unset($style); |
|
181 | + include( dirname( __FILE__ ) . '/_single_theme.css.php' ); |
|
182 | + unset( $style ); |
|
183 | 183 | } |
184 | 184 | ?> |
185 | 185 | |
@@ -1162,7 +1162,7 @@ discard block |
||
1162 | 1162 | -moz-border-radius:<?php echo $defaults['border_radius'] ?>; |
1163 | 1163 | -webkit-border-radius:<?php echo $defaults['border_radius'] ?>; |
1164 | 1164 | border-radius:<?php echo $defaults['border_radius'] ?>; |
1165 | - width:<?php echo ($defaults['field_width'] == '' ? 'auto' : $defaults['field_width']) ?>; |
|
1165 | + width:<?php echo ( $defaults['field_width'] == '' ? 'auto' : $defaults['field_width'] ) ?>; |
|
1166 | 1166 | max-width:100%; |
1167 | 1167 | font-size:<?php echo $defaults['field_font_size'] ?>; |
1168 | 1168 | padding:<?php echo $defaults['field_pad'] ?>; |
@@ -1735,7 +1735,7 @@ discard block |
||
1735 | 1735 | font-style:normal; |
1736 | 1736 | } |
1737 | 1737 | |
1738 | -<?php include(FrmAppHelper::plugin_path() .'/css/font_icons.css'); ?> |
|
1738 | +<?php include( FrmAppHelper::plugin_path() . '/css/font_icons.css' ); ?> |
|
1739 | 1739 | |
1740 | 1740 | /* Responsive */ |
1741 | 1741 | @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi){ |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | // 2.0 |
4 | 4 | if ( ! isset($frm_vars['pro_is_installed']) ) { |
5 | - $frm_vars['pro_is_installed'] = false; |
|
5 | + $frm_vars['pro_is_installed'] = false; |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | // Instansiate Models |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // 2.0 |
4 | -if ( ! isset($frm_vars['pro_is_installed']) ) { |
|
4 | +if ( ! isset( $frm_vars['pro_is_installed'] ) ) { |
|
5 | 5 | $frm_vars['pro_is_installed'] = false; |
6 | 6 | } |
7 | 7 |
@@ -23,41 +23,41 @@ discard block |
||
23 | 23 | |
24 | 24 | global $frm_vars; |
25 | 25 | $frm_vars = array( |
26 | - 'load_css' => false, 'forms_loaded' => array(), |
|
27 | - 'created_entries' => array(), |
|
28 | - 'pro_is_authorized' => false, |
|
26 | + 'load_css' => false, 'forms_loaded' => array(), |
|
27 | + 'created_entries' => array(), |
|
28 | + 'pro_is_authorized' => false, |
|
29 | 29 | ); |
30 | 30 | |
31 | 31 | function frm_forms_autoloader( $class_name ) { |
32 | - // Only load Frm classes here |
|
32 | + // Only load Frm classes here |
|
33 | 33 | if ( ! preg_match( '/^Frm.+$/', $class_name ) ) { |
34 | - return; |
|
35 | - } |
|
34 | + return; |
|
35 | + } |
|
36 | 36 | |
37 | - $filepath = dirname(__FILE__); |
|
37 | + $filepath = dirname(__FILE__); |
|
38 | 38 | if ( preg_match( '/^FrmPro.+$/', $class_name ) || 'FrmUpdatesController' == $class_name ) { |
39 | - $filepath .= '/pro'; |
|
40 | - } |
|
41 | - $filepath .= '/classes'; |
|
39 | + $filepath .= '/pro'; |
|
40 | + } |
|
41 | + $filepath .= '/classes'; |
|
42 | 42 | |
43 | 43 | if ( preg_match( '/^.+Helper$/', $class_name ) ) { |
44 | - $filepath .= '/helpers/'; |
|
44 | + $filepath .= '/helpers/'; |
|
45 | 45 | } else if ( preg_match( '/^.+Controller$/', $class_name ) ) { |
46 | - $filepath .= '/controllers/'; |
|
47 | - } else { |
|
48 | - $filepath .= '/models/'; |
|
49 | - } |
|
46 | + $filepath .= '/controllers/'; |
|
47 | + } else { |
|
48 | + $filepath .= '/models/'; |
|
49 | + } |
|
50 | 50 | |
51 | - $filepath .= $class_name .'.php'; |
|
51 | + $filepath .= $class_name .'.php'; |
|
52 | 52 | |
53 | - if ( file_exists($filepath) ) { |
|
54 | - include($filepath); |
|
55 | - } |
|
53 | + if ( file_exists($filepath) ) { |
|
54 | + include($filepath); |
|
55 | + } |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | // if __autoload is active, put it on the spl_autoload stack |
59 | 59 | if ( is_array(spl_autoload_functions()) && in_array( '__autoload', spl_autoload_functions()) ) { |
60 | - spl_autoload_register('__autoload'); |
|
60 | + spl_autoload_register('__autoload'); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | // Add the autoloader |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | $frm_path = dirname(__FILE__); |
67 | 67 | if ( file_exists($frm_path . '/pro/formidable-pro.php') ) { |
68 | - include($frm_path .'/pro/formidable-pro.php'); |
|
68 | + include($frm_path .'/pro/formidable-pro.php'); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | FrmHooksController::trigger_load_hook(); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | return; |
35 | 35 | } |
36 | 36 | |
37 | - $filepath = dirname(__FILE__); |
|
37 | + $filepath = dirname( __FILE__ ); |
|
38 | 38 | if ( preg_match( '/^FrmPro.+$/', $class_name ) || 'FrmUpdatesController' == $class_name ) { |
39 | 39 | $filepath .= '/pro'; |
40 | 40 | } |
@@ -48,27 +48,27 @@ discard block |
||
48 | 48 | $filepath .= '/models/'; |
49 | 49 | } |
50 | 50 | |
51 | - $filepath .= $class_name .'.php'; |
|
51 | + $filepath .= $class_name . '.php'; |
|
52 | 52 | |
53 | - if ( file_exists($filepath) ) { |
|
54 | - include($filepath); |
|
53 | + if ( file_exists( $filepath ) ) { |
|
54 | + include( $filepath ); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
58 | 58 | // if __autoload is active, put it on the spl_autoload stack |
59 | -if ( is_array(spl_autoload_functions()) && in_array( '__autoload', spl_autoload_functions()) ) { |
|
60 | - spl_autoload_register('__autoload'); |
|
59 | +if ( is_array( spl_autoload_functions() ) && in_array( '__autoload', spl_autoload_functions() ) ) { |
|
60 | + spl_autoload_register( '__autoload' ); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | // Add the autoloader |
64 | -spl_autoload_register('frm_forms_autoloader'); |
|
64 | +spl_autoload_register( 'frm_forms_autoloader' ); |
|
65 | 65 | |
66 | -$frm_path = dirname(__FILE__); |
|
67 | -if ( file_exists($frm_path . '/pro/formidable-pro.php') ) { |
|
68 | - include($frm_path .'/pro/formidable-pro.php'); |
|
66 | +$frm_path = dirname( __FILE__ ); |
|
67 | +if ( file_exists( $frm_path . '/pro/formidable-pro.php' ) ) { |
|
68 | + include( $frm_path . '/pro/formidable-pro.php' ); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | FrmHooksController::trigger_load_hook(); |
72 | 72 | |
73 | -include_once($frm_path .'/deprecated.php'); |
|
74 | -unset($frm_path); |
|
73 | +include_once( $frm_path . '/deprecated.php' ); |
|
74 | +unset( $frm_path ); |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined('ABSPATH') ) { |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | 3 | die( 'You are not allowed to call this page directly.' ); |
4 | 4 | } |
5 | 5 |