@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * Constructor. Add filters to modify output. |
|
| 23 | - * |
|
| 22 | + * Constructor. Add filters to modify output. |
|
| 23 | + * |
|
| 24 | 24 | * @since 2.0.4 |
| 25 | 25 | * |
| 26 | 26 | * @param View $view |
@@ -29,19 +29,19 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function __construct( View $view, Entry_Collection $entries, Request $request ) { |
| 31 | 31 | |
| 32 | - add_filter( 'gravityview/template/field/label', array( __CLASS__, 'add_columns_sort_links' ), 100, 2 ); |
|
| 32 | + add_filter( 'gravityview/template/field/label', array( __CLASS__, 'add_columns_sort_links' ), 100, 2 ); |
|
| 33 | 33 | |
| 34 | 34 | parent::__construct( $view, $entries, $request ); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | - * Add sorting links to HTML columns that support sorting |
|
| 39 | - * |
|
| 40 | - * @since 2.0.4 |
|
| 41 | - * @since 2.0.5 Made static |
|
| 42 | - * |
|
| 43 | - * @static |
|
| 44 | - * |
|
| 38 | + * Add sorting links to HTML columns that support sorting |
|
| 39 | + * |
|
| 40 | + * @since 2.0.4 |
|
| 41 | + * @since 2.0.5 Made static |
|
| 42 | + * |
|
| 43 | + * @static |
|
| 44 | + * |
|
| 45 | 45 | * @param string $column_label Label for the table column |
| 46 | 46 | * @param \GV\Template_Context $context |
| 47 | 47 | * |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $sort_columns = $context->view->settings->get( 'sort_columns' ); |
| 53 | 53 | |
| 54 | 54 | if ( empty( $sort_columns ) ) { |
| 55 | - return $column_label; |
|
| 55 | + return $column_label; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | if ( ! \GravityView_frontend::getInstance()->is_field_sortable( $context->field->ID, $context->view->form->form ) ) { |
@@ -113,10 +113,10 @@ discard block |
||
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | - * Returns the label for a column, with support for all deprecated filters |
|
| 117 | - * |
|
| 118 | - * @since 2.1 |
|
| 119 | - * |
|
| 116 | + * Returns the label for a column, with support for all deprecated filters |
|
| 117 | + * |
|
| 118 | + * @since 2.1 |
|
| 119 | + * |
|
| 120 | 120 | * @param \GV\Field $field |
| 121 | 121 | * @param \GV\Template_Context $context |
| 122 | 122 | */ |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | $column_label = apply_filters( 'gravityview/template/field/label', $column_label, $context ); |
| 140 | 140 | |
| 141 | 141 | return $column_label; |
| 142 | - } |
|
| 142 | + } |
|
| 143 | 143 | |
| 144 | 144 | /** |
| 145 | 145 | * Output the entry row. |
@@ -208,15 +208,15 @@ discard block |
||
| 208 | 208 | */ |
| 209 | 209 | do_action( 'gravityview/template/table/cells/before', $context ); |
| 210 | 210 | |
| 211 | - /** |
|
| 212 | - * @action `gravityview_table_cells_before` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
| 213 | - * @since 1.0.7 |
|
| 211 | + /** |
|
| 212 | + * @action `gravityview_table_cells_before` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
| 213 | + * @since 1.0.7 |
|
| 214 | 214 | * @param \GravityView_View $this Current GravityView_View object |
| 215 | 215 | * @deprecated Use `gravityview/template/table/cells/before` |
| 216 | - */ |
|
| 217 | - do_action( 'gravityview_table_cells_before', \GravityView_View::getInstance() ); |
|
| 216 | + */ |
|
| 217 | + do_action( 'gravityview_table_cells_before', \GravityView_View::getInstance() ); |
|
| 218 | 218 | |
| 219 | - foreach ( $fields->all() as $field ) { |
|
| 219 | + foreach ( $fields->all() as $field ) { |
|
| 220 | 220 | if ( isset( $this->view->unions[ $entry['form_id'] ] ) ) { |
| 221 | 221 | if ( isset( $this->view->unions[ $entry['form_id'] ][ $field->ID ] ) ) { |
| 222 | 222 | $field = $this->view->unions[ $entry['form_id'] ][ $field->ID ]; |
@@ -236,13 +236,13 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | do_action( 'gravityview/template/table/cells/after', $context ); |
| 238 | 238 | |
| 239 | - /** |
|
| 240 | - * @action `gravityview_table_cells_after` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
| 241 | - * @since 1.0.7 |
|
| 239 | + /** |
|
| 240 | + * @action `gravityview_table_cells_after` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
| 241 | + * @since 1.0.7 |
|
| 242 | 242 | * @param \GravityView_View $this Current GravityView_View object |
| 243 | 243 | * @deprecated Use `gravityview/template/table/cells/after` |
| 244 | - */ |
|
| 245 | - do_action( 'gravityview_table_cells_after', \GravityView_View::getInstance() ); |
|
| 244 | + */ |
|
| 245 | + do_action( 'gravityview_table_cells_after', \GravityView_View::getInstance() ); |
|
| 246 | 246 | |
| 247 | 247 | ?> |
| 248 | 248 | </tr> |
@@ -283,9 +283,9 @@ discard block |
||
| 283 | 283 | 'value' => $value, |
| 284 | 284 | 'hide_empty' => false, |
| 285 | 285 | 'zone_id' => 'directory_table-columns', |
| 286 | - 'label' => self::get_field_column_label( $field, $context ), |
|
| 286 | + 'label' => self::get_field_column_label( $field, $context ), |
|
| 287 | 287 | 'markup' => '<td id="{{ field_id }}" class="{{ class }}" data-label="{{label_value:data-label}}">{{ value }}</td>', |
| 288 | - 'form' => $form, |
|
| 288 | + 'form' => $form, |
|
| 289 | 289 | ); |
| 290 | 290 | |
| 291 | 291 | /** Output. */ |
@@ -310,11 +310,11 @@ discard block |
||
| 310 | 310 | do_action( 'gravityview/template/table/body/before', $context ); |
| 311 | 311 | |
| 312 | 312 | /** |
| 313 | - * @action `gravityview_table_body_before` Inside the `tbody`, before any rows are rendered. Can be used to insert additional rows. |
|
| 314 | - * @deprecated Use `gravityview/template/table/body/before` |
|
| 315 | - * @since 1.0.7 |
|
| 316 | - * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 317 | - */ |
|
| 313 | + * @action `gravityview_table_body_before` Inside the `tbody`, before any rows are rendered. Can be used to insert additional rows. |
|
| 314 | + * @deprecated Use `gravityview/template/table/body/before` |
|
| 315 | + * @since 1.0.7 |
|
| 316 | + * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 317 | + */ |
|
| 318 | 318 | do_action( 'gravityview_table_body_before', \GravityView_View::getInstance() /** ugh! */ ); |
| 319 | 319 | } |
| 320 | 320 | |
@@ -336,11 +336,11 @@ discard block |
||
| 336 | 336 | do_action( 'gravityview/template/table/body/after', $context ); |
| 337 | 337 | |
| 338 | 338 | /** |
| 339 | - * @action `gravityview_table_body_after` Inside the `tbody`, after any rows are rendered. Can be used to insert additional rows. |
|
| 340 | - * @deprecated Use `gravityview/template/table/body/after` |
|
| 341 | - * @since 1.0.7 |
|
| 342 | - * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 343 | - */ |
|
| 339 | + * @action `gravityview_table_body_after` Inside the `tbody`, after any rows are rendered. Can be used to insert additional rows. |
|
| 340 | + * @deprecated Use `gravityview/template/table/body/after` |
|
| 341 | + * @since 1.0.7 |
|
| 342 | + * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 343 | + */ |
|
| 344 | 344 | do_action( 'gravityview_table_body_after', \GravityView_View::getInstance() /** ugh! */ ); |
| 345 | 345 | } |
| 346 | 346 | |
@@ -70,22 +70,22 @@ discard block |
||
| 70 | 70 | 'dir' => 'asc', |
| 71 | 71 | ); |
| 72 | 72 | |
| 73 | - if ( ! empty( $sorting['key'] ) && (string) $sort_field_id === (string) $sorting['key'] ) { |
|
| 73 | + if ( ! empty( $sorting[ 'key' ] ) && (string)$sort_field_id === (string)$sorting[ 'key' ] ) { |
|
| 74 | 74 | //toggle sorting direction. |
| 75 | - if ( 'asc' === $sorting['direction'] ) { |
|
| 76 | - $sort_args['dir'] = 'desc'; |
|
| 75 | + if ( 'asc' === $sorting[ 'direction' ] ) { |
|
| 76 | + $sort_args[ 'dir' ] = 'desc'; |
|
| 77 | 77 | $class .= ' gv-icon-sort-desc'; |
| 78 | 78 | } else { |
| 79 | - $sort_args['dir'] = 'asc'; |
|
| 79 | + $sort_args[ 'dir' ] = 'asc'; |
|
| 80 | 80 | $class .= ' gv-icon-sort-asc'; |
| 81 | 81 | } |
| 82 | 82 | } else { |
| 83 | 83 | $class .= ' gv-icon-caret-up-down'; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - $url = add_query_arg( $sort_args, remove_query_arg( array('pagenum') ) ); |
|
| 86 | + $url = add_query_arg( $sort_args, remove_query_arg( array( 'pagenum' ) ) ); |
|
| 87 | 87 | |
| 88 | - return '<a href="'. esc_url_raw( $url ) .'" class="'. $class .'" ></a> '. $column_label; |
|
| 88 | + return '<a href="' . esc_url_raw( $url ) . '" class="' . $class . '" ></a> ' . $column_label; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -217,9 +217,9 @@ discard block |
||
| 217 | 217 | do_action( 'gravityview_table_cells_before', \GravityView_View::getInstance() ); |
| 218 | 218 | |
| 219 | 219 | foreach ( $fields->all() as $field ) { |
| 220 | - if ( isset( $this->view->unions[ $entry['form_id'] ] ) ) { |
|
| 221 | - if ( isset( $this->view->unions[ $entry['form_id'] ][ $field->ID ] ) ) { |
|
| 222 | - $field = $this->view->unions[ $entry['form_id'] ][ $field->ID ]; |
|
| 220 | + if ( isset( $this->view->unions[ $entry[ 'form_id' ] ] ) ) { |
|
| 221 | + if ( isset( $this->view->unions[ $entry[ 'form_id' ] ][ $field->ID ] ) ) { |
|
| 222 | + $field = $this->view->unions[ $entry[ 'form_id' ] ][ $field->ID ]; |
|
| 223 | 223 | } else { |
| 224 | 224 | if ( ! $field instanceof Internal_Field ) { |
| 225 | 225 | $field = Internal_Field::from_configuration( array( 'id' => 'custom' ) ); |