@@ -1,11 +1,11 @@ |
||
1 | -<div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class($values); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container" <?php echo apply_filters( 'frm_form_div_attributes', '', $form ); ?>> |
|
1 | +<div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class( $values ); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container" <?php echo apply_filters( 'frm_form_div_attributes', '', $form ); ?>> |
|
2 | 2 | <?php |
3 | 3 | if ( ! isset( $include_form_tag ) || $include_form_tag ) { |
4 | 4 | ?> |
5 | -<form enctype="<?php echo esc_attr( apply_filters( 'frm_form_enctype', 'multipart/form-data', $form ) ) ?>" method="post" class="frm-show-form <?php do_action('frm_form_classes', $form) ?>" id="form_<?php echo esc_attr( $form->form_key ) ?>" <?php echo $frm_settings->use_html ? '' : 'action=""'; ?> <?php echo apply_filters( 'frm_form_attributes', '', $form ); ?>> |
|
5 | +<form enctype="<?php echo esc_attr( apply_filters( 'frm_form_enctype', 'multipart/form-data', $form ) ) ?>" method="post" class="frm-show-form <?php do_action( 'frm_form_classes', $form ) ?>" id="form_<?php echo esc_attr( $form->form_key ) ?>" <?php echo $frm_settings->use_html ? '' : 'action=""'; ?> <?php echo apply_filters( 'frm_form_attributes', '', $form ); ?>> |
|
6 | 6 | <?php |
7 | 7 | } else { ?> |
8 | -<div id="form_<?php echo esc_attr( $form->form_key ) ?>" class="frm-show-form <?php do_action('frm_form_classes', $form) ?>" > |
|
8 | +<div id="form_<?php echo esc_attr( $form->form_key ) ?>" class="frm-show-form <?php do_action( 'frm_form_classes', $form ) ?>" > |
|
9 | 9 | <?php |
10 | 10 | } |
11 | 11 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | } |
9 | 9 | |
10 | 10 | public function widget( $args, $instance ) { |
11 | - $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); |
|
11 | + $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); |
|
12 | 12 | |
13 | 13 | echo $args['before_widget']; |
14 | 14 | |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | public function form( $instance ) { |
37 | - //Defaults |
|
37 | + //Defaults |
|
38 | 38 | $instance = wp_parse_args( (array) $instance, array( |
39 | - 'title' => false, 'form' => false, 'description' => false, |
|
39 | + 'title' => false, 'form' => false, 'description' => false, |
|
40 | 40 | ) ); |
41 | 41 | ?> |
42 | 42 | <p><label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php _e( 'Title', 'formidable' ) ?>:</label><br/> |
@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | |
45 | 45 | <p><label for="<?php echo esc_attr( $this->get_field_id('form') ); ?>"><?php _e( 'Form', 'formidable' ) ?>:</label><br/> |
46 | 46 | <?php |
47 | - FrmFormsHelper::forms_dropdown( $this->get_field_name('form'), $instance['form'], array( |
|
48 | - 'blank' => false, 'field_id' => $this->get_field_id('form'), |
|
49 | - 'class' => 'widefat', |
|
50 | - ) ); |
|
47 | + FrmFormsHelper::forms_dropdown( $this->get_field_name('form'), $instance['form'], array( |
|
48 | + 'blank' => false, 'field_id' => $this->get_field_id('form'), |
|
49 | + 'class' => 'widefat', |
|
50 | + ) ); |
|
51 | 51 | ?> |
52 | 52 | </p> |
53 | 53 |
@@ -4,7 +4,7 @@ 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 ) { |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | echo '<div class="frm_form_widget">'; |
16 | 16 | if ( $title ) { |
17 | - echo $args['before_title'] . stripslashes($title) . $args['after_title']; |
|
17 | + echo $args['before_title'] . stripslashes( $title ) . $args['after_title']; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | $form_atts = array( |
@@ -39,19 +39,19 @@ discard block |
||
39 | 39 | 'title' => false, 'form' => false, 'description' => false, |
40 | 40 | ) ); |
41 | 41 | ?> |
42 | - <p><label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php _e( 'Title', 'formidable' ) ?>:</label><br/> |
|
43 | - <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> |
|
42 | + <p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title', 'formidable' ) ?>:</label><br/> |
|
43 | + <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> |
|
44 | 44 | |
45 | - <p><label for="<?php echo esc_attr( $this->get_field_id('form') ); ?>"><?php _e( 'Form', 'formidable' ) ?>:</label><br/> |
|
45 | + <p><label for="<?php echo esc_attr( $this->get_field_id( 'form' ) ); ?>"><?php _e( 'Form', 'formidable' ) ?>:</label><br/> |
|
46 | 46 | <?php |
47 | - FrmFormsHelper::forms_dropdown( $this->get_field_name('form'), $instance['form'], array( |
|
48 | - 'blank' => false, 'field_id' => $this->get_field_id('form'), |
|
47 | + FrmFormsHelper::forms_dropdown( $this->get_field_name( 'form' ), $instance['form'], array( |
|
48 | + 'blank' => false, 'field_id' => $this->get_field_id( 'form' ), |
|
49 | 49 | 'class' => 'widefat', |
50 | 50 | ) ); |
51 | 51 | ?> |
52 | 52 | </p> |
53 | 53 | |
54 | - <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" /> |
|
54 | + <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 | 55 | <?php _e( 'Show Description', 'formidable' ) ?></label></p> |
56 | 56 | <?php |
57 | 57 | } |
@@ -194,7 +194,7 @@ |
||
194 | 194 | } |
195 | 195 | $addon['link'] = FrmAppHelper::make_affiliate_url( $addon['link'] ); |
196 | 196 | |
197 | - $addons[ $slug ] = $addon; |
|
197 | + $addons[$slug] = $addon; |
|
198 | 198 | } |
199 | 199 | } |
200 | 200 |
@@ -10,41 +10,41 @@ discard block |
||
10 | 10 | <?php |
11 | 11 | |
12 | 12 | } else if ( $field['type'] == 'radio' ) { |
13 | - $read_only = false; |
|
13 | + $read_only = false; |
|
14 | 14 | if ( FrmField::is_read_only( $field ) && ! FrmAppHelper::is_admin() ) { |
15 | - $read_only = true; ?> |
|
15 | + $read_only = true; ?> |
|
16 | 16 | <input type="hidden" value="<?php echo esc_attr( $field['value'] ) ?>" name="<?php echo esc_attr( $field_name ) ?>" /> |
17 | 17 | <?php |
18 | - } |
|
18 | + } |
|
19 | 19 | |
20 | - if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
20 | + if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
21 | 21 | do_action( 'frm_after_checkbox', array( 'field' => $field, 'field_name' => $field_name, 'type' => $field['type'] ) ); |
22 | - } else if ( is_array($field['options']) ) { |
|
23 | - foreach ( $field['options'] as $opt_key => $opt ) { |
|
22 | + } else if ( is_array($field['options']) ) { |
|
23 | + foreach ( $field['options'] as $opt_key => $opt ) { |
|
24 | 24 | if ( isset( $atts ) && isset( $atts['opt'] ) && ( $atts['opt'] !== $opt_key ) ) { |
25 | - continue; |
|
26 | - } |
|
25 | + continue; |
|
26 | + } |
|
27 | 27 | |
28 | - $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field); |
|
29 | - $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field); ?> |
|
28 | + $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field); |
|
29 | + $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field); ?> |
|
30 | 30 | <div class="<?php echo esc_attr( apply_filters( 'frm_radio_class', 'frm_radio', $field, $field_val ) ) ?>"><?php |
31 | 31 | |
32 | 32 | if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
33 | 33 | ?><label for="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>"><?php |
34 | - } |
|
35 | - $checked = FrmAppHelper::check_selected($field['value'], $field_val) ? 'checked="checked" ' : ' '; |
|
34 | + } |
|
35 | + $checked = FrmAppHelper::check_selected($field['value'], $field_val) ? 'checked="checked" ' : ' '; |
|
36 | 36 | |
37 | - $other_opt = false; |
|
38 | - $other_args = FrmFieldsHelper::prepare_other_input( compact( 'field_name', 'opt_key', 'field' ), $other_opt, $checked ); |
|
39 | - ?> |
|
37 | + $other_opt = false; |
|
38 | + $other_args = FrmFieldsHelper::prepare_other_input( compact( 'field_name', 'opt_key', 'field' ), $other_opt, $checked ); |
|
39 | + ?> |
|
40 | 40 | <input type="radio" name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php |
41 | - echo $checked; |
|
42 | - do_action('frm_field_input_html', $field); |
|
41 | + echo $checked; |
|
42 | + do_action('frm_field_input_html', $field); |
|
43 | 43 | ?>/><?php |
44 | 44 | |
45 | 45 | if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
46 | 46 | echo ' ' . $opt . '</label>'; |
47 | - } |
|
47 | + } |
|
48 | 48 | |
49 | 49 | FrmFieldsHelper::include_other_input( array( |
50 | 50 | 'other_opt' => $other_opt, 'read_only' => $read_only, |
@@ -53,58 +53,58 @@ discard block |
||
53 | 53 | 'html_id' => $html_id, 'opt_key' => $opt_key, |
54 | 54 | ) ); |
55 | 55 | |
56 | - unset( $other_opt, $other_args ); |
|
56 | + unset( $other_opt, $other_args ); |
|
57 | 57 | ?></div> |
58 | 58 | <?php |
59 | - } |
|
60 | - } |
|
59 | + } |
|
60 | + } |
|
61 | 61 | } else if ( $field['type'] == 'select' ) { |
62 | 62 | include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/front-end/dropdown-field.php' ); |
63 | 63 | } else if ( $field['type'] == 'checkbox' ) { |
64 | - $checked_values = $field['value']; |
|
65 | - $read_only = false; |
|
64 | + $checked_values = $field['value']; |
|
65 | + $read_only = false; |
|
66 | 66 | |
67 | 67 | if ( FrmField::is_read_only( $field ) && ! FrmAppHelper::is_admin() ) { |
68 | - $read_only = true; |
|
69 | - if ( $checked_values ) { |
|
70 | - foreach ( (array) $checked_values as $checked_value ) { ?> |
|
68 | + $read_only = true; |
|
69 | + if ( $checked_values ) { |
|
70 | + foreach ( (array) $checked_values as $checked_value ) { ?> |
|
71 | 71 | <input type="hidden" value="<?php echo esc_attr( $checked_value ) ?>" name="<?php echo esc_attr( $field_name ) ?>[]" /> |
72 | 72 | <?php |
73 | - } |
|
74 | - } else { ?> |
|
73 | + } |
|
74 | + } else { ?> |
|
75 | 75 | <input type="hidden" value="" name="<?php echo esc_attr( $field_name ) ?>[]" /> |
76 | 76 | <?php |
77 | - } |
|
78 | - } |
|
77 | + } |
|
78 | + } |
|
79 | 79 | |
80 | - if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
80 | + if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
81 | 81 | do_action( 'frm_after_checkbox', array( 'field' => $field, 'field_name' => $field_name, 'type' => $field['type'] ) ); |
82 | - } else if ( $field['options'] ) { |
|
83 | - foreach ( $field['options'] as $opt_key => $opt ) { |
|
84 | - if ( isset($atts) && isset($atts['opt']) && ($atts['opt'] !== $opt_key) ) { |
|
85 | - continue; |
|
86 | - } |
|
87 | - |
|
88 | - $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field); |
|
89 | - $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field); |
|
90 | - $checked = FrmAppHelper::check_selected($checked_values, $field_val) ? ' checked="checked"' : ''; |
|
91 | - |
|
92 | - // Check if other opt, and get values for other field if needed |
|
93 | - $other_opt = false; |
|
82 | + } else if ( $field['options'] ) { |
|
83 | + foreach ( $field['options'] as $opt_key => $opt ) { |
|
84 | + if ( isset($atts) && isset($atts['opt']) && ($atts['opt'] !== $opt_key) ) { |
|
85 | + continue; |
|
86 | + } |
|
87 | + |
|
88 | + $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field); |
|
89 | + $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field); |
|
90 | + $checked = FrmAppHelper::check_selected($checked_values, $field_val) ? ' checked="checked"' : ''; |
|
91 | + |
|
92 | + // Check if other opt, and get values for other field if needed |
|
93 | + $other_opt = false; |
|
94 | 94 | $other_args = FrmFieldsHelper::prepare_other_input( compact( 'field', 'field_name', 'opt_key' ), $other_opt, $checked ); |
95 | 95 | |
96 | - ?> |
|
96 | + ?> |
|
97 | 97 | <div class="<?php echo esc_attr( apply_filters( 'frm_checkbox_class', 'frm_checkbox', $field, $field_val ) ) ?>" id="<?php echo esc_attr( FrmFieldsHelper::get_checkbox_id( $field, $opt_key ) ) ?>"><?php |
98 | 98 | |
99 | - if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
|
100 | - ?><label for="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>"><?php |
|
101 | - } |
|
99 | + if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
|
100 | + ?><label for="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>"><?php |
|
101 | + } |
|
102 | 102 | |
103 | - ?><input type="checkbox" name="<?php echo esc_attr( $field_name ) ?>[<?php echo ( $other_opt ? esc_attr( $opt_key ) : '' ) ?>]" id="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php echo $checked ?> <?php do_action('frm_field_input_html', $field) ?> /><?php |
|
103 | + ?><input type="checkbox" name="<?php echo esc_attr( $field_name ) ?>[<?php echo ( $other_opt ? esc_attr( $opt_key ) : '' ) ?>]" id="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php echo $checked ?> <?php do_action('frm_field_input_html', $field) ?> /><?php |
|
104 | 104 | |
105 | - if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
|
105 | + if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
|
106 | 106 | echo ' ' . $opt . '</label>'; |
107 | - } |
|
107 | + } |
|
108 | 108 | |
109 | 109 | FrmFieldsHelper::include_other_input( array( |
110 | 110 | 'other_opt' => $other_opt, 'read_only' => $read_only, |
@@ -113,17 +113,17 @@ discard block |
||
113 | 113 | 'html_id' => $html_id, 'opt_key' => $opt_key, |
114 | 114 | ) ); |
115 | 115 | |
116 | - unset( $other_opt, $other_args, $checked ); |
|
116 | + unset( $other_opt, $other_args, $checked ); |
|
117 | 117 | |
118 | - ?></div> |
|
118 | + ?></div> |
|
119 | 119 | <?php |
120 | - } |
|
121 | - } |
|
120 | + } |
|
121 | + } |
|
122 | 122 | } else if ( $field['type'] == 'captcha' && ! FrmAppHelper::is_admin() ) { |
123 | - $frm_settings = FrmAppHelper::get_settings(); |
|
124 | - if ( ! empty($frm_settings->pubkey) ) { |
|
125 | - FrmFieldsHelper::display_recaptcha($field); |
|
126 | - } |
|
123 | + $frm_settings = FrmAppHelper::get_settings(); |
|
124 | + if ( ! empty($frm_settings->pubkey) ) { |
|
125 | + FrmFieldsHelper::display_recaptcha($field); |
|
126 | + } |
|
127 | 127 | } else { |
128 | 128 | do_action( 'frm_form_fields', $field, $field_name, compact( 'errors', 'html_id' ) ); |
129 | 129 | do_action( 'frm_form_field_' . $field['type'], $field, $field_name, compact( 'errors', 'html_id' ) ); |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php if ( in_array( $field['type'], array( 'email', 'url', 'text' ) ) ) { ?> |
2 | -<input type="<?php echo ( $frm_settings->use_html || $field['type'] == 'password' ) ? $field['type'] : 'text'; ?>" id="<?php echo esc_attr( $html_id ) ?>" name="<?php echo esc_attr( $field_name ) ?>" value="<?php echo esc_attr( $field['value'] ) ?>" <?php do_action('frm_field_input_html', $field) ?>/> |
|
2 | +<input type="<?php echo ( $frm_settings->use_html || $field['type'] == 'password' ) ? $field['type'] : 'text'; ?>" id="<?php echo esc_attr( $html_id ) ?>" name="<?php echo esc_attr( $field_name ) ?>" value="<?php echo esc_attr( $field['value'] ) ?>" <?php do_action( 'frm_field_input_html', $field ) ?>/> |
|
3 | 3 | <?php } else if ( $field['type'] == 'textarea' ) { ?> |
4 | 4 | <textarea name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id ) ?>" <?php |
5 | 5 | if ( $field['max'] ) { |
6 | 6 | echo 'rows="' . esc_attr( $field['max'] ) . '" '; |
7 | 7 | } |
8 | -do_action('frm_field_input_html', $field); |
|
9 | -?>><?php echo FrmAppHelper::esc_textarea($field['value']) ?></textarea> |
|
8 | +do_action( 'frm_field_input_html', $field ); |
|
9 | +?>><?php echo FrmAppHelper::esc_textarea( $field['value'] ) ?></textarea> |
|
10 | 10 | <?php |
11 | 11 | |
12 | 12 | } else if ( $field['type'] == 'radio' ) { |
@@ -17,29 +17,29 @@ discard block |
||
17 | 17 | <?php |
18 | 18 | } |
19 | 19 | |
20 | - if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
20 | + if ( isset( $field['post_field'] ) && $field['post_field'] == 'post_category' ) { |
|
21 | 21 | do_action( 'frm_after_checkbox', array( 'field' => $field, 'field_name' => $field_name, 'type' => $field['type'] ) ); |
22 | - } else if ( is_array($field['options']) ) { |
|
22 | + } else if ( is_array( $field['options'] ) ) { |
|
23 | 23 | foreach ( $field['options'] as $opt_key => $opt ) { |
24 | 24 | if ( isset( $atts ) && isset( $atts['opt'] ) && ( $atts['opt'] !== $opt_key ) ) { |
25 | 25 | continue; |
26 | 26 | } |
27 | 27 | |
28 | - $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field); |
|
29 | - $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field); ?> |
|
28 | + $field_val = apply_filters( 'frm_field_value_saved', $opt, $opt_key, $field ); |
|
29 | + $opt = apply_filters( 'frm_field_label_seen', $opt, $opt_key, $field ); ?> |
|
30 | 30 | <div class="<?php echo esc_attr( apply_filters( 'frm_radio_class', 'frm_radio', $field, $field_val ) ) ?>"><?php |
31 | 31 | |
32 | 32 | if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
33 | 33 | ?><label for="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>"><?php |
34 | 34 | } |
35 | - $checked = FrmAppHelper::check_selected($field['value'], $field_val) ? 'checked="checked" ' : ' '; |
|
35 | + $checked = FrmAppHelper::check_selected( $field['value'], $field_val ) ? 'checked="checked" ' : ' '; |
|
36 | 36 | |
37 | 37 | $other_opt = false; |
38 | 38 | $other_args = FrmFieldsHelper::prepare_other_input( compact( 'field_name', 'opt_key', 'field' ), $other_opt, $checked ); |
39 | 39 | ?> |
40 | 40 | <input type="radio" name="<?php echo esc_attr( $field_name ) ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php |
41 | 41 | echo $checked; |
42 | - do_action('frm_field_input_html', $field); |
|
42 | + do_action( 'frm_field_input_html', $field ); |
|
43 | 43 | ?>/><?php |
44 | 44 | |
45 | 45 | if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
@@ -77,17 +77,17 @@ discard block |
||
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
80 | - if ( isset($field['post_field']) && $field['post_field'] == 'post_category' ) { |
|
80 | + if ( isset( $field['post_field'] ) && $field['post_field'] == 'post_category' ) { |
|
81 | 81 | do_action( 'frm_after_checkbox', array( 'field' => $field, 'field_name' => $field_name, 'type' => $field['type'] ) ); |
82 | 82 | } else if ( $field['options'] ) { |
83 | 83 | foreach ( $field['options'] as $opt_key => $opt ) { |
84 | - if ( isset($atts) && isset($atts['opt']) && ($atts['opt'] !== $opt_key) ) { |
|
84 | + if ( isset( $atts ) && isset( $atts['opt'] ) && ( $atts['opt'] !== $opt_key ) ) { |
|
85 | 85 | continue; |
86 | 86 | } |
87 | 87 | |
88 | - $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field); |
|
89 | - $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field); |
|
90 | - $checked = FrmAppHelper::check_selected($checked_values, $field_val) ? ' checked="checked"' : ''; |
|
88 | + $field_val = apply_filters( 'frm_field_value_saved', $opt, $opt_key, $field ); |
|
89 | + $opt = apply_filters( 'frm_field_label_seen', $opt, $opt_key, $field ); |
|
90 | + $checked = FrmAppHelper::check_selected( $checked_values, $field_val ) ? ' checked="checked"' : ''; |
|
91 | 91 | |
92 | 92 | // Check if other opt, and get values for other field if needed |
93 | 93 | $other_opt = false; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | ?><label for="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>"><?php |
101 | 101 | } |
102 | 102 | |
103 | - ?><input type="checkbox" name="<?php echo esc_attr( $field_name ) ?>[<?php echo ( $other_opt ? esc_attr( $opt_key ) : '' ) ?>]" id="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php echo $checked ?> <?php do_action('frm_field_input_html', $field) ?> /><?php |
|
103 | + ?><input type="checkbox" name="<?php echo esc_attr( $field_name ) ?>[<?php echo ( $other_opt ? esc_attr( $opt_key ) : '' ) ?>]" id="<?php echo esc_attr( $html_id ) ?>-<?php echo esc_attr( $opt_key ) ?>" value="<?php echo esc_attr( $field_val ) ?>" <?php echo $checked ?> <?php do_action( 'frm_field_input_html', $field ) ?> /><?php |
|
104 | 104 | |
105 | 105 | if ( ! isset( $atts ) || ! isset( $atts['label'] ) || $atts['label'] ) { |
106 | 106 | echo ' ' . $opt . '</label>'; |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | } |
122 | 122 | } else if ( $field['type'] == 'captcha' && ! FrmAppHelper::is_admin() ) { |
123 | 123 | $frm_settings = FrmAppHelper::get_settings(); |
124 | - if ( ! empty($frm_settings->pubkey) ) { |
|
125 | - FrmFieldsHelper::display_recaptcha($field); |
|
124 | + if ( ! empty( $frm_settings->pubkey ) ) { |
|
125 | + FrmFieldsHelper::display_recaptcha( $field ); |
|
126 | 126 | } |
127 | 127 | } else { |
128 | 128 | do_action( 'frm_form_fields', $field, $field_name, compact( 'errors', 'html_id' ) ); |
@@ -2,26 +2,26 @@ discard block |
||
2 | 2 | |
3 | 3 | class FrmSettingsController { |
4 | 4 | |
5 | - public static function menu() { |
|
5 | + public static function menu() { |
|
6 | 6 | // Make sure admins can see the menu items |
7 | 7 | FrmAppHelper::force_capability( 'frm_change_settings' ); |
8 | 8 | |
9 | - add_submenu_page( 'formidable', 'Formidable | ' . __( 'Global Settings', 'formidable' ), __( 'Global Settings', 'formidable' ), 'frm_change_settings', 'formidable-settings', 'FrmSettingsController::route' ); |
|
10 | - } |
|
9 | + add_submenu_page( 'formidable', 'Formidable | ' . __( 'Global Settings', 'formidable' ), __( 'Global Settings', 'formidable' ), 'frm_change_settings', 'formidable-settings', 'FrmSettingsController::route' ); |
|
10 | + } |
|
11 | 11 | |
12 | - public static function license_box() { |
|
12 | + public static function license_box() { |
|
13 | 13 | $a = FrmAppHelper::simple_get( 't', 'sanitize_title', 'general_settings' ); |
14 | - include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/license_box.php' ); |
|
15 | - } |
|
14 | + include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/license_box.php' ); |
|
15 | + } |
|
16 | 16 | |
17 | - public static function display_form( $errors = array(), $message = '' ) { |
|
18 | - global $frm_vars; |
|
17 | + public static function display_form( $errors = array(), $message = '' ) { |
|
18 | + global $frm_vars; |
|
19 | 19 | |
20 | - $frm_settings = FrmAppHelper::get_settings(); |
|
21 | - $frm_roles = FrmAppHelper::frm_capabilities(); |
|
20 | + $frm_settings = FrmAppHelper::get_settings(); |
|
21 | + $frm_roles = FrmAppHelper::frm_capabilities(); |
|
22 | 22 | |
23 | - $uploads = wp_upload_dir(); |
|
24 | - $target_path = $uploads['basedir'] . '/formidable/css'; |
|
23 | + $uploads = wp_upload_dir(); |
|
24 | + $target_path = $uploads['basedir'] . '/formidable/css'; |
|
25 | 25 | |
26 | 26 | $sections = self::get_settings_tabs(); |
27 | 27 | |
@@ -64,47 +64,47 @@ discard block |
||
64 | 64 | wp_die(); |
65 | 65 | } |
66 | 66 | |
67 | - public static function process_form( $stop_load = false ) { |
|
68 | - global $frm_vars; |
|
67 | + public static function process_form( $stop_load = false ) { |
|
68 | + global $frm_vars; |
|
69 | 69 | |
70 | - $frm_settings = FrmAppHelper::get_settings(); |
|
70 | + $frm_settings = FrmAppHelper::get_settings(); |
|
71 | 71 | |
72 | 72 | $process_form = FrmAppHelper::get_post_param( 'process_form', '', 'sanitize_text_field' ); |
73 | 73 | if ( ! wp_verify_nonce( $process_form, 'process_form_nonce' ) ) { |
74 | - wp_die( $frm_settings->admin_permission ); |
|
75 | - } |
|
74 | + wp_die( $frm_settings->admin_permission ); |
|
75 | + } |
|
76 | 76 | |
77 | - $errors = array(); |
|
78 | - $message = ''; |
|
77 | + $errors = array(); |
|
78 | + $message = ''; |
|
79 | 79 | |
80 | - if ( ! isset( $frm_vars['settings_routed'] ) || ! $frm_vars['settings_routed'] ) { |
|
81 | - $errors = $frm_settings->validate( $_POST, array() ); |
|
80 | + if ( ! isset( $frm_vars['settings_routed'] ) || ! $frm_vars['settings_routed'] ) { |
|
81 | + $errors = $frm_settings->validate( $_POST, array() ); |
|
82 | 82 | |
83 | - $frm_settings->update( stripslashes_deep( $_POST ) ); |
|
83 | + $frm_settings->update( stripslashes_deep( $_POST ) ); |
|
84 | 84 | |
85 | - if ( empty( $errors ) ) { |
|
86 | - $frm_settings->store(); |
|
87 | - $message = __( 'Settings Saved', 'formidable' ); |
|
88 | - } |
|
89 | - } else { |
|
90 | - $message = __( 'Settings Saved', 'formidable' ); |
|
91 | - } |
|
85 | + if ( empty( $errors ) ) { |
|
86 | + $frm_settings->store(); |
|
87 | + $message = __( 'Settings Saved', 'formidable' ); |
|
88 | + } |
|
89 | + } else { |
|
90 | + $message = __( 'Settings Saved', 'formidable' ); |
|
91 | + } |
|
92 | 92 | |
93 | 93 | if ( $stop_load == 'stop_load' ) { |
94 | - $frm_vars['settings_routed'] = true; |
|
95 | - return; |
|
96 | - } |
|
94 | + $frm_vars['settings_routed'] = true; |
|
95 | + return; |
|
96 | + } |
|
97 | 97 | |
98 | - self::display_form( $errors, $message ); |
|
99 | - } |
|
98 | + self::display_form( $errors, $message ); |
|
99 | + } |
|
100 | 100 | |
101 | - public static function route( $stop_load = false ) { |
|
102 | - $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; |
|
101 | + public static function route( $stop_load = false ) { |
|
102 | + $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; |
|
103 | 103 | $action = FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ); |
104 | - if ( $action == 'process-form' ) { |
|
104 | + if ( $action == 'process-form' ) { |
|
105 | 105 | self::process_form( $stop_load ); |
106 | - } else if ( $stop_load != 'stop_load' ) { |
|
106 | + } else if ( $stop_load != 'stop_load' ) { |
|
107 | 107 | self::display_form(); |
108 | - } |
|
109 | - } |
|
108 | + } |
|
109 | + } |
|
110 | 110 | } |
@@ -45,16 +45,16 @@ |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | public static function load_settings_tab() { |
48 | - FrmAppHelper::permission_check('frm_change_settings'); |
|
48 | + FrmAppHelper::permission_check( 'frm_change_settings' ); |
|
49 | 49 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
50 | 50 | |
51 | 51 | $section = FrmAppHelper::get_post_param( 'tab', '', 'sanitize_text_field' ); |
52 | 52 | $sections = self::get_settings_tabs(); |
53 | - if ( ! isset( $sections[ $section ] ) ) { |
|
53 | + if ( ! isset( $sections[$section] ) ) { |
|
54 | 54 | wp_die(); |
55 | 55 | } |
56 | 56 | |
57 | - $section = $sections[ $section ]; |
|
57 | + $section = $sections[$section]; |
|
58 | 58 | |
59 | 59 | if ( isset( $section['class'] ) ) { |
60 | 60 | call_user_func( array( $section['class'], $section['function'] ) ); |
@@ -191,10 +191,10 @@ |
||
191 | 191 | } else { |
192 | 192 | call_user_func( ( isset( $section['function'] ) ? $section['function'] : $section ) ); |
193 | 193 | } |
194 | - } ?> |
|
194 | + } ?> |
|
195 | 195 | </div> |
196 | 196 | <?php |
197 | - } ?> |
|
197 | + } ?> |
|
198 | 198 | |
199 | 199 | <p class="alignright frm_uninstall"> |
200 | 200 | <a href="javascript:void(0)" id="frm_uninstall_now"><?php _e( 'Uninstall Formidable', 'formidable' ) ?></a> |
@@ -27,14 +27,14 @@ discard block |
||
27 | 27 | </ul> |
28 | 28 | </div> |
29 | 29 | |
30 | - <?php do_action('frm_before_settings'); ?> |
|
30 | + <?php do_action( 'frm_before_settings' ); ?> |
|
31 | 31 | |
32 | 32 | <form name="frm_settings_form" method="post" class="frm_settings_form" action="?page=formidable-settings<?php echo ( $a ? '&t=' . $a : '' ); ?>"> |
33 | 33 | <input type="hidden" name="frm_action" value="process-form" /> |
34 | 34 | <input type="hidden" name="action" value="process-form" /> |
35 | - <?php wp_nonce_field('process_form_nonce', 'process_form'); ?> |
|
35 | + <?php wp_nonce_field( 'process_form_nonce', 'process_form' ); ?> |
|
36 | 36 | |
37 | - <div class="general_settings tabs-panel <?php echo ($a == 'general_settings') ? 'frm_block' : 'frm_hidden'; ?>"> |
|
37 | + <div class="general_settings tabs-panel <?php echo ( $a == 'general_settings' ) ? 'frm_block' : 'frm_hidden'; ?>"> |
|
38 | 38 | <p class="submit"> |
39 | 39 | <input class="button-primary" type="submit" value="<?php esc_attr_e( 'Update Options', 'formidable' ) ?>" /> |
40 | 40 | </p> |
@@ -43,20 +43,20 @@ discard block |
||
43 | 43 | |
44 | 44 | <p><label class="frm_left_label"><?php _e( 'Load form styling', 'formidable' ) ?></label> |
45 | 45 | <select id="frm_load_style" name="frm_load_style"> |
46 | - <option value="all" <?php selected($frm_settings->load_style, 'all') ?>><?php _e( 'on every page of your site', 'formidable' ) ?></option> |
|
47 | - <option value="dynamic" <?php selected($frm_settings->load_style, 'dynamic') ?>><?php _e( 'only on applicable pages', 'formidable' ) ?></option> |
|
48 | - <option value="none" <?php selected($frm_settings->load_style, 'none') ?>><?php _e( 'Don\'t use form styling on any page', 'formidable' ) ?></option> |
|
46 | + <option value="all" <?php selected( $frm_settings->load_style, 'all' ) ?>><?php _e( 'on every page of your site', 'formidable' ) ?></option> |
|
47 | + <option value="dynamic" <?php selected( $frm_settings->load_style, 'dynamic' ) ?>><?php _e( 'only on applicable pages', 'formidable' ) ?></option> |
|
48 | + <option value="none" <?php selected( $frm_settings->load_style, 'none' ) ?>><?php _e( 'Don\'t use form styling on any page', 'formidable' ) ?></option> |
|
49 | 49 | </select> |
50 | 50 | </p> |
51 | 51 | |
52 | 52 | <p> |
53 | 53 | <label for="frm_use_html"> |
54 | - <input type="checkbox" id="frm_use_html" name="frm_use_html" value="1" <?php checked($frm_settings->use_html, 1) ?> > <?php _e( 'Use HTML5 in forms', 'formidable' ) ?> |
|
54 | + <input type="checkbox" id="frm_use_html" name="frm_use_html" value="1" <?php checked( $frm_settings->use_html, 1 ) ?> > <?php _e( 'Use HTML5 in forms', 'formidable' ) ?> |
|
55 | 55 | </label> |
56 | 56 | <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'We recommend using HTML 5 for your forms. It adds some nifty options like placeholders, patterns, and autocomplete.', 'formidable' ) ?>"></span> |
57 | 57 | </p> |
58 | 58 | |
59 | - <?php do_action('frm_style_general_settings', $frm_settings); ?> |
|
59 | + <?php do_action( 'frm_style_general_settings', $frm_settings ); ?> |
|
60 | 60 | |
61 | 61 | <h3><?php _e( 'User Permissions', 'formidable' ); ?> |
62 | 62 | <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Select users that are allowed access to Formidable. Without access to View Forms, users will be unable to see the Formidable menu.', 'formidable' ) ?>"></span> |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | </p> |
81 | 81 | |
82 | 82 | <p><label class="frm_left_label"><?php _e( 'Site Key', 'formidable' ) ?></label> |
83 | - <input type="text" name="frm_pubkey" id="frm_pubkey" size="42" value="<?php echo esc_attr($frm_settings->pubkey) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p> |
|
83 | + <input type="text" name="frm_pubkey" id="frm_pubkey" size="42" value="<?php echo esc_attr( $frm_settings->pubkey ) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p> |
|
84 | 84 | |
85 | 85 | <p><label class="frm_left_label"><?php _e( 'Secret Key', 'formidable' ) ?></label> |
86 | - <input type="text" name="frm_privkey" id="frm_privkey" size="42" value="<?php echo esc_attr($frm_settings->privkey) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p> |
|
86 | + <input type="text" name="frm_privkey" id="frm_privkey" size="42" value="<?php echo esc_attr( $frm_settings->privkey ) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p> |
|
87 | 87 | |
88 | 88 | <p><label class="frm_left_label"><?php _e( 'reCAPTCHA Type', 'formidable' ) ?></label> |
89 | 89 | <select name="frm_re_type" id="frm_re_type"> |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | <select name="frm_re_lang" id="frm_re_lang"> |
100 | 100 | <option value="" <?php selected( $frm_settings->re_lang, '' ) ?>><?php esc_html_e( 'Browser Default', 'formidable' ); ?></option> |
101 | 101 | <?php foreach ( $captcha_lang as $lang => $lang_name ) { ?> |
102 | - <option value="<?php echo esc_attr($lang) ?>" <?php selected($frm_settings->re_lang, $lang) ?>><?php echo esc_html( $lang_name ) ?></option> |
|
102 | + <option value="<?php echo esc_attr( $lang ) ?>" <?php selected( $frm_settings->re_lang, $lang ) ?>><?php echo esc_html( $lang_name ) ?></option> |
|
103 | 103 | <?php } ?> |
104 | 104 | </select></p> |
105 | 105 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | <label class="frm_left_label"><?php _e( 'Success Message', 'formidable' ); ?> |
153 | 153 | <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'The default message seen after a form is submitted.', 'formidable' ) ?>" ></span> |
154 | 154 | </label> |
155 | - <input type="text" id="frm_success_msg" name="frm_success_msg" class="frm_with_left_label" value="<?php echo esc_attr($frm_settings->success_msg) ?>" /> |
|
155 | + <input type="text" id="frm_success_msg" name="frm_success_msg" class="frm_with_left_label" value="<?php echo esc_attr( $frm_settings->success_msg ) ?>" /> |
|
156 | 156 | </p> |
157 | 157 | |
158 | 158 | <p> |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | <input type="text" value="<?php echo esc_attr( $frm_settings->submit_value ) ?>" id="frm_submit_value" name="frm_submit_value" class="frm_with_left_label" /> |
161 | 161 | </p> |
162 | 162 | |
163 | - <?php do_action('frm_settings_form', $frm_settings); ?> |
|
163 | + <?php do_action( 'frm_settings_form', $frm_settings ); ?> |
|
164 | 164 | |
165 | 165 | <?php if ( ! FrmAppHelper::pro_is_installed() ) { ?> |
166 | 166 | <div class="clear"></div> |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | <?php } ?> |
171 | 171 | |
172 | 172 | <p><label class="frm_left_label"><?php _e( 'Preview Page', 'formidable' ); ?></label> |
173 | - <?php FrmAppHelper::wp_pages_dropdown('frm-preview-page-id', $frm_settings->preview_page_id ) ?> |
|
173 | + <?php FrmAppHelper::wp_pages_dropdown( 'frm-preview-page-id', $frm_settings->preview_page_id ) ?> |
|
174 | 174 | </p> |
175 | 175 | |
176 | 176 | </div> |
@@ -151,6 +151,7 @@ |
||
151 | 151 | |
152 | 152 | /** |
153 | 153 | * @deprecated 2.03.11 |
154 | + * @param string $val |
|
154 | 155 | */ |
155 | 156 | private static function get_field_value( $atts, &$val ) { |
156 | 157 | _deprecated_function( __FUNCTION__, '2.03.11', 'instance of FrmEntryValues or FrmProEntryValues' ); |
@@ -98,15 +98,15 @@ discard block |
||
98 | 98 | self::prepare_field_output( $atts, $val ); |
99 | 99 | |
100 | 100 | if ( $atts['format'] != 'text' ) { |
101 | - $values[ $f->field_key ] = $val; |
|
101 | + $values[$f->field_key] = $val; |
|
102 | 102 | if ( $atts['entry'] && $f->type != 'textarea' ) { |
103 | - $prev_val = maybe_unserialize( $atts['entry']->metas[ $f->id ] ); |
|
103 | + $prev_val = maybe_unserialize( $atts['entry']->metas[$f->id] ); |
|
104 | 104 | if ( $prev_val != $val ) { |
105 | - $values[ $f->field_key . '-value' ] = $prev_val; |
|
105 | + $values[$f->field_key . '-value'] = $prev_val; |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | } else { |
109 | - $values[ $f->id ] = array( 'label' => $f->name, 'val' => $val, 'type' => $f->type ); |
|
109 | + $values[$f->id] = array( 'label' => $f->name, 'val' => $val, 'type' => $f->type ); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | private static function fill_missing_fields( $atts, &$values ) { |
117 | 117 | _deprecated_function( __FUNCTION__, '2.03.11', 'instance of FrmEntryValues or FrmProEntryValues' ); |
118 | 118 | |
119 | - if ( $atts['entry'] && ! isset( $atts['entry']->metas[ $atts['field']->id ] ) ) { |
|
119 | + if ( $atts['entry'] && ! isset( $atts['entry']->metas[$atts['field']->id] ) ) { |
|
120 | 120 | // In case include_blank is set |
121 | - $atts['entry']->metas[ $atts['field']->id ] = ''; |
|
121 | + $atts['entry']->metas[$atts['field']->id] = ''; |
|
122 | 122 | $atts['entry'] = apply_filters( 'frm_prepare_entry_content', $atts['entry'], array( 'field' => $atts['field'] ) ); |
123 | 123 | self::fill_values_from_entry( $atts, $values ); |
124 | 124 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | 'type' => $f->type, |
147 | 147 | ); |
148 | 148 | |
149 | - $values[ $f->id ] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $field_shortcodes, $f ); |
|
149 | + $values[$f->id] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $field_shortcodes, $f ); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | $f = $atts['field']; |
159 | 159 | if ( $atts['entry'] ) { |
160 | - $prev_val = maybe_unserialize( $atts['entry']->metas[ $f->id ] ); |
|
160 | + $prev_val = maybe_unserialize( $atts['entry']->metas[$f->id] ); |
|
161 | 161 | $meta = array( 'item_id' => $atts['id'], 'field_id' => $f->id, 'meta_value' => $prev_val, 'field_type' => $f->type ); |
162 | 162 | |
163 | 163 | //This filter applies to the default-message shortcode and frm-show-entry shortcode only |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | * |
331 | 331 | * @since 2.03.11 |
332 | 332 | * |
333 | - * @param array $field_values |
|
333 | + * @param FrmFieldValue[] $field_values |
|
334 | 334 | * @param array $output |
335 | 335 | */ |
336 | 336 | protected function push_field_values_to_array( $field_values, &$output ) { |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | * @param mixed $display_value |
549 | 549 | * @param string $field_type |
550 | 550 | * |
551 | - * @return mixed|string |
|
551 | + * @return string |
|
552 | 552 | */ |
553 | 553 | protected function prepare_display_value_for_html_table( $display_value, $field_type = '' ) { |
554 | 554 | $display_value = $this->flatten_array( $display_value ); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | if ( is_object( $atts['entry'] ) ) { |
110 | 110 | |
111 | 111 | if ( isset( $atts['entry']->metas ) ) { |
112 | - $this->entry = $atts[ 'entry' ]; |
|
112 | + $this->entry = $atts['entry']; |
|
113 | 113 | } else { |
114 | 114 | $this->entry = FrmEntry::getOne( $atts['entry']->id, true ); |
115 | 115 | } |
@@ -351,10 +351,10 @@ discard block |
||
351 | 351 | if ( $this->include_field_in_content( $field_value ) ) { |
352 | 352 | |
353 | 353 | $displayed_value = $this->prepare_display_value_for_array( $field_value->get_displayed_value() ); |
354 | - $output[ $field_value->get_field_key() ] = $displayed_value; |
|
354 | + $output[$field_value->get_field_key()] = $displayed_value; |
|
355 | 355 | |
356 | 356 | if ( $displayed_value !== $field_value->get_saved_value() ) { |
357 | - $output[ $field_value->get_field_key() . '-value' ] = $field_value->get_saved_value(); |
|
357 | + $output[$field_value->get_field_key() . '-value'] = $field_value->get_saved_value(); |
|
358 | 358 | } |
359 | 359 | } |
360 | 360 | } |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | |
606 | 606 | if ( is_array( $value ) ) { |
607 | 607 | foreach ( $value as $key => $single_value ) { |
608 | - $value[ $key ] = $this->strip_html( $single_value ); |
|
608 | + $value[$key] = $this->strip_html( $single_value ); |
|
609 | 609 | } |
610 | 610 | } else if ( $this->is_plain_text && ! is_array( $value ) ) { |
611 | 611 | if ( strpos( $value, '<img' ) !== false ) { |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | ) ); |
84 | 84 | |
85 | 85 | foreach ( $this->style_settings as $key => $setting ) { |
86 | - if ( isset( $atts[ $key ] ) && $atts[ $key ] !== '' ) { |
|
87 | - $this->style_settings[ $key ] = str_replace( '#', '', $atts[ $key ] ); |
|
86 | + if ( isset( $atts[$key] ) && $atts[$key] !== '' ) { |
|
87 | + $this->style_settings[$key] = str_replace( '#', '', $atts[$key] ); |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | } |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | private function init_table_style() { |
124 | 124 | if ( $this->use_inline_style === true ) { |
125 | 125 | |
126 | - $this->table_style = ' style="' . esc_attr( 'font-size:' . $this->style_settings[ 'font_size' ] . ';line-height:135%;' ); |
|
127 | - $this->table_style .= esc_attr( 'border-bottom:' . $this->style_settings[ 'border_width' ] . ' solid #' . $this->style_settings[ 'border_color' ] . ';' ) . '"'; |
|
126 | + $this->table_style = ' style="' . esc_attr( 'font-size:' . $this->style_settings['font_size'] . ';line-height:135%;' ); |
|
127 | + $this->table_style .= esc_attr( 'border-bottom:' . $this->style_settings['border_width'] . ' solid #' . $this->style_settings['border_color'] . ';' ) . '"'; |
|
128 | 128 | |
129 | 129 | } |
130 | 130 | } |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | if ( $this->use_inline_style === true ) { |
139 | 139 | |
140 | 140 | $td_style_attributes = 'text-align:' . ( $this->direction == 'rtl' ? 'right' : 'left' ) . ';'; |
141 | - $td_style_attributes .= 'color:#' . $this->style_settings[ 'text_color' ] . ';padding:7px 9px;vertical-align:top;'; |
|
142 | - $td_style_attributes .= 'border-top:' . $this->style_settings[ 'border_width' ] . ' solid #' . $this->style_settings[ 'border_color' ] . ';'; |
|
141 | + $td_style_attributes .= 'color:#' . $this->style_settings['text_color'] . ';padding:7px 9px;vertical-align:top;'; |
|
142 | + $td_style_attributes .= 'border-top:' . $this->style_settings['border_width'] . ' solid #' . $this->style_settings['border_color'] . ';'; |
|
143 | 143 | |
144 | 144 | $this->td_style = ' style="' . $td_style_attributes . '"'; |
145 | 145 | } |