@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | // hold widget View options |
52 | 52 | private $widget_options; |
53 | 53 | |
54 | - function __construct( $widget_label , $widget_id , $defaults = array(), $settings = array() ) { |
|
54 | + function __construct( $widget_label, $widget_id, $defaults = array(), $settings = array() ) { |
|
55 | 55 | |
56 | 56 | |
57 | 57 | /** |
58 | 58 | * The shortcode name is set to the lowercase name of the widget class, unless overridden by the class specifying a different value for $shortcode_name |
59 | 59 | * @var string |
60 | 60 | */ |
61 | - $this->shortcode_name = !isset( $this->shortcode_name ) ? strtolower( get_class($this) ) : $this->shortcode_name; |
|
61 | + $this->shortcode_name = ! isset( $this->shortcode_name ) ? strtolower( get_class( $this ) ) : $this->shortcode_name; |
|
62 | 62 | |
63 | 63 | $this->widget_label = $widget_label; |
64 | 64 | $this->widget_id = $widget_id; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $this->settings = wp_parse_args( $settings, $this->settings ); |
70 | 70 | |
71 | 71 | // register widgets to be listed in the View Configuration |
72 | - add_filter( 'gravityview_register_directory_widgets', array( $this, 'register_widget') ); |
|
72 | + add_filter( 'gravityview_register_directory_widgets', array( $this, 'register_widget' ) ); |
|
73 | 73 | |
74 | 74 | // widget options |
75 | 75 | add_filter( 'gravityview_template_widget_options', array( $this, 'assign_widget_options' ), 10, 3 ); |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | add_action( "gravityview_render_widget_{$widget_id}", array( $this, 'render_frontend' ), 10, 1 ); |
79 | 79 | |
80 | 80 | // register shortcodes |
81 | - add_action( 'wp', array( $this, 'add_shortcode') ); |
|
81 | + add_action( 'wp', array( $this, 'add_shortcode' ) ); |
|
82 | 82 | |
83 | 83 | // Use shortcodes in text widgets. |
84 | - add_filter('widget_text', array( $this, 'maybe_do_shortcode' ) ); |
|
84 | + add_filter( 'widget_text', array( $this, 'maybe_do_shortcode' ) ); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | |
@@ -99,14 +99,14 @@ discard block |
||
99 | 99 | * @param boolean $enable_custom_class False by default. Return true if you want to enable. |
100 | 100 | * @param GravityView_Widget $this Current instance of GravityView_Widget |
101 | 101 | */ |
102 | - $enable_custom_class = apply_filters('gravityview/widget/enable_custom_class', false, $this ); |
|
102 | + $enable_custom_class = apply_filters( 'gravityview/widget/enable_custom_class', false, $this ); |
|
103 | 103 | |
104 | - if( $enable_custom_class ) { |
|
104 | + if ( $enable_custom_class ) { |
|
105 | 105 | |
106 | - $settings['custom_class'] = array( |
|
106 | + $settings[ 'custom_class' ] = array( |
|
107 | 107 | 'type' => 'text', |
108 | 108 | 'label' => __( 'Custom CSS Class:', 'gravityview' ), |
109 | - 'desc' => __( 'This class will be added to the widget container', 'gravityview'), |
|
109 | + 'desc' => __( 'This class will be added to the widget container', 'gravityview' ), |
|
110 | 110 | 'value' => '', |
111 | 111 | 'merge_tags' => true, |
112 | 112 | ); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * @return array|null Settings array; NULL if not set |
129 | 129 | */ |
130 | 130 | public function get_settings() { |
131 | - return !empty( $this->settings ) ? $this->settings : NULL; |
|
131 | + return ! empty( $this->settings ) ? $this->settings : NULL; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | /** |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | public function get_setting( $key ) { |
140 | 140 | $setting = NULL; |
141 | 141 | |
142 | - if( isset( $this->settings ) && is_array( $this->settings ) ) { |
|
142 | + if ( isset( $this->settings ) && is_array( $this->settings ) ) { |
|
143 | 143 | $setting = isset( $this->settings[ $key ] ) ? $this->settings[ $key ] : NULL; |
144 | 144 | } |
145 | 145 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | function maybe_do_shortcode( $text, $widget = NULL ) { |
156 | 156 | |
157 | - if( !empty( $this->shortcode_name ) && has_shortcode( $text, $this->shortcode_name ) ) { |
|
157 | + if ( ! empty( $this->shortcode_name ) && has_shortcode( $text, $this->shortcode_name ) ) { |
|
158 | 158 | return do_shortcode( $text ); |
159 | 159 | } |
160 | 160 | |
@@ -176,28 +176,28 @@ discard block |
||
176 | 176 | function add_shortcode( $run_on_singular = true ) { |
177 | 177 | global $post; |
178 | 178 | |
179 | - if( GravityView_Plugin::is_admin() ) { return; } |
|
179 | + if ( GravityView_Plugin::is_admin() ) { return; } |
|
180 | 180 | |
181 | - if( empty( $this->shortcode_name ) ) { return; } |
|
181 | + if ( empty( $this->shortcode_name ) ) { return; } |
|
182 | 182 | |
183 | 183 | // If the widget shouldn't output on single entries, don't show it |
184 | - if( empty( $this->show_on_single ) && class_exists('GravityView_frontend') && GravityView_frontend::is_single_entry() ) { |
|
185 | - do_action('gravityview_log_debug', sprintf( '%s[add_shortcode]: Skipping; set to not run on single entry.', get_class($this)) ); |
|
184 | + if ( empty( $this->show_on_single ) && class_exists( 'GravityView_frontend' ) && GravityView_frontend::is_single_entry() ) { |
|
185 | + do_action( 'gravityview_log_debug', sprintf( '%s[add_shortcode]: Skipping; set to not run on single entry.', get_class( $this ) ) ); |
|
186 | 186 | |
187 | 187 | add_shortcode( $this->shortcode_name, '__return_null' ); |
188 | 188 | return; |
189 | 189 | } |
190 | 190 | |
191 | 191 | |
192 | - if( !has_gravityview_shortcode( $post ) ) { |
|
192 | + if ( ! has_gravityview_shortcode( $post ) ) { |
|
193 | 193 | |
194 | - do_action('gravityview_log_debug', sprintf( '%s[add_shortcode]: No shortcode present; not adding render_frontend shortcode.', get_class($this)) ); |
|
194 | + do_action( 'gravityview_log_debug', sprintf( '%s[add_shortcode]: No shortcode present; not adding render_frontend shortcode.', get_class( $this ) ) ); |
|
195 | 195 | |
196 | 196 | add_shortcode( $this->shortcode_name, '__return_null' ); |
197 | 197 | return; |
198 | 198 | } |
199 | 199 | |
200 | - add_shortcode( $this->shortcode_name, array( $this, 'render_shortcode') ); |
|
200 | + add_shortcode( $this->shortcode_name, array( $this, 'render_shortcode' ) ); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | /** |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | */ |
208 | 208 | function register_widget( $widgets ) { |
209 | 209 | $widgets[ $this->widget_id ] = array( |
210 | - 'label' => $this->widget_label , |
|
210 | + 'label' => $this->widget_label, |
|
211 | 211 | 'description' => $this->widget_description, |
212 | 212 | 'subtitle' => $this->widget_subtitle, |
213 | 213 | ); |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | */ |
225 | 225 | public function assign_widget_options( $options = array(), $template = '', $widget = '' ) { |
226 | 226 | |
227 | - if( $this->widget_id === $widget ) { |
|
227 | + if ( $this->widget_id === $widget ) { |
|
228 | 228 | $options = array_merge( $options, $this->settings ); |
229 | 229 | } |
230 | 230 | |
@@ -237,9 +237,9 @@ discard block |
||
237 | 237 | * |
238 | 238 | * @return void |
239 | 239 | */ |
240 | - public function render_frontend( $widget_args, $content = '', $context = '') { |
|
240 | + public function render_frontend( $widget_args, $content = '', $context = '' ) { |
|
241 | 241 | // to be defined by child class |
242 | - if( !$this->pre_render_frontend() ) { |
|
242 | + if ( ! $this->pre_render_frontend() ) { |
|
243 | 243 | return; |
244 | 244 | } |
245 | 245 | } |
@@ -251,8 +251,8 @@ discard block |
||
251 | 251 | public function pre_render_frontend() { |
252 | 252 | $gravityview_view = GravityView_View::getInstance(); |
253 | 253 | |
254 | - if( empty( $gravityview_view ) ) { |
|
255 | - do_action('gravityview_log_debug', sprintf( '%s[render_frontend]: $gravityview_view not instantiated yet.', get_class($this)) ); |
|
254 | + if ( empty( $gravityview_view ) ) { |
|
255 | + do_action( 'gravityview_log_debug', sprintf( '%s[render_frontend]: $gravityview_view not instantiated yet.', get_class( $this ) ) ); |
|
256 | 256 | return false; |
257 | 257 | } |
258 | 258 | |
@@ -263,8 +263,8 @@ discard block |
||
263 | 263 | */ |
264 | 264 | $hide_until_search = apply_filters( 'gravityview/widget/hide_until_searched', $gravityview_view->hide_until_searched, $this ); |
265 | 265 | |
266 | - if( $hide_until_search ) { |
|
267 | - do_action('gravityview_log_debug', sprintf( '%s[render_frontend]: Hide View data until search is performed', get_class($this)) ); |
|
266 | + if ( $hide_until_search ) { |
|
267 | + do_action( 'gravityview_log_debug', sprintf( '%s[render_frontend]: Hide View data until search is performed', get_class( $this ) ) ); |
|
268 | 268 | return false; |
269 | 269 | } |
270 | 270 |
@@ -20,15 +20,15 @@ |
||
20 | 20 | */ |
21 | 21 | function gravityview_register_gravityview_widgets() { |
22 | 22 | |
23 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget.php' ); |
|
23 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget.php' ); |
|
24 | 24 | |
25 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-pagination-info.php' ); |
|
26 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-page-links.php' ); |
|
27 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-custom-content.php' ); |
|
28 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/search-widget/class-search-widget.php' ); |
|
25 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-pagination-info.php' ); |
|
26 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-page-links.php' ); |
|
27 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-custom-content.php' ); |
|
28 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/search-widget/class-search-widget.php' ); |
|
29 | 29 | |
30 | - if( class_exists('GFPolls') ) { |
|
31 | - include_once( GRAVITYVIEW_DIR .'includes/widgets/poll/class-gravityview-widget-poll.php' ); |
|
30 | + if ( class_exists( 'GFPolls' ) ) { |
|
31 | + include_once( GRAVITYVIEW_DIR . 'includes/widgets/poll/class-gravityview-widget-poll.php' ); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | } |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | */ |
22 | 22 | function __construct() { |
23 | 23 | |
24 | - $this->widget_description = __('Displays the results of Poll Fields that exist in the form.', 'gravityview' ); |
|
24 | + $this->widget_description = __( 'Displays the results of Poll Fields that exist in the form.', 'gravityview' ); |
|
25 | 25 | |
26 | - $this->widget_subtitle = sprintf( _x('Note: this will display poll results for %sall form entries%s, not only the entries displayed in the View.', 'The string placeholders are for emphasis HTML', 'gravityview' ), '<em>', '</em>' ); |
|
26 | + $this->widget_subtitle = sprintf( _x( 'Note: this will display poll results for %sall form entries%s, not only the entries displayed in the View.', 'The string placeholders are for emphasis HTML', 'gravityview' ), '<em>', '</em>' ); |
|
27 | 27 | |
28 | 28 | $default_values = array( |
29 | 29 | 'header' => 1, |
@@ -32,32 +32,32 @@ discard block |
||
32 | 32 | |
33 | 33 | $settings = array( |
34 | 34 | 'percentages' => array( |
35 | - 'label' => __('Display Percentages', 'gravityview'), |
|
35 | + 'label' => __( 'Display Percentages', 'gravityview' ), |
|
36 | 36 | 'type' => 'checkbox', |
37 | 37 | 'value' => true, |
38 | 38 | 'tooltip' => __( 'Display results percentages as part of results? Supported values are: true, false. Defaults to "true".', 'gravityview' ), |
39 | 39 | ), |
40 | 40 | 'counts' => array( |
41 | - 'label' => __('Display Counts', 'gravityview'), |
|
41 | + 'label' => __( 'Display Counts', 'gravityview' ), |
|
42 | 42 | 'type' => 'checkbox', |
43 | 43 | 'value' => true, |
44 | 44 | 'tooltip' => __( 'Display number of times each choice has been selected when displaying results? Supported values are: true, false. Defaults to "true".', 'gravityview' ), |
45 | 45 | ), |
46 | 46 | 'style' => array( |
47 | 47 | 'type' => 'select', |
48 | - 'label' => __('Style', 'gravityview'), |
|
48 | + 'label' => __( 'Style', 'gravityview' ), |
|
49 | 49 | 'tooltip' => __( 'The Polls Add-On currently supports 4 built in styles: red, green, orange, blue. Defaults to "green".', 'gravityview' ), |
50 | 50 | 'value' => 'green', |
51 | 51 | 'choices' => array( |
52 | - 'green' => __('Green', 'gravityview'), |
|
53 | - 'blue' => __('Blue', 'gravityview'), |
|
54 | - 'red' => __('Red', 'gravityview'), |
|
55 | - 'orange' => __('Orange', 'gravityview'), |
|
52 | + 'green' => __( 'Green', 'gravityview' ), |
|
53 | + 'blue' => __( 'Blue', 'gravityview' ), |
|
54 | + 'red' => __( 'Red', 'gravityview' ), |
|
55 | + 'orange' => __( 'Orange', 'gravityview' ), |
|
56 | 56 | ) |
57 | 57 | ) |
58 | 58 | ); |
59 | 59 | |
60 | - parent::__construct( __( 'Poll Results', 'gravityview' ) , 'poll', $default_values, $settings ); |
|
60 | + parent::__construct( __( 'Poll Results', 'gravityview' ), 'poll', $default_values, $settings ); |
|
61 | 61 | |
62 | 62 | // frontend - add template path |
63 | 63 | add_filter( 'gravityview_template_paths', array( $this, 'add_template_path' ) ); |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | |
89 | 89 | $GFPolls = GFPolls::get_instance(); |
90 | 90 | |
91 | - wp_enqueue_script('gpoll_js', $GFPolls->get_base_url() . '/js/gpoll.js', array('jquery'), $GFPolls->_version); |
|
91 | + wp_enqueue_script( 'gpoll_js', $GFPolls->get_base_url() . '/js/gpoll.js', array( 'jquery' ), $GFPolls->_version ); |
|
92 | 92 | |
93 | 93 | $GFPolls->localize_scripts(); |
94 | 94 | |
95 | - wp_enqueue_style('gpoll_css', $GFPolls->get_base_url() . '/css/gpoll.css', null, $GFPolls->_version); |
|
95 | + wp_enqueue_style( 'gpoll_css', $GFPolls->get_base_url() . '/css/gpoll.css', null, $GFPolls->_version ); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function pre_render_frontend() { |
104 | 104 | |
105 | - if( !class_exists('GFPolls') ) { |
|
105 | + if ( ! class_exists( 'GFPolls' ) ) { |
|
106 | 106 | |
107 | 107 | $return = false; |
108 | 108 | |
@@ -158,14 +158,14 @@ discard block |
||
158 | 158 | * |
159 | 159 | * @since 1.8 |
160 | 160 | */ |
161 | - public function render_frontend( $widget_args, $content = '', $context = '') { |
|
161 | + public function render_frontend( $widget_args, $content = '', $context = '' ) { |
|
162 | 162 | |
163 | - if( !$this->pre_render_frontend() ) { |
|
163 | + if ( ! $this->pre_render_frontend() ) { |
|
164 | 164 | return; |
165 | 165 | } |
166 | 166 | |
167 | 167 | // Make sure the class is loaded in DataTables |
168 | - if( !class_exists( 'GFFormDisplay' ) ) { |
|
168 | + if ( ! class_exists( 'GFFormDisplay' ) ) { |
|
169 | 169 | include_once( GFCommon::get_base_path() . '/form_display.php' ); |
170 | 170 | } |
171 | 171 | |
@@ -173,14 +173,14 @@ discard block |
||
173 | 173 | |
174 | 174 | $settings = $this->get_frontend_settings( $widget_args ); |
175 | 175 | |
176 | - $percentages = empty( $settings['percentages'] ) ? 'false' : 'true'; |
|
176 | + $percentages = empty( $settings[ 'percentages' ] ) ? 'false' : 'true'; |
|
177 | 177 | |
178 | - $counts = empty( $settings['counts'] ) ? 'false' : 'true'; |
|
178 | + $counts = empty( $settings[ 'counts' ] ) ? 'false' : 'true'; |
|
179 | 179 | |
180 | - if( !empty( $settings['field'] ) ) { |
|
181 | - $merge_tag = sprintf( '{gpoll: field="%d" style="%s" percentages="%s" counts="%s"}', $settings['field'], $settings['style'], $percentages, $counts ); |
|
180 | + if ( ! empty( $settings[ 'field' ] ) ) { |
|
181 | + $merge_tag = sprintf( '{gpoll: field="%d" style="%s" percentages="%s" counts="%s"}', $settings[ 'field' ], $settings[ 'style' ], $percentages, $counts ); |
|
182 | 182 | } else { |
183 | - $merge_tag = sprintf( '{all_poll_results: style="%s" percentages="%s" counts="%s"}', $settings['style'], $percentages, $counts ); |
|
183 | + $merge_tag = sprintf( '{all_poll_results: style="%s" percentages="%s" counts="%s"}', $settings[ 'style' ], $percentages, $counts ); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | $gravityview_view = GravityView_View::getInstance(); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | |
190 | 190 | $gravityview_view->poll_settings = $settings; |
191 | 191 | |
192 | - $gravityview_view->render('widget', 'poll', false ); |
|
192 | + $gravityview_view->render( 'widget', 'poll', false ); |
|
193 | 193 | |
194 | 194 | } |
195 | 195 |
@@ -7,4 +7,4 @@ |
||
7 | 7 | |
8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
9 | 9 | $search_field = $gravityview_view->search_field; |
10 | -?><div><input type="hidden" name="<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>"></div> |
|
11 | 10 | \ No newline at end of file |
11 | +?><div><input type="hidden" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $search_field[ 'value' ] ); ?>"></div> |
|
12 | 12 | \ No newline at end of file |
@@ -7,17 +7,17 @@ |
||
7 | 7 | |
8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
9 | 9 | $view_id = $gravityview_view->getViewId(); |
10 | -$value = $gravityview_view->search_field['value']; |
|
11 | -$label = $gravityview_view->search_field['label']; |
|
12 | -$name = $gravityview_view->search_field['name']; |
|
10 | +$value = $gravityview_view->search_field[ 'value' ]; |
|
11 | +$label = $gravityview_view->search_field[ 'label' ]; |
|
12 | +$name = $gravityview_view->search_field[ 'name' ]; |
|
13 | 13 | ?> |
14 | 14 | |
15 | 15 | <div class="gv-search-box gv-search-date"> |
16 | - <?php if( ! gv_empty( $label, false ) ) { ?> |
|
17 | - <label for="search-box-<?php echo esc_attr( $name ).'-start'; ?>"><?php echo esc_html( $label ); ?></label> |
|
16 | + <?php if ( ! gv_empty( $label, false ) ) { ?> |
|
17 | + <label for="search-box-<?php echo esc_attr( $name ) . '-start'; ?>"><?php echo esc_html( $label ); ?></label> |
|
18 | 18 | <?php } ?> |
19 | 19 | <p> |
20 | - <input name="<?php echo esc_attr( $name ).'[start]'; ?>" id="search-box-<?php echo esc_attr( $name ).'-start'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('Start date', 'gravityview' ); ?>" value="<?php echo $value['start']; ?>"> |
|
21 | - <input name="<?php echo esc_attr( $name ).'[end]'; ?>" id="search-box-<?php echo esc_attr( $name ).'-end'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('End date', 'gravityview' ); ?>" value="<?php echo $value['end']; ?>"> |
|
20 | + <input name="<?php echo esc_attr( $name ) . '[start]'; ?>" id="search-box-<?php echo esc_attr( $name ) . '-start'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'Start date', 'gravityview' ); ?>" value="<?php echo $value[ 'start' ]; ?>"> |
|
21 | + <input name="<?php echo esc_attr( $name ) . '[end]'; ?>" id="search-box-<?php echo esc_attr( $name ) . '-end'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'End date', 'gravityview' ); ?>" value="<?php echo $value[ 'end' ]; ?>"> |
|
22 | 22 | </p> |
23 | 23 | </div> |
24 | 24 | \ No newline at end of file |
@@ -7,14 +7,14 @@ |
||
7 | 7 | |
8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
9 | 9 | $view_id = $gravityview_view->getViewId(); |
10 | -$value = $gravityview_view->search_field['value']; |
|
11 | -$label = $gravityview_view->search_field['label']; |
|
10 | +$value = $gravityview_view->search_field[ 'value' ]; |
|
11 | +$label = $gravityview_view->search_field[ 'label' ]; |
|
12 | 12 | |
13 | 13 | ?> |
14 | 14 | |
15 | 15 | <div class="gv-search-box"> |
16 | 16 | <div class="gv-search"> |
17 | - <?php if( ! gv_empty( $label, false ) ) { ?> |
|
17 | + <?php if ( ! gv_empty( $label, false ) ) { ?> |
|
18 | 18 | <label for="gv_search_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label> |
19 | 19 | <?php } ?> |
20 | 20 | <p><input type="text" name="gv_search" id="gv_search_<?php echo $view_id; ?>" value="<?php echo $value; ?>" /></p> |
@@ -7,13 +7,13 @@ |
||
7 | 7 | |
8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
9 | 9 | $view_id = $gravityview_view->getViewId(); |
10 | -$value = $gravityview_view->search_field['value']; |
|
11 | -$label = $gravityview_view->search_field['label']; |
|
10 | +$value = $gravityview_view->search_field[ 'value' ]; |
|
11 | +$label = $gravityview_view->search_field[ 'label' ]; |
|
12 | 12 | ?> |
13 | 13 | |
14 | 14 | <div class="gv-search-box"> |
15 | 15 | <div class="gv-search"> |
16 | - <?php if( ! gv_empty( $label, false ) ) { ?> |
|
16 | + <?php if ( ! gv_empty( $label, false ) ) { ?> |
|
17 | 17 | <label for="gv_entry_id_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label> |
18 | 18 | <?php } ?> |
19 | 19 | <p><input type="text" name="gv_id" id="gv_entry_id_<?php echo $view_id; ?>" value="<?php echo $value; ?>" /></p> |
@@ -10,22 +10,22 @@ |
||
10 | 10 | $search_field = $gravityview_view->search_field; |
11 | 11 | |
12 | 12 | // Make sure that there are choices to display |
13 | -if( empty( $search_field['choices'] ) ) { |
|
14 | - do_action('gravityview_log_debug', 'search-field-checkbox.php - No choices for field' ); |
|
13 | +if ( empty( $search_field[ 'choices' ] ) ) { |
|
14 | + do_action( 'gravityview_log_debug', 'search-field-checkbox.php - No choices for field' ); |
|
15 | 15 | return; |
16 | 16 | } |
17 | 17 | |
18 | 18 | ?> |
19 | 19 | <div class="gv-search-box"> |
20 | - <?php if( ! gv_empty( $search_field['label'], false ) ) { ?> |
|
21 | - <label for=search-box-<?php echo esc_attr( $search_field['name'] ); ?>><?php echo esc_html( $search_field['label'] ); ?></label> |
|
20 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false ) ) { ?> |
|
21 | + <label for=search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
22 | 22 | <?php } ?> |
23 | 23 | <p> |
24 | - <?php foreach( $search_field['choices'] as $choice ) { ?> |
|
24 | + <?php foreach ( $search_field[ 'choices' ] as $choice ) { ?> |
|
25 | 25 | |
26 | - <label for="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" class="gv-check-radio"> |
|
27 | - <input type="checkbox" name="<?php echo esc_attr( $search_field['name'] ); ?>[]" value="<?php echo esc_attr( $choice['value'] ); ?>" id="search-box-<?php echo sanitize_html_class( $search_field['name'].$choice['value'].$choice['text'] ); ?>" <?php gv_selected( $choice['value'], $search_field['value'], true, 'checked' ); ?>> |
|
28 | - <?php echo esc_html( $choice['text'] ); ?> |
|
26 | + <label for="search-box-<?php echo sanitize_html_class( $search_field[ 'name' ] . $choice[ 'value' ] . $choice[ 'text' ] ); ?>" class="gv-check-radio"> |
|
27 | + <input type="checkbox" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>[]" value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" id="search-box-<?php echo sanitize_html_class( $search_field[ 'name' ] . $choice[ 'value' ] . $choice[ 'text' ] ); ?>" <?php gv_selected( $choice[ 'value' ], $search_field[ 'value' ], true, 'checked' ); ?>> |
|
28 | + <?php echo esc_html( $choice[ 'text' ] ); ?> |
|
29 | 29 | </label> |
30 | 30 | |
31 | 31 | <?php } ?> |
@@ -7,17 +7,17 @@ |
||
7 | 7 | |
8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
9 | 9 | $view_id = $gravityview_view->getViewId(); |
10 | -$value = $gravityview_view->search_field['value']; |
|
11 | -$label = $gravityview_view->search_field['label']; |
|
10 | +$value = $gravityview_view->search_field[ 'value' ]; |
|
11 | +$label = $gravityview_view->search_field[ 'label' ]; |
|
12 | 12 | |
13 | 13 | ?> |
14 | 14 | |
15 | 15 | <div class="gv-search-box gv-search-date"> |
16 | - <?php if( ! gv_empty( $label, false ) ) { ?> |
|
16 | + <?php if ( ! gv_empty( $label, false ) ) { ?> |
|
17 | 17 | <label for="gv_start_date_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label> |
18 | 18 | <?php } ?> |
19 | 19 | <p> |
20 | - <input name="gv_start" id="gv_start_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('Start date', 'gravityview' ); ?>" value="<?php echo $value['start']; ?>"> |
|
21 | - <input name="gv_end" id="gv_end_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('End date', 'gravityview' ); ?>" value="<?php echo $value['end']; ?>"> |
|
20 | + <input name="gv_start" id="gv_start_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'Start date', 'gravityview' ); ?>" value="<?php echo $value[ 'start' ]; ?>"> |
|
21 | + <input name="gv_end" id="gv_end_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'End date', 'gravityview' ); ?>" value="<?php echo $value[ 'end' ]; ?>"> |
|
22 | 22 | </p> |
23 | 23 | </div> |
24 | 24 | \ No newline at end of file |