Completed
Push — master ( c88ec9...3f715e )
by Jamie
03:33
created
classes/models/FrmSettings.php 1 patch
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-class FrmSettings{
3
+class FrmSettings {
4 4
     public $option_name = 'frm_options';
5 5
     public $menu;
6 6
     public $mu_menu;
@@ -47,7 +47,8 @@  discard block
 block discarded – undo
47 47
     }
48 48
 
49 49
 	private function translate_settings( $settings ) {
50
-        if ( $settings ) { //workaround for W3 total cache conflict
50
+        if ( $settings ) {
51
+//workaround for W3 total cache conflict
51 52
             return unserialize(serialize($settings));
52 53
         }
53 54
 
@@ -58,7 +59,8 @@  discard block
 block discarded – undo
58 59
         }
59 60
 
60 61
         // If unserializing didn't work
61
-        if ( $settings ) { //workaround for W3 total cache conflict
62
+        if ( $settings ) {
63
+//workaround for W3 total cache conflict
62 64
             $settings = unserialize(serialize($settings));
63 65
         } else {
64 66
             $settings = $this;
Please login to merge, or discard this patch.
classes/helpers/FrmListHelper.php 1 patch
Braces   +89 added lines, -62 removed lines patch added patch discarded remove patch
@@ -104,8 +104,9 @@  discard block
 block discarded – undo
104 104
 
105 105
 		add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 );
106 106
 
107
-		if ( !$args['plural'] )
108
-			$args['plural'] = $this->screen->base;
107
+		if ( !$args['plural'] ) {
108
+					$args['plural'] = $this->screen->base;
109
+		}
109 110
 
110 111
 		$args['plural'] = sanitize_key( $args['plural'] );
111 112
 		$args['singular'] = sanitize_key( $args['singular'] );
@@ -245,8 +246,9 @@  discard block
 block discarded – undo
245 246
 			'per_page' => 0,
246 247
 		) );
247 248
 
248
-		if ( !$args['total_pages'] && $args['per_page'] > 0 )
249
-			$args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
249
+		if ( !$args['total_pages'] && $args['per_page'] > 0 ) {
250
+					$args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
251
+		}
250 252
 
251 253
 		// Redirect if page number is invalid and headers are not already sent.
252 254
 		if ( ! headers_sent() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {
@@ -268,11 +270,13 @@  discard block
 block discarded – undo
268 270
 	 * @return int Number of items that correspond to the given pagination argument.
269 271
 	 */
270 272
 	public function get_pagination_arg( $key ) {
271
-		if ( 'page' == $key )
272
-			return $this->get_pagenum();
273
+		if ( 'page' == $key ) {
274
+					return $this->get_pagenum();
275
+		}
273 276
 
274
-		if ( isset( $this->_pagination_args[$key] ) )
275
-			return $this->_pagination_args[$key];
277
+		if ( isset( $this->_pagination_args[$key] ) ) {
278
+					return $this->_pagination_args[$key];
279
+		}
276 280
 	}
277 281
 
278 282
 	/**
@@ -307,20 +311,25 @@  discard block
 block discarded – undo
307 311
 	 * @param string $input_id The search input id
308 312
 	 */
309 313
 	public function search_box( $text, $input_id ) {
310
-		if ( empty( $_REQUEST['s'] ) && !$this->has_items() )
311
-			return;
314
+		if ( empty( $_REQUEST['s'] ) && !$this->has_items() ) {
315
+					return;
316
+		}
312 317
 
313 318
 		$input_id = $input_id . '-search-input';
314 319
 
315
-		if ( ! empty( $_REQUEST['orderby'] ) )
316
-			echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
317
-		if ( ! empty( $_REQUEST['order'] ) )
318
-			echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
319
-		if ( ! empty( $_REQUEST['post_mime_type'] ) )
320
-			echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '" />';
321
-		if ( ! empty( $_REQUEST['detached'] ) )
322
-			echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />';
323
-?>
320
+		if ( ! empty( $_REQUEST['orderby'] ) ) {
321
+					echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
322
+		}
323
+		if ( ! empty( $_REQUEST['order'] ) ) {
324
+					echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
325
+		}
326
+		if ( ! empty( $_REQUEST['post_mime_type'] ) ) {
327
+					echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '" />';
328
+		}
329
+		if ( ! empty( $_REQUEST['detached'] ) ) {
330
+					echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />';
331
+		}
332
+		?>
324 333
 <p class="search-box">
325 334
 	<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
326 335
 	<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
@@ -362,8 +371,9 @@  discard block
 block discarded – undo
362 371
 		 */
363 372
 		$views = apply_filters( "views_{$this->screen->id}", $views );
364 373
 
365
-		if ( empty( $views ) )
366
-			return;
374
+		if ( empty( $views ) ) {
375
+					return;
376
+		}
367 377
 
368 378
 		echo "<ul class='subsubsub'>\n";
369 379
 		foreach ( $views as $class => $view ) {
@@ -417,8 +427,9 @@  discard block
 block discarded – undo
417 427
 			$two = '2';
418 428
 		}
419 429
 
420
-		if ( empty( $this->_actions ) )
421
-			return;
430
+		if ( empty( $this->_actions ) ) {
431
+					return;
432
+		}
422 433
 
423 434
 		echo "<label for='bulk-action-selector-" . esc_attr( $which ) . "' class='screen-reader-text'>" . __( 'Select bulk action' ) . "</label>";
424 435
 		echo "<select name='action$two' id='bulk-action-selector-" . esc_attr( $which ) . "'>\n";
@@ -445,14 +456,17 @@  discard block
 block discarded – undo
445 456
 	 * @return string|false The action name or False if no action was selected
446 457
 	 */
447 458
 	public function current_action() {
448
-		if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) )
449
-			return false;
459
+		if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) ) {
460
+					return false;
461
+		}
450 462
 
451
-		if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] )
452
-			return $_REQUEST['action'];
463
+		if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) {
464
+					return $_REQUEST['action'];
465
+		}
453 466
 
454
-		if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] )
455
-			return $_REQUEST['action2'];
467
+		if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) {
468
+					return $_REQUEST['action2'];
469
+		}
456 470
 
457 471
 		return false;
458 472
 	}
@@ -471,8 +485,9 @@  discard block
 block discarded – undo
471 485
 		$action_count = count( $actions );
472 486
 		$i = 0;
473 487
 
474
-		if ( !$action_count )
475
-			return '';
488
+		if ( !$action_count ) {
489
+					return '';
490
+		}
476 491
 
477 492
 		$out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
478 493
 		foreach ( $actions as $action => $link ) {
@@ -532,8 +547,9 @@  discard block
 block discarded – undo
532 547
 
533 548
 		$month_count = count( $months );
534 549
 
535
-		if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
536
-			return;
550
+		if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) ) {
551
+					return;
552
+		}
537 553
 
538 554
 		$m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
539 555
 ?>
@@ -542,8 +558,9 @@  discard block
 block discarded – undo
542 558
 			<option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
543 559
 <?php
544 560
 		foreach ( $months as $arc_row ) {
545
-			if ( 0 == $arc_row->year )
546
-				continue;
561
+			if ( 0 == $arc_row->year ) {
562
+							continue;
563
+			}
547 564
 
548 565
 			$month = zeroise( $arc_row->month, 2 );
549 566
 			$year = $arc_row->year;
@@ -575,8 +592,9 @@  discard block
 block discarded – undo
575 592
 <?php
576 593
 			foreach ( $this->modes as $mode => $title ) {
577 594
 				$classes = array( 'view-' . $mode );
578
-				if ( $current_mode == $mode )
579
-					$classes[] = 'current';
595
+				if ( $current_mode == $mode ) {
596
+									$classes[] = 'current';
597
+				}
580 598
 				printf(
581 599
 					"<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
582 600
 					esc_url( add_query_arg( 'mode', $mode ) ),
@@ -647,8 +665,9 @@  discard block
 block discarded – undo
647 665
 	public function get_pagenum() {
648 666
 		$pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
649 667
 
650
-		if ( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] )
651
-			$pagenum = $this->_pagination_args['total_pages'];
668
+		if ( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] ) {
669
+					$pagenum = $this->_pagination_args['total_pages'];
670
+		}
652 671
 
653 672
 		return max( 1, $pagenum );
654 673
 	}
@@ -665,8 +684,9 @@  discard block
 block discarded – undo
665 684
 	 */
666 685
 	protected function get_items_per_page( $option, $default = 20 ) {
667 686
 		$per_page = (int) get_user_option( $option );
668
-		if ( empty( $per_page ) || $per_page < 1 )
669
-			$per_page = $default;
687
+		if ( empty( $per_page ) || $per_page < 1 ) {
688
+					$per_page = $default;
689
+		}
670 690
 
671 691
 		/**
672 692
 		 * Filter the number of items to be displayed on each page of the list table.
@@ -920,12 +940,14 @@  discard block
 block discarded – undo
920 940
 
921 941
 		$sortable = array();
922 942
 		foreach ( $_sortable as $id => $data ) {
923
-			if ( empty( $data ) )
924
-				continue;
943
+			if ( empty( $data ) ) {
944
+							continue;
945
+			}
925 946
 
926 947
 			$data = (array) $data;
927
-			if ( !isset( $data[1] ) )
928
-				$data[1] = false;
948
+			if ( !isset( $data[1] ) ) {
949
+							$data[1] = false;
950
+			}
929 951
 
930 952
 			$sortable[$id] = $data;
931 953
 		}
@@ -966,15 +988,17 @@  discard block
 block discarded – undo
966 988
 		$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
967 989
 		$current_url = remove_query_arg( 'paged', $current_url );
968 990
 
969
-		if ( isset( $_GET['orderby'] ) )
970
-			$current_orderby = $_GET['orderby'];
971
-		else
972
-			$current_orderby = '';
991
+		if ( isset( $_GET['orderby'] ) ) {
992
+					$current_orderby = $_GET['orderby'];
993
+		} else {
994
+					$current_orderby = '';
995
+		}
973 996
 
974
-		if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] )
975
-			$current_order = 'desc';
976
-		else
977
-			$current_order = 'asc';
997
+		if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] ) {
998
+					$current_order = 'desc';
999
+		} else {
1000
+					$current_order = 'asc';
1001
+		}
978 1002
 
979 1003
 		if ( ! empty( $columns['cb'] ) ) {
980 1004
 			static $cb_counter = 1;
@@ -990,10 +1014,11 @@  discard block
 block discarded – undo
990 1014
 				$class[] = 'hidden';
991 1015
 			}
992 1016
 
993
-			if ( 'cb' == $column_key )
994
-				$class[] = 'check-column';
995
-			elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
996
-				$class[] = 'num';
1017
+			if ( 'cb' == $column_key ) {
1018
+							$class[] = 'check-column';
1019
+			} elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) ) {
1020
+							$class[] = 'num';
1021
+			}
997 1022
 
998 1023
 			if ( $column_key === $primary ) {
999 1024
 				$class[] = 'column-primary';
@@ -1019,8 +1044,9 @@  discard block
 block discarded – undo
1019 1044
 			$scope = ( 'th' === $tag ) ? 'scope="col"' : '';
1020 1045
 			$id = $with_id ? "id='$column_key'" : '';
1021 1046
 
1022
-			if ( !empty( $class ) )
1023
-				$class = "class='" . join( ' ', $class ) . "'";
1047
+			if ( !empty( $class ) ) {
1048
+							$class = "class='" . join( ' ', $class ) . "'";
1049
+			}
1024 1050
 
1025 1051
 			echo "<$tag $scope $id $class>$column_display_name</$tag>";
1026 1052
 		}
@@ -1082,9 +1108,10 @@  discard block
 block discarded – undo
1082 1108
 	 * @param string $which
1083 1109
 	 */
1084 1110
 	protected function display_tablenav( $which ) {
1085
-		if ( 'top' == $which )
1086
-			wp_nonce_field( 'bulk-' . $this->_args['plural'] );
1087
-?>
1111
+		if ( 'top' == $which ) {
1112
+					wp_nonce_field( 'bulk-' . $this->_args['plural'] );
1113
+		}
1114
+		?>
1088 1115
 	<div class="tablenav <?php echo esc_attr( $which ); ?>">
1089 1116
 
1090 1117
 		<div class="alignleft actions bulkactions">
Please login to merge, or discard this patch.