Completed
Push — develop ( ed597e...690c6a )
by Zack
20:17
created
future/includes/class-gv-template-view-table.php 2 patches
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
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,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public function __construct( View $view, Entry_Collection $entries, Request $request ) {
31 31
 
32
-	    add_filter( 'gravityview/template/field/label', array( $this, 'add_columns_sort_links' ), 100, 2 );
32
+		add_filter( 'gravityview/template/field/label', array( $this, 'add_columns_sort_links' ), 100, 2 );
33 33
 
34 34
 		parent::__construct( $view, $entries, $request );
35 35
 	}
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
 	}
46 46
 
47 47
 	/**
48
-     * Add sorting links to HTML columns that support sorting
49
-     *
50
-     * @since 2.0.4
51
-     *
48
+	 * Add sorting links to HTML columns that support sorting
49
+	 *
50
+	 * @since 2.0.4
51
+	 *
52 52
 	 * @param string $column_label Label for the table column
53 53
 	 * @param \GV\Template_Context $context
54 54
 	 *
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		$sort_columns = $context->view->settings->get( 'sort_columns' );
60 60
 
61 61
 		if ( empty( $sort_columns ) ) {
62
-            return $column_label;
62
+			return $column_label;
63 63
 		}
64 64
 
65 65
 		if ( ! \GravityView_frontend::getInstance()->is_field_sortable( $context->field->ID, $context->view->form->form ) ) {
@@ -200,15 +200,15 @@  discard block
 block discarded – undo
200 200
 				 */
201 201
 				do_action( 'gravityview/template/table/cells/before', $context );
202 202
 
203
-                /**
204
-                 * @action `gravityview_table_cells_before` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells.
205
-                 * @since 1.0.7
203
+				/**
204
+				 * @action `gravityview_table_cells_before` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells.
205
+				 * @since 1.0.7
206 206
 				 * @param GravityView_View $this Current GravityView_View object
207 207
 				 * @deprecated Use `gravityview/template/table/cells/before`
208
-                 */
209
-                do_action( 'gravityview_table_cells_before', \GravityView_View::getInstance() );
208
+				 */
209
+				do_action( 'gravityview_table_cells_before', \GravityView_View::getInstance() );
210 210
 
211
-                foreach ( $fields->all() as $field ) {
211
+				foreach ( $fields->all() as $field ) {
212 212
 					$this->the_field( $field, $entry );
213 213
 				}
214 214
 
@@ -219,13 +219,13 @@  discard block
 block discarded – undo
219 219
 				 */
220 220
 				do_action( 'gravityview/template/table/cells/after', $context );
221 221
 
222
-                /**
223
-                 * @action `gravityview_table_cells_after` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells.
224
-                 * @since 1.0.7
222
+				/**
223
+				 * @action `gravityview_table_cells_after` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells.
224
+				 * @since 1.0.7
225 225
 				 * @param GravityView_View $this Current GravityView_View object
226 226
 				 * @deprecated Use `gravityview/template/table/cells/after`
227
-                 */
228
-                do_action( 'gravityview_table_cells_after', \GravityView_View::getInstance() );
227
+				 */
228
+				do_action( 'gravityview_table_cells_after', \GravityView_View::getInstance() );
229 229
 
230 230
 				?>
231 231
 			</tr>
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 			'hide_empty' => false,
263 263
 			'zone_id' => 'directory_table-columns',
264 264
 			'markup' => '<td id="{{ field_id }}" class="{{ class }}">{{ value }}</td>',
265
-            'form' => $form,
265
+			'form' => $form,
266 266
 		);
267 267
 
268 268
 		/** Output. */
@@ -287,11 +287,11 @@  discard block
 block discarded – undo
287 287
 		do_action( 'gravityview/template/table/body/before', $context );
288 288
 
289 289
 		/**
290
-		* @action `gravityview_table_body_before` Inside the `tbody`, before any rows are rendered. Can be used to insert additional rows.
291
-		* @deprecated Use `gravityview/template/table/body/before`
292
-		* @since 1.0.7
293
-		* @param \GravityView_View $gravityview_view Current GravityView_View object.
294
-		*/
290
+		 * @action `gravityview_table_body_before` Inside the `tbody`, before any rows are rendered. Can be used to insert additional rows.
291
+		 * @deprecated Use `gravityview/template/table/body/before`
292
+		 * @since 1.0.7
293
+		 * @param \GravityView_View $gravityview_view Current GravityView_View object.
294
+		 */
295 295
 		do_action( 'gravityview_table_body_before', \GravityView_View::getInstance() /** ugh! */ );
296 296
 	}
297 297
 
@@ -313,11 +313,11 @@  discard block
 block discarded – undo
313 313
 		do_action( 'gravityview/template/table/body/after', $context );
314 314
 
315 315
 		/**
316
-		* @action `gravityview_table_body_after` Inside the `tbody`, after any rows are rendered. Can be used to insert additional rows.
317
-		* @deprecated Use `gravityview/template/table/body/after`
318
-		* @since 1.0.7
319
-		* @param \GravityView_View $gravityview_view Current GravityView_View object.
320
-		*/
316
+		 * @action `gravityview_table_body_after` Inside the `tbody`, after any rows are rendered. Can be used to insert additional rows.
317
+		 * @deprecated Use `gravityview/template/table/body/after`
318
+		 * @since 1.0.7
319
+		 * @param \GravityView_View $gravityview_view Current GravityView_View object.
320
+		 */
321 321
 		do_action( 'gravityview_table_body_after', \GravityView_View::getInstance() /** ugh! */ );
322 322
 	}
323 323
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -77,22 +77,22 @@
 block discarded – undo
77 77
 			'dir' => 'asc',
78 78
 		);
79 79
 
80
-		if ( ! empty( $sorting['key'] ) && (string) $sort_field_id === (string) $sorting['key'] ) {
80
+		if ( ! empty( $sorting[ 'key' ] ) && (string)$sort_field_id === (string)$sorting[ 'key' ] ) {
81 81
 			//toggle sorting direction.
82
-			if ( 'asc' === $sorting['direction'] ) {
83
-				$sort_args['dir'] = 'desc';
82
+			if ( 'asc' === $sorting[ 'direction' ] ) {
83
+				$sort_args[ 'dir' ] = 'desc';
84 84
 				$class .= ' gv-icon-sort-desc';
85 85
 			} else {
86
-				$sort_args['dir'] = 'asc';
86
+				$sort_args[ 'dir' ] = 'asc';
87 87
 				$class .= ' gv-icon-sort-asc';
88 88
 			}
89 89
 		} else {
90 90
 			$class .= ' gv-icon-caret-up-down';
91 91
 		}
92 92
 
93
-		$url = add_query_arg( $sort_args, remove_query_arg( array('pagenum') ) );
93
+		$url = add_query_arg( $sort_args, remove_query_arg( array( 'pagenum' ) ) );
94 94
 
95
-		return '<a href="'. esc_url_raw( $url ) .'" class="'. $class .'" ></a>&nbsp;'. $column_label;
95
+		return '<a href="' . esc_url_raw( $url ) . '" class="' . $class . '" ></a>&nbsp;' . $column_label;
96 96
 	}
97 97
 
98 98
 	/**
Please login to merge, or discard this patch.