@@ -7,11 +7,11 @@ |
||
7 | 7 | extract( $gravityview_view->getCurrentField() ); |
8 | 8 | |
9 | 9 | // Only show the link to logged-in users with the rigth caps. |
10 | -if( !GravityView_Delete_Entry::check_user_cap_delete_entry( $entry, $field_settings ) ) { |
|
10 | +if ( ! GravityView_Delete_Entry::check_user_cap_delete_entry( $entry, $field_settings ) ) { |
|
11 | 11 | return; |
12 | 12 | } |
13 | 13 | |
14 | -$link_text = empty( $field_settings['delete_link'] ) ? __('Delete Entry', 'gravityview') : $field_settings['delete_link']; |
|
14 | +$link_text = empty( $field_settings[ 'delete_link' ] ) ? __( 'Delete Entry', 'gravityview' ) : $field_settings[ 'delete_link' ]; |
|
15 | 15 | |
16 | 16 | $link_text = apply_filters( 'gravityview_entry_link', GravityView_API::replace_variables( $link_text, $form, $entry ) ); |
17 | 17 |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | function __construct() { |
16 | 16 | |
17 | 17 | // Only run on Admin |
18 | - if ( !is_admin() ) { |
|
18 | + if ( ! is_admin() ) { |
|
19 | 19 | return; |
20 | 20 | } |
21 | 21 | |
22 | 22 | // If the Duplicate Post plugin is active, don't run. |
23 | - if( defined('DUPLICATE_POST_CURRENT_VERSION') ) { |
|
23 | + if ( defined( 'DUPLICATE_POST_CURRENT_VERSION' ) ) { |
|
24 | 24 | return; |
25 | 25 | } |
26 | 26 | |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | global $post; |
61 | 61 | |
62 | 62 | // We only want to add Clone links to the Edit View metabox |
63 | - if( !$this->is_all_views_page() ) { |
|
63 | + if ( ! $this->is_all_views_page() ) { |
|
64 | 64 | |
65 | - if( $duplicate_links = $this->make_duplicate_link_row( array(), $post ) ) { |
|
66 | - $links[] = '<span>' . $duplicate_links['edit_as_new_draft'] . '</span>'; |
|
65 | + if ( $duplicate_links = $this->make_duplicate_link_row( array(), $post ) ) { |
|
66 | + $links[ ] = '<span>' . $duplicate_links[ 'edit_as_new_draft' ] . '</span>'; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * @param string|null If string, the status to set for the new View. If empty, use existing View status. |
120 | 120 | * @param WP_Post $post View being cloned |
121 | 121 | */ |
122 | - $new_view_status = apply_filters('gravityview/duplicate-view/status', $status, $post ); |
|
122 | + $new_view_status = apply_filters( 'gravityview/duplicate-view/status', $status, $post ); |
|
123 | 123 | |
124 | 124 | $new_view = array( |
125 | 125 | 'menu_order' => $post->menu_order, |
@@ -142,11 +142,11 @@ discard block |
||
142 | 142 | * @param boolean $copy_date Whether the copy the date from the existing View. Default: `false` |
143 | 143 | * @param WP_Post $post View being cloned |
144 | 144 | */ |
145 | - $copy_date = apply_filters('gravityview/duplicate-view/copy-date', false, $post ); |
|
145 | + $copy_date = apply_filters( 'gravityview/duplicate-view/copy-date', false, $post ); |
|
146 | 146 | |
147 | 147 | if ( $copy_date ) { |
148 | - $new_view['post_date'] = $new_post_date = $post->post_date; |
|
149 | - $new_view['post_date_gmt'] = get_gmt_from_date( $new_post_date ); |
|
148 | + $new_view[ 'post_date' ] = $new_post_date = $post->post_date; |
|
149 | + $new_view[ 'post_date_gmt' ] = get_gmt_from_date( $new_post_date ); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * @param array $new_view Array of settings to be passed to wp_insert_post() |
156 | 156 | * @param WP_Post $post View being cloned |
157 | 157 | */ |
158 | - $new_view = apply_filters('gravityview/duplicate-view/new-view', $new_view, $post ); |
|
158 | + $new_view = apply_filters( 'gravityview/duplicate-view/new-view', $new_view, $post ); |
|
159 | 159 | |
160 | 160 | // Magic happens here. |
161 | 161 | $new_view_id = wp_insert_post( $new_view ); |
@@ -237,13 +237,13 @@ discard block |
||
237 | 237 | $clone_text = __( 'Clone', 'gravityview' ); |
238 | 238 | $clone_title = __( 'Clone this View', 'gravityview' ); |
239 | 239 | |
240 | - $actions['clone'] = gravityview_get_link( $clone_link, $clone_text, 'title='.$clone_title ); |
|
240 | + $actions[ 'clone' ] = gravityview_get_link( $clone_link, $clone_text, 'title=' . $clone_title ); |
|
241 | 241 | |
242 | 242 | $clone_draft_link = $this->get_clone_view_link( $post->ID ); |
243 | 243 | $clone_draft_text = $this->is_all_views_page() ? __( 'New Draft', 'gravityview' ) : __( 'Clone View', 'gravityview' ); |
244 | 244 | $clone_draft_title = __( 'Copy as a new draft View', 'gravityview' ); |
245 | 245 | |
246 | - $actions['edit_as_new_draft'] = gravityview_get_link( $clone_draft_link, esc_html( $clone_draft_text ), 'title='.$clone_draft_title ); |
|
246 | + $actions[ 'edit_as_new_draft' ] = gravityview_get_link( $clone_draft_link, esc_html( $clone_draft_text ), 'title=' . $clone_draft_title ); |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | return $actions; |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | } |
268 | 268 | |
269 | 269 | // Verify the View exists |
270 | - if ( !$view = get_post( $id ) ) { |
|
270 | + if ( ! $view = get_post( $id ) ) { |
|
271 | 271 | return ''; |
272 | 272 | } |
273 | 273 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $post_type_object = get_post_type_object( $view->post_type ); |
283 | 283 | |
284 | 284 | /** If there's no gravityview post type for some reason, abort! */ |
285 | - if ( !$post_type_object ) { |
|
285 | + if ( ! $post_type_object ) { |
|
286 | 286 | do_action( 'gravityview_log_error', __METHOD__ . ' No gravityview post type exists when trying to clone the View.', $view ); |
287 | 287 | return ''; |
288 | 288 | } |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * @param int $view_id View ID |
295 | 295 | * @param string $context How to display the link. If "display", the URL is run through esc_html(). Default: `display` |
296 | 296 | */ |
297 | - $clone_view_link = apply_filters( 'gravityview/duplicate-view/get_clone_view_link', admin_url( "admin.php". $action ), $view->ID, $context ); |
|
297 | + $clone_view_link = apply_filters( 'gravityview/duplicate-view/get_clone_view_link', admin_url( "admin.php" . $action ), $view->ID, $context ); |
|
298 | 298 | |
299 | 299 | return $clone_view_link; |
300 | 300 | } |
@@ -321,14 +321,14 @@ discard block |
||
321 | 321 | */ |
322 | 322 | public function save_as_new_view( $status = '' ) { |
323 | 323 | |
324 | - if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) ) ) { |
|
324 | + if ( ! ( isset( $_GET[ 'post' ] ) || isset( $_POST[ 'post' ] ) ) ) { |
|
325 | 325 | wp_die( __( 'No post to duplicate has been supplied!', 'gravityview' ) ); |
326 | 326 | } |
327 | 327 | |
328 | 328 | // Get the original post |
329 | - $id = ( isset( $_GET['post'] ) ? $_GET['post'] : $_POST['post'] ); |
|
329 | + $id = ( isset( $_GET[ 'post' ] ) ? $_GET[ 'post' ] : $_POST[ 'post' ] ); |
|
330 | 330 | |
331 | - if( ! $this->current_user_can_copy( $id ) ) { |
|
331 | + if ( ! $this->current_user_can_copy( $id ) ) { |
|
332 | 332 | wp_die( __( 'You don\'t have permission to copy this View.', 'gravityview' ) ); |
333 | 333 | } |
334 | 334 |
@@ -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 |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | */ |
24 | 24 | do_action( 'gravityview_search_widget_fields_before', $this ); |
25 | 25 | |
26 | - foreach( $this->search_fields as $search_field ) { |
|
26 | + foreach ( $this->search_fields as $search_field ) { |
|
27 | 27 | $gravityview_view->search_field = $search_field; |
28 | - $this->render( 'search-field', $search_field['input'], false ); |
|
28 | + $this->render( 'search-field', $search_field[ 'input' ], false ); |
|
29 | 29 | |
30 | 30 | // show/hide the search button if there are input type fields |
31 | - if( !$has_inputs && $search_field['input'] != 'link' ) { |
|
31 | + if ( ! $has_inputs && $search_field[ 'input' ] != 'link' ) { |
|
32 | 32 | $has_inputs = true; |
33 | 33 | } |
34 | 34 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | do_action( 'gravityview_search_widget_fields_after', $this ); |
41 | 41 | |
42 | - if( $has_inputs ) { ?> |
|
42 | + if ( $has_inputs ) { ?> |
|
43 | 43 | <div class="gv-search-box gv-search-box-submit"> |
44 | 44 | <?php |
45 | 45 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | function __construct() { |
19 | 19 | |
20 | - $this->widget_description = __('Insert custom text or HTML as a widget', 'gravityview' ); |
|
20 | + $this->widget_description = __( 'Insert custom text or HTML as a widget', 'gravityview' ); |
|
21 | 21 | |
22 | 22 | $default_values = array( |
23 | 23 | 'header' => 1, |
@@ -42,39 +42,39 @@ discard block |
||
42 | 42 | ), |
43 | 43 | ); |
44 | 44 | |
45 | - parent::__construct( __( 'Custom Content', 'gravityview' ) , 'custom_content', $default_values, $settings ); |
|
45 | + parent::__construct( __( 'Custom Content', 'gravityview' ), 'custom_content', $default_values, $settings ); |
|
46 | 46 | } |
47 | 47 | |
48 | - public function render_frontend( $widget_args, $content = '', $context = '') { |
|
48 | + public function render_frontend( $widget_args, $content = '', $context = '' ) { |
|
49 | 49 | |
50 | - if( !$this->pre_render_frontend() ) { |
|
50 | + if ( ! $this->pre_render_frontend() ) { |
|
51 | 51 | return; |
52 | 52 | } |
53 | 53 | |
54 | - if( !empty( $widget_args['title'] ) ) { |
|
55 | - echo $widget_args['title']; |
|
54 | + if ( ! empty( $widget_args[ 'title' ] ) ) { |
|
55 | + echo $widget_args[ 'title' ]; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
59 | 59 | // Make sure the class is loaded in DataTables |
60 | - if( !class_exists( 'GFFormDisplay' ) ) { |
|
60 | + if ( ! class_exists( 'GFFormDisplay' ) ) { |
|
61 | 61 | include_once( GFCommon::get_base_path() . '/form_display.php' ); |
62 | 62 | } |
63 | 63 | |
64 | - $widget_args['content'] = trim( rtrim( $widget_args['content'] ) ); |
|
64 | + $widget_args[ 'content' ] = trim( rtrim( $widget_args[ 'content' ] ) ); |
|
65 | 65 | |
66 | 66 | // No custom content |
67 | - if( empty( $widget_args['content'] ) ) { |
|
68 | - do_action('gravityview_log_debug', sprintf( '%s[render_frontend]: No content.', get_class($this)) ); |
|
67 | + if ( empty( $widget_args[ 'content' ] ) ) { |
|
68 | + do_action( 'gravityview_log_debug', sprintf( '%s[render_frontend]: No content.', get_class( $this ) ) ); |
|
69 | 69 | return; |
70 | 70 | } |
71 | 71 | |
72 | 72 | // Add paragraphs? |
73 | - if( !empty( $widget_args['wpautop'] ) ) { |
|
74 | - $widget_args['content'] = wpautop( $widget_args['content'] ); |
|
73 | + if ( ! empty( $widget_args[ 'wpautop' ] ) ) { |
|
74 | + $widget_args[ 'content' ] = wpautop( $widget_args[ 'content' ] ); |
|
75 | 75 | } |
76 | 76 | |
77 | - $content = $widget_args['content']; |
|
77 | + $content = $widget_args[ 'content' ]; |
|
78 | 78 | |
79 | 79 | $content = GravityView_Merge_Tags::replace_variables( $content ); |
80 | 80 | |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | |
85 | 85 | |
86 | 86 | // Add custom class |
87 | - $class = !empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : ''; |
|
87 | + $class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : ''; |
|
88 | 88 | $class = gravityview_sanitize_html_class( $class ); |
89 | 89 | |
90 | - echo '<div class="gv-widget-custom-content '.$class.'">'. $content .'</div>'; |
|
90 | + echo '<div class="gv-widget-custom-content ' . $class . '">' . $content . '</div>'; |
|
91 | 91 | |
92 | 92 | } |
93 | 93 |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | function __construct() { |
18 | 18 | |
19 | - $this->widget_description = __('Summary of the number of visible entries out of the total results.', 'gravityview' ); |
|
19 | + $this->widget_description = __( 'Summary of the number of visible entries out of the total results.', 'gravityview' ); |
|
20 | 20 | |
21 | 21 | $default_values = array( |
22 | 22 | 'header' => 1, |
@@ -25,18 +25,18 @@ discard block |
||
25 | 25 | |
26 | 26 | $settings = array(); |
27 | 27 | |
28 | - parent::__construct( __( 'Show Pagination Info', 'gravityview' ) , 'page_info', $default_values, $settings ); |
|
28 | + parent::__construct( __( 'Show Pagination Info', 'gravityview' ), 'page_info', $default_values, $settings ); |
|
29 | 29 | } |
30 | 30 | |
31 | - public function render_frontend( $widget_args, $content = '', $context = '') { |
|
31 | + public function render_frontend( $widget_args, $content = '', $context = '' ) { |
|
32 | 32 | $gravityview_view = GravityView_View::getInstance(); |
33 | 33 | |
34 | - if( !$this->pre_render_frontend() ) { |
|
34 | + if ( ! $this->pre_render_frontend() ) { |
|
35 | 35 | return; |
36 | 36 | } |
37 | 37 | |
38 | - if( !empty( $widget_args['title'] ) ) { |
|
39 | - echo $widget_args['title']; |
|
38 | + if ( ! empty( $widget_args[ 'title' ] ) ) { |
|
39 | + echo $widget_args[ 'title' ]; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $pagination_counts = $gravityview_view->getPaginationCounts(); |
@@ -45,16 +45,16 @@ discard block |
||
45 | 45 | |
46 | 46 | $output = ''; |
47 | 47 | |
48 | - if( ! empty( $pagination_counts ) ) { |
|
48 | + if ( ! empty( $pagination_counts ) ) { |
|
49 | 49 | |
50 | - $first = $pagination_counts['first']; |
|
51 | - $last = $pagination_counts['last']; |
|
52 | - $total = $pagination_counts['total']; |
|
50 | + $first = $pagination_counts[ 'first' ]; |
|
51 | + $last = $pagination_counts[ 'last' ]; |
|
52 | + $total = $pagination_counts[ 'total' ]; |
|
53 | 53 | |
54 | - $class = !empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : ''; |
|
54 | + $class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : ''; |
|
55 | 55 | $class = gravityview_sanitize_html_class( $class ); |
56 | 56 | |
57 | - $output = '<div class="gv-widget-pagination '.$class.'"><p>'. sprintf(__( 'Displaying %1$s - %2$s of %3$s', 'gravityview' ), number_format_i18n( $first ), number_format_i18n( $last ), number_format_i18n( $total ) ) . '</p></div>'; |
|
57 | + $output = '<div class="gv-widget-pagination ' . $class . '"><p>' . sprintf( __( 'Displaying %1$s - %2$s of %3$s', 'gravityview' ), number_format_i18n( $first ), number_format_i18n( $last ), number_format_i18n( $total ) ) . '</p></div>'; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -170,25 +170,25 @@ discard block |
||
170 | 170 | public function get_output() { |
171 | 171 | |
172 | 172 | // No Entries |
173 | - if( empty( $this->entries ) ) { |
|
174 | - return '<div class="gv-no-results">'.$this->empty_message.'</div>'; |
|
173 | + if ( empty( $this->entries ) ) { |
|
174 | + return '<div class="gv-no-results">' . $this->empty_message . '</div>'; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | $output = ''; |
178 | 178 | $current_entry = GravityView_View::getInstance()->getCurrentEntry(); |
179 | 179 | |
180 | - $output .= '<'. $this->wrapper_tag .'>'; |
|
180 | + $output .= '<' . $this->wrapper_tag . '>'; |
|
181 | 181 | |
182 | - foreach( $this->entries as $entry ) { |
|
182 | + foreach ( $this->entries as $entry ) { |
|
183 | 183 | |
184 | - if( $this->skip_entry( $entry, $current_entry ) ) { |
|
184 | + if ( $this->skip_entry( $entry, $current_entry ) ) { |
|
185 | 185 | continue; |
186 | 186 | } |
187 | 187 | |
188 | 188 | $output .= $this->get_item_output( $entry ); |
189 | 189 | } |
190 | 190 | |
191 | - $output .= '</'. $this->wrapper_tag .'>'; |
|
191 | + $output .= '</' . $this->wrapper_tag . '>'; |
|
192 | 192 | |
193 | 193 | /** |
194 | 194 | * @filter `gravityview/widget/recent-entries/output` Modify the HTML of the Recent Entries widget output |
@@ -211,15 +211,15 @@ discard block |
||
211 | 211 | private function skip_entry( $entry, $current_entry ) { |
212 | 212 | |
213 | 213 | // If skip entry is off, or there's no current entry, return false |
214 | - if( empty( $this->skip_current_entry ) || empty( $current_entry ) ) { |
|
214 | + if ( empty( $this->skip_current_entry ) || empty( $current_entry ) ) { |
|
215 | 215 | return false; |
216 | 216 | } |
217 | 217 | |
218 | 218 | // If in Single or Edit mode, $current_entry will be an array. |
219 | - $current_entry_id = is_array( $current_entry ) ? $current_entry['id'] : $current_entry; |
|
219 | + $current_entry_id = is_array( $current_entry ) ? $current_entry[ 'id' ] : $current_entry; |
|
220 | 220 | |
221 | 221 | // If the entry ID matches the current entry, yes: skip |
222 | - if( $entry['id'] === $current_entry_id ) { |
|
222 | + if ( $entry[ 'id' ] === $current_entry_id ) { |
|
223 | 223 | return true; |
224 | 224 | } |
225 | 225 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | |
247 | 247 | $item_output = gravityview_get_link( $link, $this->link_format ); |
248 | 248 | |
249 | - if( !empty( $this->after_link ) ) { |
|
249 | + if ( ! empty( $this->after_link ) ) { |
|
250 | 250 | |
251 | 251 | /** |
252 | 252 | * @filter `gravityview/entry-list/after-link` Modify the content displayed after the entry link in an entry list |
@@ -255,14 +255,14 @@ discard block |
||
255 | 255 | * @param array $entry Gravity Forms entry array |
256 | 256 | * @param GravityView_Entry_List $this The current class instance |
257 | 257 | */ |
258 | - $after_link = apply_filters( 'gravityview/entry-list/after-link', '<div>'.$this->after_link.'</div>', $entry, $this ); |
|
258 | + $after_link = apply_filters( 'gravityview/entry-list/after-link', '<div>' . $this->after_link . '</div>', $entry, $this ); |
|
259 | 259 | |
260 | 260 | $item_output .= $after_link; |
261 | 261 | } |
262 | 262 | |
263 | 263 | $item_output = GravityView_API::replace_variables( $item_output, $this->form, $entry ); |
264 | 264 | |
265 | - $item_output = '<'. $this->item_tag .'>'. $item_output .'</'. $this->item_tag .'>'; |
|
265 | + $item_output = '<' . $this->item_tag . '>' . $item_output . '</' . $this->item_tag . '>'; |
|
266 | 266 | |
267 | 267 | /** |
268 | 268 | * @filter `gravityview/entry-list/item` Modify each item's output in an entry list |