Completed
Push — develop ( ac8cbc...9439ba )
by Gennady
11:48
created
future/includes/class-gv-template-view-table.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 
66 66
 		foreach ( (array)$context->view->settings->get( 'sort_field', array() ) as $i => $sort_field ) {
67 67
 			if ( $sort_field == $context->field->ID ) {
68
-				$sorting['key'] = $sort_field;
69
-				$sorting['direction'] = strtolower( Utils::get( $directions, $i, 'asc' ) );
68
+				$sorting[ 'key' ] = $sort_field;
69
+				$sorting[ 'direction' ] = strtolower( Utils::get( $directions, $i, 'asc' ) );
70 70
 				break;
71 71
 			}
72 72
 		}
@@ -80,22 +80,22 @@  discard block
 block discarded – undo
80 80
 			'dir' => 'asc',
81 81
 		);
82 82
 
83
-		if ( ! empty( $sorting['key'] ) && (string) $sort_field_id === (string) $sorting['key'] ) {
83
+		if ( ! empty( $sorting[ 'key' ] ) && (string)$sort_field_id === (string)$sorting[ 'key' ] ) {
84 84
 			//toggle sorting direction.
85
-			if ( 'asc' === $sorting['direction'] ) {
86
-				$sort_args['dir'] = 'desc';
85
+			if ( 'asc' === $sorting[ 'direction' ] ) {
86
+				$sort_args[ 'dir' ] = 'desc';
87 87
 				$class .= ' gv-icon-sort-desc';
88 88
 			} else {
89
-				$sort_args['dir'] = 'asc';
89
+				$sort_args[ 'dir' ] = 'asc';
90 90
 				$class .= ' gv-icon-sort-asc';
91 91
 			}
92 92
 		} else {
93 93
 			$class .= ' gv-icon-caret-up-down';
94 94
 		}
95 95
 
96
-		$url = add_query_arg( $sort_args, remove_query_arg( array('pagenum') ) );
96
+		$url = add_query_arg( $sort_args, remove_query_arg( array( 'pagenum' ) ) );
97 97
 
98
-		return '<a href="'. esc_url_raw( $url ) .'" class="'. $class .'" ></a>&nbsp;'. $column_label;
98
+		return '<a href="' . esc_url_raw( $url ) . '" class="' . $class . '" ></a>&nbsp;' . $column_label;
99 99
 	}
100 100
 
101 101
 	/**
@@ -227,9 +227,9 @@  discard block
 block discarded – undo
227 227
                 do_action( 'gravityview_table_cells_before', \GravityView_View::getInstance() );
228 228
 
229 229
                 foreach ( $fields->all() as $field ) {
230
-					if ( isset( $this->view->unions[ $entry['form_id'] ] ) ) {
231
-						if ( isset( $this->view->unions[ $entry['form_id'] ][ $field->ID ] ) ) {
232
-							$field = $this->view->unions[ $entry['form_id'] ][ $field->ID ];
230
+					if ( isset( $this->view->unions[ $entry[ 'form_id' ] ] ) ) {
231
+						if ( isset( $this->view->unions[ $entry[ 'form_id' ] ][ $field->ID ] ) ) {
232
+							$field = $this->view->unions[ $entry[ 'form_id' ] ][ $field->ID ];
233 233
 						} else {
234 234
 							if ( ! $field instanceof Internal_Field ) {
235 235
 								$field = Internal_Field::from_configuration( array( 'id' => 'custom' ) );
Please login to merge, or discard this patch.
includes/admin/metaboxes/views/sort-filter.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,18 +28,18 @@
 block discarded – undo
28 28
 
29 29
 	$sort_fields_input = '<select name="template_settings[sort_field][]" class="gravityview_sort_field" id="gravityview_sort_field_%d">%s</select>';
30 30
 
31
-	if ( is_array( $current_settings['sort_field'] ) ) {
32
-		$primary_sort_fields = gravityview_get_sortable_fields( $curr_form, $current_settings['sort_field'][0] );
33
-		$secondary_sort_fields = gravityview_get_sortable_fields( $curr_form, $current_settings['sort_field'][1] );
31
+	if ( is_array( $current_settings[ 'sort_field' ] ) ) {
32
+		$primary_sort_fields = gravityview_get_sortable_fields( $curr_form, $current_settings[ 'sort_field' ][ 0 ] );
33
+		$secondary_sort_fields = gravityview_get_sortable_fields( $curr_form, $current_settings[ 'sort_field' ][ 1 ] );
34 34
 	} else {
35
-		$primary_sort_fields = $secondary_sort_fields = gravityview_get_sortable_fields( $curr_form, $current_settings['sort_field'] );
35
+		$primary_sort_fields = $secondary_sort_fields = gravityview_get_sortable_fields( $curr_form, $current_settings[ 'sort_field' ] );
36 36
 	}
37 37
 
38 38
 	// Splice the sort direction
39 39
 	$_directions = array();
40 40
 	foreach ( (array)\GV\Utils::get( $current_settings, 'sort_direction', array() ) as $i => $direction ) {
41 41
 		if ( ! $i ) {
42
-			$_directions['sort_direction'] = $direction;
42
+			$_directions[ 'sort_direction' ] = $direction;
43 43
 		} else {
44 44
 			$_directions[ sprintf( 'sort_direction_%d', $i + 1 ) ] = $direction;
45 45
 		}
Please login to merge, or discard this patch.