@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | /** Entry does not belong to this view. */ |
| 47 | - if ( $view->form && $view->form->ID != $entry['form_id'] ) { |
|
| 47 | + if ( $view->form && $view->form->ID != $entry[ 'form_id' ] ) { |
|
| 48 | 48 | gravityview()->log->error( 'The requested entry does not belong to this View. Entry #{entry_id}, #View {view_id}', array( 'entry_id' => $entry->ID, 'view_id' => $view->ID ) ); |
| 49 | 49 | return null; |
| 50 | 50 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $self = new self(); |
| 56 | 56 | $self->form = $form; |
| 57 | 57 | |
| 58 | - $self->ID = intval( $self->form['id'] ); |
|
| 58 | + $self->ID = intval( $self->form[ 'id' ] ); |
|
| 59 | 59 | |
| 60 | 60 | return $self; |
| 61 | 61 | } |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | * @return \GV\GF_Form|null An instance of this form or null if not found. |
| 71 | 71 | */ |
| 72 | 72 | public static function from_form( $form ) { |
| 73 | - if ( empty( $form['id'] ) ) { |
|
| 73 | + if ( empty( $form[ 'id' ] ) ) { |
|
| 74 | 74 | return null; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | $self = new self(); |
| 78 | 78 | $self->form = $form; |
| 79 | - $self->ID = $self->form['id']; |
|
| 79 | + $self->ID = $self->form[ 'id' ]; |
|
| 80 | 80 | |
| 81 | 81 | return $self; |
| 82 | 82 | } |
@@ -119,11 +119,11 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | /** The offset and limit */ |
| 121 | 121 | if ( ! empty( $offset->limit ) ) { |
| 122 | - $paging['page_size'] = $offset->limit; |
|
| 122 | + $paging[ 'page_size' ] = $offset->limit; |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if ( ! empty( $offset->offset ) ) { |
| 126 | - $paging['offset'] = $offset->offset; |
|
| 126 | + $paging[ 'offset' ] = $offset->offset; |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | foreach ( \GFAPI::get_entries( $form->ID, $search_criteria, $sorting, $paging ) as $entry ) { |
@@ -180,8 +180,8 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | public function get_fields() { |
| 182 | 182 | $fields = array(); |
| 183 | - foreach ( $this['fields'] as $field ) { |
|
| 184 | - foreach ( empty( $field['inputs'] ) ? array( $field['id'] ) : wp_list_pluck( $field['inputs'], 'id' ) as $id ) { |
|
| 183 | + foreach ( $this[ 'fields' ] as $field ) { |
|
| 184 | + foreach ( empty( $field[ 'inputs' ] ) ? array( $field[ 'id' ] ) : wp_list_pluck( $field[ 'inputs' ], 'id' ) as $id ) { |
|
| 185 | 185 | if ( is_numeric( $id ) ) { |
| 186 | 186 | $fields[ $id ] = self::get_field( $this, $id ); |
| 187 | 187 | } else { |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | * @return bool Whether the offset exists or not. |
| 219 | 219 | */ |
| 220 | 220 | public function offsetExists( $offset ) { |
| 221 | - return isset( $this->form[$offset] ); |
|
| 221 | + return isset( $this->form[ $offset ] ); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @return mixed The value of the requested form data. |
| 234 | 234 | */ |
| 235 | 235 | public function offsetGet( $offset ) { |
| 236 | - return $this->form[$offset]; |
|
| 236 | + return $this->form[ $offset ]; |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | /** |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | 'detail' => null, |
| 38 | 38 | ) ); |
| 39 | 39 | |
| 40 | - if ( ! $view_id = $atts['id'] ? : $atts['view_id'] ) { |
|
| 41 | - if ( $atts['detail'] && $view = $request->is_view() ) { |
|
| 40 | + if ( ! $view_id = $atts[ 'id' ] ?: $atts[ 'view_id' ] ) { |
|
| 41 | + if ( $atts[ 'detail' ] && $view = $request->is_view() ) { |
|
| 42 | 42 | $view_id = $view->ID; |
| 43 | 43 | } |
| 44 | 44 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | return get_the_password_form( $view->ID ); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - if ( ! $view->form ) { |
|
| 83 | + if ( ! $view->form ) { |
|
| 84 | 84 | gravityview()->log->notice( 'View #{id} has no form attached to it.', array( 'id' => $view->ID ) ); |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -101,12 +101,12 @@ discard block |
||
| 101 | 101 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap('gravityview_moderate_entries', $view->ID ); |
|
| 104 | + $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap( 'gravityview_moderate_entries', $view->ID ); |
|
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | 107 | * View details. |
| 108 | 108 | */ |
| 109 | - if ( $atts['detail'] ) { |
|
| 109 | + if ( $atts[ 'detail' ] ) { |
|
| 110 | 110 | return $this->detail( $view, $entries, $atts ); |
| 111 | 111 | |
| 112 | 112 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | return ''; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - if ( $entry['status'] != 'active' ) { |
|
| 125 | + if ( $entry[ 'status' ] != 'active' ) { |
|
| 126 | 126 | gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) ); |
| 127 | 127 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
| 128 | 128 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) { |
| 136 | - if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 136 | + if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 137 | 137 | gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) ); |
| 138 | 138 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
| 139 | 139 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | return ''; |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - if ( $entry['status'] != 'active' ) { |
|
| 156 | + if ( $entry[ 'status' ] != 'active' ) { |
|
| 157 | 157 | gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) ); |
| 158 | 158 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
| 159 | 159 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) { |
| 167 | - if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 167 | + if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 168 | 168 | gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) ); |
| 169 | 169 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
| 170 | 170 | } |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | $error = \GVCommon::check_entry_display( $entry->as_entry() ); |
| 174 | 174 | |
| 175 | - if( is_wp_error( $error ) ) { |
|
| 175 | + if ( is_wp_error( $error ) ) { |
|
| 176 | 176 | gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing: {message}', array( 'entry_id' => $entry->ID, 'message' => $error->get_error_message() ) ); |
| 177 | 177 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
| 178 | 178 | } |
@@ -188,10 +188,10 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | // Mock the request with the actual View, not the global one |
| 190 | 190 | $mock_request = new \GV\Mock_Request(); |
| 191 | - $mock_request->returns['is_view'] = $view; |
|
| 192 | - $mock_request->returns['is_entry'] = $request->is_entry(); |
|
| 193 | - $mock_request->returns['is_edit_entry'] = $request->is_edit_entry(); |
|
| 194 | - $mock_request->returns['is_search'] = $request->is_search(); |
|
| 191 | + $mock_request->returns[ 'is_view' ] = $view; |
|
| 192 | + $mock_request->returns[ 'is_entry' ] = $request->is_entry(); |
|
| 193 | + $mock_request->returns[ 'is_edit_entry' ] = $request->is_edit_entry(); |
|
| 194 | + $mock_request->returns[ 'is_search' ] = $request->is_search(); |
|
| 195 | 195 | |
| 196 | 196 | $request = $mock_request; |
| 197 | 197 | } |
@@ -227,16 +227,16 @@ discard block |
||
| 227 | 227 | $filtered_atts = shortcode_atts( $supported_atts, $passed_atts, 'gravityview' ); |
| 228 | 228 | |
| 229 | 229 | // Only keep the passed attributes after making sure that they're valid pairs |
| 230 | - $filtered_atts = array_intersect_key( (array) $passed_atts, $filtered_atts ); |
|
| 230 | + $filtered_atts = array_intersect_key( (array)$passed_atts, $filtered_atts ); |
|
| 231 | 231 | |
| 232 | 232 | $atts = array(); |
| 233 | 233 | |
| 234 | - foreach( $filtered_atts as $key => $passed_value ) { |
|
| 234 | + foreach ( $filtered_atts as $key => $passed_value ) { |
|
| 235 | 235 | |
| 236 | 236 | // Allow using GravityView merge tags in shortcode attributes, like {get} and {created_by} |
| 237 | 237 | $passed_value = \GravityView_Merge_Tags::replace_variables( $passed_value ); |
| 238 | 238 | |
| 239 | - switch( $defaults[ $key ]['type'] ) { |
|
| 239 | + switch ( $defaults[ $key ][ 'type' ] ) { |
|
| 240 | 240 | |
| 241 | 241 | /** |
| 242 | 242 | * Make sure number fields are numeric. |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | * @see http://php.net/manual/en/function.is-numeric.php#107326 |
| 245 | 245 | */ |
| 246 | 246 | case 'number': |
| 247 | - if( is_numeric( $passed_value ) ) { |
|
| 247 | + if ( is_numeric( $passed_value ) ) { |
|
| 248 | 248 | $atts[ $key ] = ( $passed_value + 0 ); |
| 249 | 249 | } |
| 250 | 250 | break; |
@@ -259,8 +259,8 @@ discard block |
||
| 259 | 259 | */ |
| 260 | 260 | case 'select': |
| 261 | 261 | case 'radio': |
| 262 | - $options = isset( $defaults[ $key ]['choices'] ) ? $defaults[ $key ]['choices'] : $defaults[ $key ]['options']; |
|
| 263 | - if( in_array( $passed_value, array_keys( $options ) ) ) { |
|
| 262 | + $options = isset( $defaults[ $key ][ 'choices' ] ) ? $defaults[ $key ][ 'choices' ] : $defaults[ $key ][ 'options' ]; |
|
| 263 | + if ( in_array( $passed_value, array_keys( $options ) ) ) { |
|
| 264 | 264 | $atts[ $key ] = $passed_value; |
| 265 | 265 | } |
| 266 | 266 | break; |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | } |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | - $atts['detail'] = \GV\Utils::get( $passed_atts, 'detail', null ); |
|
| 275 | + $atts[ 'detail' ] = \GV\Utils::get( $passed_atts, 'detail', null ); |
|
| 276 | 276 | |
| 277 | 277 | return $atts; |
| 278 | 278 | } |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | private function detail( $view, $entries, $atts ) { |
| 290 | 290 | $output = ''; |
| 291 | 291 | |
| 292 | - switch ( $key = $atts['detail'] ): |
|
| 292 | + switch ( $key = $atts[ 'detail' ] ): |
|
| 293 | 293 | case 'total_entries': |
| 294 | 294 | $output = number_format_i18n( $entries->total() ); |
| 295 | 295 | break; |
@@ -105,14 +105,14 @@ discard block |
||
| 105 | 105 | * @return \GV\GF_Entry|null An instance of this entry or null if not found. |
| 106 | 106 | */ |
| 107 | 107 | public static function from_entry( $entry ) { |
| 108 | - if ( empty( $entry['id'] ) ) { |
|
| 108 | + if ( empty( $entry[ 'id' ] ) ) { |
|
| 109 | 109 | return null; |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | $self = new self(); |
| 113 | 113 | $self->entry = $entry; |
| 114 | 114 | |
| 115 | - $self->ID = $self->entry['id']; |
|
| 115 | + $self->ID = $self->entry[ 'id' ]; |
|
| 116 | 116 | $self->slug = \GravityView_API::get_entry_slug( $self->ID, $self->as_entry() ); |
| 117 | 117 | |
| 118 | 118 | return $self; |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * @return bool Whether the offset exists or not. |
| 128 | 128 | */ |
| 129 | 129 | public function offsetExists( $offset ) { |
| 130 | - return isset( $this->entry[$offset] ); |
|
| 130 | + return isset( $this->entry[ $offset ] ); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | * @return mixed The value of the requested entry data. |
| 143 | 143 | */ |
| 144 | 144 | public function offsetGet( $offset ) { |
| 145 | - return $this->entry[$offset]; |
|
| 145 | + return $this->entry[ $offset ]; |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /** |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $supports = array( 'title', 'revisions' ); |
| 109 | 109 | |
| 110 | 110 | if ( $is_hierarchical ) { |
| 111 | - $supports[] = 'page-attributes'; |
|
| 111 | + $supports[ ] = 'page-attributes'; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -288,13 +288,13 @@ discard block |
||
| 288 | 288 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | - $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap('gravityview_moderate_entries', $view->ID ); |
|
| 291 | + $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap( 'gravityview_moderate_entries', $view->ID ); |
|
| 292 | 292 | |
| 293 | 293 | /** |
| 294 | 294 | * Editing a single entry. |
| 295 | 295 | */ |
| 296 | 296 | if ( $entry = $request->is_edit_entry() ) { |
| 297 | - if ( $entry['status'] != 'active' ) { |
|
| 297 | + if ( $entry[ 'status' ] != 'active' ) { |
|
| 298 | 298 | gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) ); |
| 299 | 299 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
| 300 | 300 | } |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) { |
| 308 | - if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 308 | + if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 309 | 309 | gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) ); |
| 310 | 310 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
| 311 | 311 | } |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | * Viewing a single entry. |
| 319 | 319 | */ |
| 320 | 320 | } else if ( $entry = $request->is_entry() ) { |
| 321 | - if ( $entry['status'] != 'active' ) { |
|
| 321 | + if ( $entry[ 'status' ] != 'active' ) { |
|
| 322 | 322 | gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) ); |
| 323 | 323 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
| 324 | 324 | } |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) { |
| 332 | - if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 332 | + if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 333 | 333 | gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) ); |
| 334 | 334 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
| 335 | 335 | } |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | |
| 338 | 338 | $error = \GVCommon::check_entry_display( $entry->as_entry() ); |
| 339 | 339 | |
| 340 | - if( is_wp_error( $error ) ) { |
|
| 340 | + if ( is_wp_error( $error ) ) { |
|
| 341 | 341 | gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing: {message}', array( 'entry_id' => $entry->ID, 'message' => $error->get_error_message() ) ); |
| 342 | 342 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
| 343 | 343 | } |
@@ -384,14 +384,14 @@ discard block |
||
| 384 | 384 | if ( ! $view->form ) { |
| 385 | 385 | gravityview()->log->error( 'View #{view_id} tried attaching non-existent Form #{form_id} to it.', array( |
| 386 | 386 | 'view_id' => $view->ID, |
| 387 | - 'form_id' => $view->_gravityview_form_id ? : 0, |
|
| 387 | + 'form_id' => $view->_gravityview_form_id ?: 0, |
|
| 388 | 388 | ) ); |
| 389 | 389 | } else if ( gravityview()->plugin->supports( Plugin::FEATURE_JOINS ) ) { |
| 390 | 390 | |
| 391 | - $_joins = (array) get_post_meta( $view->ID, '_gravityview_form_joins', true ); |
|
| 391 | + $_joins = (array)get_post_meta( $view->ID, '_gravityview_form_joins', true ); |
|
| 392 | 392 | |
| 393 | 393 | /** And the connected joins. */ |
| 394 | - foreach( $_joins as $_join ) { |
|
| 394 | + foreach ( $_joins as $_join ) { |
|
| 395 | 395 | |
| 396 | 396 | if ( ! is_array( $_join ) || count( $_join ) != 4 ) { |
| 397 | 397 | continue; |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | $join_column = is_numeric( $join_column ) ? GF_Field::by_id( $join, $join_column ) : Internal_Field::by_id( $join_column ); |
| 405 | 405 | $join_on_column = is_numeric( $join_on_column ) ? GF_Field::by_id( $join_on, $join_on_column ) : Internal_Field::by_id( $join_on_column ); |
| 406 | 406 | |
| 407 | - $view->joins []= new Join( $join, $join_column, $join_on, $join_on_column ); |
|
| 407 | + $view->joins [ ] = new Join( $join, $join_column, $join_on, $join_on_column ); |
|
| 408 | 408 | } |
| 409 | 409 | } |
| 410 | 410 | |
@@ -628,28 +628,27 @@ discard block |
||
| 628 | 628 | * @todo: Stop using _frontend and use something like $request->get_search_criteria() instead |
| 629 | 629 | */ |
| 630 | 630 | $parameters = \GravityView_frontend::get_view_entries_parameters( $this->settings->as_atts(), $this->form->ID ); |
| 631 | - $parameters['context_view_id'] = $this->ID; |
|
| 631 | + $parameters[ 'context_view_id' ] = $this->ID; |
|
| 632 | 632 | $parameters = \GVCommon::calculate_get_entries_criteria( $parameters, $this->form->ID ); |
| 633 | 633 | |
| 634 | 634 | if ( $request instanceof REST\Request ) { |
| 635 | 635 | $atts = $this->settings->as_atts(); |
| 636 | 636 | $paging_parameters = wp_parse_args( $request->get_paging(), array( |
| 637 | - 'paging' => array( 'page_size' => $atts['page_size'] ), |
|
| 637 | + 'paging' => array( 'page_size' => $atts[ 'page_size' ] ), |
|
| 638 | 638 | ) ); |
| 639 | - $parameters['paging'] = $paging_parameters['paging']; |
|
| 639 | + $parameters[ 'paging' ] = $paging_parameters[ 'paging' ]; |
|
| 640 | 640 | } |
| 641 | 641 | |
| 642 | - $page = Utils::get( $parameters['paging'], 'current_page' ) ? |
|
| 643 | - : ( ( ( $parameters['paging']['offset'] - $this->settings->get( 'offset' ) ) / $parameters['paging']['page_size'] ) + 1 ); |
|
| 642 | + $page = Utils::get( $parameters[ 'paging' ], 'current_page' ) ?: ( ( ( $parameters[ 'paging' ][ 'offset' ] - $this->settings->get( 'offset' ) ) / $parameters[ 'paging' ][ 'page_size' ] ) + 1 ); |
|
| 644 | 643 | |
| 645 | 644 | if ( gravityview()->plugin->supports( Plugin::FEATURE_GFQUERY ) ) { |
| 646 | 645 | /** |
| 647 | 646 | * New \GF_Query stuff :) |
| 648 | 647 | */ |
| 649 | - $query = new \GF_Query( $this->form->ID, $parameters['search_criteria'], $parameters['sorting'] ); |
|
| 648 | + $query = new \GF_Query( $this->form->ID, $parameters[ 'search_criteria' ], $parameters[ 'sorting' ] ); |
|
| 650 | 649 | |
| 651 | - $query->limit( $parameters['paging']['page_size'] ) |
|
| 652 | - ->offset( ( ( $page - 1 ) * $parameters['paging']['page_size'] ) + $this->settings->get( 'offset' ) ); |
|
| 650 | + $query->limit( $parameters[ 'paging' ][ 'page_size' ] ) |
|
| 651 | + ->offset( ( ( $page - 1 ) * $parameters[ 'paging' ][ 'page_size' ] ) + $this->settings->get( 'offset' ) ); |
|
| 653 | 652 | |
| 654 | 653 | /** |
| 655 | 654 | * Any joins? |
@@ -689,15 +688,15 @@ discard block |
||
| 689 | 688 | } ); |
| 690 | 689 | } else { |
| 691 | 690 | $entries = $this->form->entries |
| 692 | - ->filter( \GV\GF_Entry_Filter::from_search_criteria( $parameters['search_criteria'] ) ) |
|
| 691 | + ->filter( \GV\GF_Entry_Filter::from_search_criteria( $parameters[ 'search_criteria' ] ) ) |
|
| 693 | 692 | ->offset( $this->settings->get( 'offset' ) ) |
| 694 | - ->limit( $parameters['paging']['page_size'] ) |
|
| 693 | + ->limit( $parameters[ 'paging' ][ 'page_size' ] ) |
|
| 695 | 694 | ->page( $page ); |
| 696 | 695 | |
| 697 | - if ( ! empty( $parameters['sorting'] ) && ! empty( $parameters['sorting']['key'] ) ) { |
|
| 696 | + if ( ! empty( $parameters[ 'sorting' ] ) && ! empty( $parameters[ 'sorting' ][ 'key' ] ) ) { |
|
| 698 | 697 | $field = new \GV\Field(); |
| 699 | - $field->ID = $parameters['sorting']['key']; |
|
| 700 | - $direction = strtolower( $parameters['sorting']['direction'] ) == 'asc' ? \GV\Entry_Sort::ASC : \GV\Entry_Sort::DESC; |
|
| 698 | + $field->ID = $parameters[ 'sorting' ][ 'key' ]; |
|
| 699 | + $direction = strtolower( $parameters[ 'sorting' ][ 'direction' ] ) == 'asc' ? \GV\Entry_Sort::ASC : \GV\Entry_Sort::DESC; |
|
| 701 | 700 | $entries = $entries->sort( new \GV\Entry_Sort( $field, $direction ) ); |
| 702 | 701 | } |
| 703 | 702 | } |