Completed
Push — master ( 2adc18...d10a7f )
by Zack
30:36 queued 26:56
created
gravityview.php 2 patches
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -312,11 +312,11 @@  discard block
 block discarded – undo
312 312
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-change-entry-creator.php' );
313 313
 
314 314
 
315
-        /**
316
-         * When an entry is created, check if we need to update the custom slug meta
317
-         * todo: move this to its own class..
318
-         */
319
-        add_action( 'gform_entry_created', array( 'GravityView_API', 'entry_create_custom_slug' ), 10, 2 );
315
+		/**
316
+		 * When an entry is created, check if we need to update the custom slug meta
317
+		 * todo: move this to its own class..
318
+		 */
319
+		add_action( 'gform_entry_created', array( 'GravityView_API', 'entry_create_custom_slug' ), 10, 2 );
320 320
 
321 321
 		/**
322 322
 		 * @action `gravityview_include_frontend_actions` Triggered after all GravityView frontend files are loaded
@@ -347,34 +347,34 @@  discard block
 block discarded – undo
347 347
 
348 348
 	/** DEBUG */
349 349
 
350
-    /**
351
-     * Logs messages using Gravity Forms logging add-on
352
-     * @param  string $message log message
353
-     * @param mixed $data Additional data to display
354
-     * @return void
355
-     */
356
-    public static function log_debug( $message, $data = null ){
357
-	    /**
358
-	     * @action `gravityview_log_debug` Log a debug message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output
359
-	     * @param string $message Message to display
360
-	     * @param mixed $data Supporting data to print alongside it
361
-	     */
362
-    	do_action( 'gravityview_log_debug', $message, $data );
363
-    }
364
-
365
-    /**
366
-     * Logs messages using Gravity Forms logging add-on
367
-     * @param  string $message log message
368
-     * @return void
369
-     */
370
-    public static function log_error( $message, $data = null ){
371
-	    /**
372
-	     * @action `gravityview_log_error` Log an error message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output
373
-	     * @param string $message Error message to display
374
-	     * @param mixed $data Supporting data to print alongside it
375
-	     */
376
-    	do_action( 'gravityview_log_error', $message, $data );
377
-    }
350
+	/**
351
+	 * Logs messages using Gravity Forms logging add-on
352
+	 * @param  string $message log message
353
+	 * @param mixed $data Additional data to display
354
+	 * @return void
355
+	 */
356
+	public static function log_debug( $message, $data = null ){
357
+		/**
358
+		 * @action `gravityview_log_debug` Log a debug message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output
359
+		 * @param string $message Message to display
360
+		 * @param mixed $data Supporting data to print alongside it
361
+		 */
362
+		do_action( 'gravityview_log_debug', $message, $data );
363
+	}
364
+
365
+	/**
366
+	 * Logs messages using Gravity Forms logging add-on
367
+	 * @param  string $message log message
368
+	 * @return void
369
+	 */
370
+	public static function log_error( $message, $data = null ){
371
+		/**
372
+		 * @action `gravityview_log_error` Log an error message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output
373
+		 * @param string $message Error message to display
374
+		 * @param mixed $data Supporting data to print alongside it
375
+		 */
376
+		do_action( 'gravityview_log_error', $message, $data );
377
+	}
378 378
 
379 379
 } // end class GravityView_Plugin
380 380
 
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -66,20 +66,20 @@  discard block
 block discarded – undo
66 66
 
67 67
 /** Load common & connector functions */
68 68
 require_once( GRAVITYVIEW_DIR . 'includes/helper-functions.php' );
69
-require_once( GRAVITYVIEW_DIR . 'includes/class-common.php');
70
-require_once( GRAVITYVIEW_DIR . 'includes/connector-functions.php');
69
+require_once( GRAVITYVIEW_DIR . 'includes/class-common.php' );
70
+require_once( GRAVITYVIEW_DIR . 'includes/connector-functions.php' );
71 71
 require_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-compatibility.php' );
72 72
 require_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-roles-capabilities.php' );
73 73
 require_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-admin-notices.php' );
74 74
 
75 75
 /** Register Post Types and Rewrite Rules */
76
-require_once( GRAVITYVIEW_DIR . 'includes/class-post-types.php');
76
+require_once( GRAVITYVIEW_DIR . 'includes/class-post-types.php' );
77 77
 
78 78
 /** Add Cache Class */
79
-require_once( GRAVITYVIEW_DIR . 'includes/class-cache.php');
79
+require_once( GRAVITYVIEW_DIR . 'includes/class-cache.php' );
80 80
 
81 81
 /** Register hooks that are fired when the plugin is activated and deactivated. */
82
-if( is_admin() ) {
82
+if ( is_admin() ) {
83 83
 	register_activation_hook( __FILE__, array( 'GravityView_Plugin', 'activate' ) );
84 84
 	register_deactivation_hook( __FILE__, array( 'GravityView_Plugin', 'deactivate' ) );
85 85
 }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	public static function getInstance() {
102 102
 
103
-		if( empty( self::$instance ) ) {
103
+		if ( empty( self::$instance ) ) {
104 104
 			self::$instance = new self;
105 105
 		}
106 106
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	private function __construct() {
111 111
 
112 112
 
113
-		if( ! GravityView_Compatibility::is_valid() ) {
113
+		if ( ! GravityView_Compatibility::is_valid() ) {
114 114
 			return;
115 115
 		}
116 116
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 */
140 140
 	public function include_files() {
141 141
 
142
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin.php' );
142
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin.php' );
143 143
 
144 144
 		// Load fields
145 145
 		include_once( GRAVITYVIEW_DIR . 'includes/fields/class-gravityview-fields.php' );
@@ -150,19 +150,19 @@  discard block
 block discarded – undo
150 150
 			include_once( $gv_field_filename );
151 151
 		}
152 152
 
153
-		include_once( GRAVITYVIEW_DIR .'includes/class-gravityview-entry-notes.php' );
154
-		include_once( GRAVITYVIEW_DIR .'includes/load-plugin-and-theme-hooks.php' );
153
+		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-notes.php' );
154
+		include_once( GRAVITYVIEW_DIR . 'includes/load-plugin-and-theme-hooks.php' );
155 155
 
156 156
 		// Load Extensions
157 157
 		// @todo: Convert to a scan of the directory or a method where this all lives
158
-		include_once( GRAVITYVIEW_DIR .'includes/extensions/edit-entry/class-edit-entry.php' );
159
-		include_once( GRAVITYVIEW_DIR .'includes/extensions/delete-entry/class-delete-entry.php' );
158
+		include_once( GRAVITYVIEW_DIR . 'includes/extensions/edit-entry/class-edit-entry.php' );
159
+		include_once( GRAVITYVIEW_DIR . 'includes/extensions/delete-entry/class-delete-entry.php' );
160 160
 
161 161
 		// Load WordPress Widgets
162
-		include_once( GRAVITYVIEW_DIR .'includes/wordpress-widgets/register-wordpress-widgets.php' );
162
+		include_once( GRAVITYVIEW_DIR . 'includes/wordpress-widgets/register-wordpress-widgets.php' );
163 163
 
164 164
 		// Load GravityView Widgets
165
-		include_once( GRAVITYVIEW_DIR .'includes/widgets/register-gravityview-widgets.php' );
165
+		include_once( GRAVITYVIEW_DIR . 'includes/widgets/register-gravityview-widgets.php' );
166 166
 
167 167
 		// Add oEmbed
168 168
 		include_once( GRAVITYVIEW_DIR . 'includes/class-oembed.php' );
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 		include_once( GRAVITYVIEW_DIR . 'includes/class-frontend-views.php' );
176 176
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-admin-bar.php' );
177 177
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-list.php' );
178
-		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-merge-tags.php'); /** @since 1.8.4 */
178
+		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-merge-tags.php' ); /** @since 1.8.4 */
179 179
 		include_once( GRAVITYVIEW_DIR . 'includes/class-data.php' );
180 180
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-shortcode.php' );
181 181
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-link-shortcode.php' );
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	 * @return bool
191 191
 	 */
192 192
 	public static function is_network_activated() {
193
-		return is_multisite() && ( function_exists('is_plugin_active_for_network') && is_plugin_active_for_network( 'gravityview/gravityview.php' ) );
193
+		return is_multisite() && ( function_exists( 'is_plugin_active_for_network' ) && is_plugin_active_for_network( 'gravityview/gravityview.php' ) );
194 194
 	}
195 195
 
196 196
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	 * @since 1.7.5.1
256 256
 	 */
257 257
 	public static function include_widget_class() {
258
-		include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget.php' );
258
+		include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget.php' );
259 259
 	}
260 260
 
261 261
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 		}
277 277
 		if ( ! $loaded ) {
278 278
 			$locale = apply_filters( 'plugin_locale', get_locale(), 'gravityview' );
279
-			$mofile = dirname( __FILE__ ) . '/languages/gravityview-'. $locale .'.mo';
279
+			$mofile = dirname( __FILE__ ) . '/languages/gravityview-' . $locale . '.mo';
280 280
 			load_textdomain( 'gravityview', $mofile );
281 281
 		}
282 282
 
@@ -302,12 +302,12 @@  discard block
 block discarded – undo
302 302
 	 */
303 303
 	public function frontend_actions() {
304 304
 
305
-		if( self::is_admin() ) { return; }
305
+		if ( self::is_admin() ) { return; }
306 306
 
307 307
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-image.php' );
308
-		include_once( GRAVITYVIEW_DIR .'includes/class-template.php' );
309
-		include_once( GRAVITYVIEW_DIR .'includes/class-api.php' );
310
-		include_once( GRAVITYVIEW_DIR .'includes/class-frontend-views.php' );
308
+		include_once( GRAVITYVIEW_DIR . 'includes/class-template.php' );
309
+		include_once( GRAVITYVIEW_DIR . 'includes/class-api.php' );
310
+		include_once( GRAVITYVIEW_DIR . 'includes/class-frontend-views.php' );
311 311
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-change-entry-creator.php' );
312 312
 
313 313
 
@@ -332,8 +332,8 @@  discard block
 block discarded – undo
332 332
 	 */
333 333
 	public static function get_default_widget_areas() {
334 334
 		$default_areas = array(
335
-			array( '1-1' => array( array( 'areaid' => 'top', 'title' => __('Top', 'gravityview' ) , 'subtitle' => '' ) ) ),
336
-			array( '1-2' => array( array( 'areaid' => 'left', 'title' => __('Left', 'gravityview') , 'subtitle' => '' ) ), '2-2' => array( array( 'areaid' => 'right', 'title' => __('Right', 'gravityview') , 'subtitle' => '' ) ) ),
335
+			array( '1-1' => array( array( 'areaid' => 'top', 'title' => __( 'Top', 'gravityview' ), 'subtitle' => '' ) ) ),
336
+			array( '1-2' => array( array( 'areaid' => 'left', 'title' => __( 'Left', 'gravityview' ), 'subtitle' => '' ) ), '2-2' => array( array( 'areaid' => 'right', 'title' => __( 'Right', 'gravityview' ), 'subtitle' => '' ) ) ),
337 337
 		);
338 338
 
339 339
 		/**
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
      * @param mixed $data Additional data to display
352 352
      * @return void
353 353
      */
354
-    public static function log_debug( $message, $data = null ){
354
+    public static function log_debug( $message, $data = null ) {
355 355
 	    /**
356 356
 	     * @action `gravityview_log_debug` Log a debug message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output
357 357
 	     * @param string $message Message to display
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
      * @param  string $message log message
366 366
      * @return void
367 367
      */
368
-    public static function log_error( $message, $data = null ){
368
+    public static function log_error( $message, $data = null ) {
369 369
 	    /**
370 370
 	     * @action `gravityview_log_error` Log an error message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output
371 371
 	     * @param string $message Error message to display
@@ -376,4 +376,4 @@  discard block
 block discarded – undo
376 376
 
377 377
 } // end class GravityView_Plugin
378 378
 
379
-add_action('plugins_loaded', array('GravityView_Plugin', 'getInstance'), 1);
379
+add_action( 'plugins_loaded', array( 'GravityView_Plugin', 'getInstance' ), 1 );
Please login to merge, or discard this patch.
includes/admin/field-types/type_hidden.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 			return;
16 16
 		}
17 17
 
18
-        $class = !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
18
+		$class = !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
19 19
 
20 20
 		?>
21 21
 		<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="hidden" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>" />
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,12 +10,12 @@
 block discarded – undo
10 10
 
11 11
 	function render_input( $override_input = null ) {
12 12
 
13
-		if( isset( $override_input ) ) {
13
+		if ( isset( $override_input ) ) {
14 14
 			echo $override_input;
15 15
 			return;
16 16
 		}
17 17
 
18
-        $class = !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
18
+        $class = ! empty( $this->field[ 'class' ] ) ? $this->field[ 'class' ] : 'widefat';
19 19
 
20 20
 		?>
21 21
 		<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="hidden" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>" />
Please login to merge, or discard this patch.
includes/admin/field-types/type_text.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@
 block discarded – undo
28 28
 
29 29
 		$show_mt = $this->show_merge_tags();
30 30
 
31
-        if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
32
-            $class = 'merge-tag-support mt-position-right mt-hide_all_fields ';
33
-        }
34
-        $class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
31
+		if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
32
+			$class = 'merge-tag-support mt-position-right mt-hide_all_fields ';
33
+		}
34
+		$class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
35 35
 
36 36
 		?>
37 37
 		<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="text" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>">
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 		?>
9 9
 		<label for="<?php echo $this->get_field_id(); ?>" class="<?php echo $this->get_label_class(); ?>"><?php
10 10
 
11
-			echo '<span class="gv-label">'.$this->get_field_label().'</span>';
11
+			echo '<span class="gv-label">' . $this->get_field_label() . '</span>';
12 12
 			echo $this->get_tooltip() . $this->get_field_desc();
13 13
 		?><div>
14 14
 				<?php $this->render_input(); ?>
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
 	function render_input( $override_input = null ) {
21 21
 
22
-		if( isset( $override_input ) ) {
22
+		if ( isset( $override_input ) ) {
23 23
 			echo $override_input;
24 24
 			return;
25 25
 		}
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
28 28
 
29 29
 		$show_mt = $this->show_merge_tags();
30 30
 
31
-        if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
31
+        if ( $show_mt && $this->field[ 'merge_tags' ] !== false || $this->field[ 'merge_tags' ] === 'force' ) {
32 32
             $class = 'merge-tag-support mt-position-right mt-hide_all_fields ';
33 33
         }
34
-        $class .= !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
34
+        $class .= ! empty( $this->field[ 'class' ] ) ? $this->field[ 'class' ] : 'widefat';
35 35
 
36 36
 		?>
37 37
 		<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="text" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>">
Please login to merge, or discard this patch.
includes/admin/field-types/type_textarea.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,14 +28,14 @@
 block discarded – undo
28 28
 
29 29
 		$show_mt = $this->show_merge_tags();
30 30
 
31
-        if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
32
-            $class = ' merge-tag-support mt-position-right ';
33
-
34
-            if( empty( $this->field['show_all_fields'] ) ) {
35
-            	$class .= ' mt-hide_all_fields';
36
-            }
37
-        }
38
-        $class .= !empty( $this->field['class'] ) ? 'widefat ' . $this->field['class'] : 'widefat';
31
+		if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
32
+			$class = ' merge-tag-support mt-position-right ';
33
+
34
+			if( empty( $this->field['show_all_fields'] ) ) {
35
+				$class .= ' mt-hide_all_fields';
36
+			}
37
+		}
38
+		$class .= !empty( $this->field['class'] ) ? 'widefat ' . $this->field['class'] : 'widefat';
39 39
 
40 40
 		?>
41 41
 		<textarea name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" class="<?php echo esc_attr( $class ); ?>" rows="5"><?php echo esc_textarea(  $this->value ); ?></textarea>
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 		?>
10 10
 		<label for="<?php echo $this->get_field_id(); ?>" class="<?php echo $this->get_label_class(); ?>"><?php
11 11
 
12
-			echo '<span class="gv-label">'.$this->get_field_label().'</span>';
12
+			echo '<span class="gv-label">' . $this->get_field_label() . '</span>';
13 13
 			echo $this->get_tooltip() . $this->get_field_desc();
14 14
 		?><div>
15 15
 				<?php $this->render_input(); ?>
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	}
20 20
 
21 21
 	function render_input( $override_input = null ) {
22
-		if( isset( $override_input ) ) {
22
+		if ( isset( $override_input ) ) {
23 23
 			echo $override_input;
24 24
 			return;
25 25
 		}
@@ -28,17 +28,17 @@  discard block
 block discarded – undo
28 28
 
29 29
 		$show_mt = $this->show_merge_tags();
30 30
 
31
-        if( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
31
+        if ( $show_mt && $this->field[ 'merge_tags' ] !== false || $this->field[ 'merge_tags' ] === 'force' ) {
32 32
             $class = ' merge-tag-support mt-position-right ';
33 33
 
34
-            if( empty( $this->field['show_all_fields'] ) ) {
34
+            if ( empty( $this->field[ 'show_all_fields' ] ) ) {
35 35
             	$class .= ' mt-hide_all_fields';
36 36
             }
37 37
         }
38
-        $class .= !empty( $this->field['class'] ) ? 'widefat ' . $this->field['class'] : 'widefat';
38
+        $class .= ! empty( $this->field[ 'class' ] ) ? 'widefat ' . $this->field[ 'class' ] : 'widefat';
39 39
 
40 40
 		?>
41
-		<textarea name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" class="<?php echo esc_attr( $class ); ?>" rows="5"><?php echo esc_textarea(  $this->value ); ?></textarea>
41
+		<textarea name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" class="<?php echo esc_attr( $class ); ?>" rows="5"><?php echo esc_textarea( $this->value ); ?></textarea>
42 42
        	<?php
43 43
 	}
44 44
 
Please login to merge, or discard this patch.
includes/admin/metaboxes/class-gravityview-admin-metaboxes.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 		if( !GravityView_Compatibility::is_valid() ) { return; }
16 16
 
17
-        self::$metaboxes_dir = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/';
17
+		self::$metaboxes_dir = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/';
18 18
 
19 19
 		include_once self::$metaboxes_dir . 'class-gravityview-metabox-tab.php';
20 20
 
@@ -228,13 +228,13 @@  discard block
 block discarded – undo
228 228
 		$get_id_backup = isset($_GET['id']) ? $_GET['id'] : NULL;
229 229
 
230 230
 		if( isset( $form['id'] ) ) {
231
-		    $form_script = 'var form = ' . GFCommon::json_encode($form) . ';';
231
+			$form_script = 'var form = ' . GFCommon::json_encode($form) . ';';
232 232
 
233
-		    // The `gf_vars()` method needs a $_GET[id] variable set with the form ID.
234
-		    $_GET['id'] = $form['id'];
233
+			// The `gf_vars()` method needs a $_GET[id] variable set with the form ID.
234
+			$_GET['id'] = $form['id'];
235 235
 
236 236
 		} else {
237
-		    $form_script = 'var form = new Form();';
237
+			$form_script = 'var form = new Form();';
238 238
 		}
239 239
 
240 240
 		$output = '<script type="text/javascript" data-gv-merge-tags="1">' . $form_script . "\n" . GFCommon::gf_vars(false) . '</script>';
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	 */
18 18
 	function __construct() {
19 19
 
20
-		if( !GravityView_Compatibility::is_valid() ) { return; }
20
+		if ( ! GravityView_Compatibility::is_valid() ) { return; }
21 21
 
22 22
         self::$metaboxes_dir = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/';
23 23
 
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 	 */
36 36
 	function initialize() {
37 37
 
38
-		add_action( 'add_meta_boxes', array( $this, 'register_metaboxes' ));
38
+		add_action( 'add_meta_boxes', array( $this, 'register_metaboxes' ) );
39 39
 
40
-		add_action( 'add_meta_boxes_gravityview' , array( $this, 'update_priority' ) );
40
+		add_action( 'add_meta_boxes_gravityview', array( $this, 'update_priority' ) );
41 41
 
42 42
 		// information box
43 43
 		add_action( 'post_submitbox_misc_actions', array( $this, 'render_shortcode_hint' ) );
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
 	function update_priority() {
52 52
 		global $wp_meta_boxes;
53 53
 
54
-		if( ! empty( $wp_meta_boxes['gravityview'] ) ) {
55
-			foreach( array( 'high', 'core', 'low' ) as $position ) {
56
-				if( isset( $wp_meta_boxes['gravityview']['normal'][ $position ] ) ) {
57
-					foreach( $wp_meta_boxes['gravityview']['normal'][ $position ] as $key => $meta_box ) {
58
-						if( ! preg_match( '/^gravityview_/ism', $key ) ) {
59
-							$wp_meta_boxes['gravityview']['advanced'][ $position ][ $key ] = $meta_box;
60
-							unset( $wp_meta_boxes['gravityview']['normal'][ $position ][ $key ] );
54
+		if ( ! empty( $wp_meta_boxes[ 'gravityview' ] ) ) {
55
+			foreach ( array( 'high', 'core', 'low' ) as $position ) {
56
+				if ( isset( $wp_meta_boxes[ 'gravityview' ][ 'normal' ][ $position ] ) ) {
57
+					foreach ( $wp_meta_boxes[ 'gravityview' ][ 'normal' ][ $position ] as $key => $meta_box ) {
58
+						if ( ! preg_match( '/^gravityview_/ism', $key ) ) {
59
+							$wp_meta_boxes[ 'gravityview' ][ 'advanced' ][ $position ][ $key ] = $meta_box;
60
+							unset( $wp_meta_boxes[ 'gravityview' ][ 'normal' ][ $position ][ $key ] );
61 61
 						}
62 62
 					}
63 63
 				}
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		global $post;
70 70
 
71 71
 		// On Comment Edit, for example, $post isn't set.
72
-		if( empty( $post ) || !is_object( $post ) || !isset( $post->ID ) ) {
72
+		if ( empty( $post ) || ! is_object( $post ) || ! isset( $post->ID ) ) {
73 73
 			return;
74 74
 		}
75 75
 
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
 		 */
153 153
 		$metaboxes = apply_filters( 'gravityview/metaboxes/default', $metaboxes );
154 154
 
155
-		foreach( $metaboxes as $m ) {
155
+		foreach ( $metaboxes as $m ) {
156 156
 
157
-			$tab = new GravityView_Metabox_Tab( $m['id'], $m['title'], $m['file'], $m['icon-class'], $m['callback'], $m['callback_args'] );
157
+			$tab = new GravityView_Metabox_Tab( $m[ 'id' ], $m[ 'title' ], $m[ 'file' ], $m[ 'icon-class' ], $m[ 'callback' ], $m[ 'callback_args' ] );
158 158
 
159 159
 			GravityView_Metabox_Tabs::add( $tab );
160 160
 
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
 
181 181
 		$links = GravityView_Admin_Views::get_connected_form_links( $current_form, false );
182 182
 
183
-		if( !empty( $links ) ) {
184
-			$links = '<span class="alignright gv-form-links">'. $links .'</span>';
183
+		if ( ! empty( $links ) ) {
184
+			$links = '<span class="alignright gv-form-links">' . $links . '</span>';
185 185
 		}
186 186
 
187 187
 		return __( 'Data Source', 'gravityview' ) . $links;
@@ -220,28 +220,28 @@  discard block
 block discarded – undo
220 220
 	 */
221 221
 	public static function render_merge_tags_scripts( $curr_form ) {
222 222
 
223
-		if( empty( $curr_form )) {
223
+		if ( empty( $curr_form ) ) {
224 224
 			return NULL;
225 225
 		}
226 226
 
227 227
 		$form = gravityview_get_form( $curr_form );
228 228
 
229
-		$get_id_backup = isset($_GET['id']) ? $_GET['id'] : NULL;
229
+		$get_id_backup = isset( $_GET[ 'id' ] ) ? $_GET[ 'id' ] : NULL;
230 230
 
231
-		if( isset( $form['id'] ) ) {
232
-		    $form_script = 'var form = ' . GFCommon::json_encode($form) . ';';
231
+		if ( isset( $form[ 'id' ] ) ) {
232
+		    $form_script = 'var form = ' . GFCommon::json_encode( $form ) . ';';
233 233
 
234 234
 		    // The `gf_vars()` method needs a $_GET[id] variable set with the form ID.
235
-		    $_GET['id'] = $form['id'];
235
+		    $_GET[ 'id' ] = $form[ 'id' ];
236 236
 
237 237
 		} else {
238 238
 		    $form_script = 'var form = new Form();';
239 239
 		}
240 240
 
241
-		$output = '<script type="text/javascript" data-gv-merge-tags="1">' . $form_script . "\n" . GFCommon::gf_vars(false) . '</script>';
241
+		$output = '<script type="text/javascript" data-gv-merge-tags="1">' . $form_script . "\n" . GFCommon::gf_vars( false ) . '</script>';
242 242
 
243 243
 		// Restore previous $_GET setting
244
-		$_GET['id'] = $get_id_backup;
244
+		$_GET[ 'id' ] = $get_id_backup;
245 245
 
246 246
 		return $output;
247 247
 	}
@@ -297,10 +297,10 @@  discard block
 block discarded – undo
297 297
 		global $post;
298 298
 
299 299
 		// Only show this on GravityView post types.
300
-		if( false === gravityview_is_admin_page() ) { return; }
300
+		if ( false === gravityview_is_admin_page() ) { return; }
301 301
 
302 302
 		// If the View hasn't been configured yet, don't show embed shortcode
303
-		if( !gravityview_get_directory_fields( $post->ID ) ) { return; }
303
+		if ( ! gravityview_get_directory_fields( $post->ID ) ) { return; }
304 304
 
305 305
 		include self::$metaboxes_dir . 'views/shortcode-hint.php';
306 306
 	}
Please login to merge, or discard this patch.
includes/admin/metaboxes/views/gravityview-content.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Display the tab panels for the Settings metabox
4
- *
5
- * @package GravityView
6
- * @subpackage Gravityview/admin/metaboxes/views
7
- * @since 1.8
8
- *
9
- * @global array $metaboxes
10
- * @global WP_Post $post
11
- */
3
+	 * Display the tab panels for the Settings metabox
4
+	 *
5
+	 * @package GravityView
6
+	 * @subpackage Gravityview/admin/metaboxes/views
7
+	 * @since 1.8
8
+	 *
9
+	 * @global array $metaboxes
10
+	 * @global WP_Post $post
11
+	 */
12 12
 
13 13
 ?>
14 14
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@
 block discarded – undo
19 19
 	 * Loop through the array of registered metaboxes
20 20
 	 * @var GravityView_Metabox_Tab $metabox
21 21
 	 */
22
-	foreach( $metaboxes as $metabox ) {
22
+	foreach ( $metaboxes as $metabox ) {
23 23
 
24
-		echo '<div id="'.esc_attr( $metabox->id ).'">';
24
+		echo '<div id="' . esc_attr( $metabox->id ) . '">';
25 25
 
26 26
 		$metabox->render( $post );
27 27
 
Please login to merge, or discard this patch.
includes/admin/metaboxes/views/select-template.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @file select-template.php
4
- * @package GravityView
5
- * @subpackage Gravityview/admin/metaboxes/partials
6
- * @global WP_Post $post
7
- */
3
+	 * @file select-template.php
4
+	 * @package GravityView
5
+	 * @subpackage Gravityview/admin/metaboxes/partials
6
+	 * @global WP_Post $post
7
+	 */
8 8
 
9 9
 global $post;
10 10
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,27 +22,27 @@
 block discarded – undo
22 22
 
23 23
 <?php // list all the available templates (type= fresh or custom ) ?>
24 24
 <div class="gv-grid">
25
-	<?php foreach( $templates as $id => $template ) {
25
+	<?php foreach ( $templates as $id => $template ) {
26 26
 		$selected = ( $id == $current_template ) ? ' gv-selected' : ''; ?>
27 27
 
28 28
 		<div class="gv-grid-col-1-3">
29
-			<div class="gv-view-types-module<?php echo $selected; ?>" data-filter="<?php echo esc_attr( $template['type'] ); ?>">
29
+			<div class="gv-view-types-module<?php echo $selected; ?>" data-filter="<?php echo esc_attr( $template[ 'type' ] ); ?>">
30 30
 				<div class="gv-view-types-hover">
31 31
 					<div>
32
-						<?php if( !empty( $template['buy_source'] ) ) { ?>
33
-							<p><a href="<?php echo esc_url( $template['buy_source'] ); ?>" class="button-primary button-buy-now"><?php esc_html_e( 'Buy Now', 'gravityview'); ?></a></p>
32
+						<?php if ( ! empty( $template[ 'buy_source' ] ) ) { ?>
33
+							<p><a href="<?php echo esc_url( $template[ 'buy_source' ] ); ?>" class="button-primary button-buy-now"><?php esc_html_e( 'Buy Now', 'gravityview' ); ?></a></p>
34 34
 						<?php } else { ?>
35
-							<p><a href="#gv_select_template" class="button button-large button-primary" data-templateid="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Select', 'gravityview'); ?></a></p>
36
-							<?php if( !empty( $template['preview'] ) ) { ?>
37
-								<a href="<?php echo esc_url( $template['preview'] ); ?>" rel="external" class="gv-site-preview"><i class="dashicons dashicons-admin-links" title="<?php esc_html_e( 'View a live demo of this preset', 'gravityview'); ?>"></i></a>
35
+							<p><a href="#gv_select_template" class="button button-large button-primary" data-templateid="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Select', 'gravityview' ); ?></a></p>
36
+							<?php if ( ! empty( $template[ 'preview' ] ) ) { ?>
37
+								<a href="<?php echo esc_url( $template[ 'preview' ] ); ?>" rel="external" class="gv-site-preview"><i class="dashicons dashicons-admin-links" title="<?php esc_html_e( 'View a live demo of this preset', 'gravityview' ); ?>"></i></a>
38 38
 							<?php } ?>
39 39
 						<?php } ?>
40 40
 					</div>
41 41
 				</div>
42 42
 				<div class="gv-view-types-normal">
43
-					<img src="<?php echo esc_url( $template['logo'] ); ?>" alt="<?php echo esc_attr( $template['label'] ); ?>">
44
-					<h5><?php echo esc_attr( $template['label'] ); ?></h5>
45
-					<p class="description"><?php echo esc_attr( $template['description'] ); ?></p>
43
+					<img src="<?php echo esc_url( $template[ 'logo' ] ); ?>" alt="<?php echo esc_attr( $template[ 'label' ] ); ?>">
44
+					<h5><?php echo esc_attr( $template[ 'label' ] ); ?></h5>
45
+					<p class="description"><?php echo esc_attr( $template[ 'description' ] ); ?></p>
46 46
 				</div>
47 47
 			</div>
48 48
 		</div>
Please login to merge, or discard this patch.
includes/admin/metaboxes/views/sort-filter.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package GravityView
4
- * @subpackage Gravityview/admin/metaboxes/partials
5
- * @global WP_Post $post
6
- */
3
+	 * @package GravityView
4
+	 * @subpackage Gravityview/admin/metaboxes/partials
5
+	 * @global WP_Post $post
6
+	 */
7 7
 global $post;
8 8
 
9 9
 $curr_form = gravityview_get_form_id( $post->ID );
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 	 */
27 27
 	GravityView_Render_Settings::render_setting_row( 'sort_columns', $current_settings );
28 28
 
29
-	$sort_fields_input = '<select name="template_settings[sort_field]" id="gravityview_sort_field">'.gravityview_get_sortable_fields( $curr_form, $current_settings['sort_field'] ).'</select>';
29
+	$sort_fields_input = '<select name="template_settings[sort_field]" id="gravityview_sort_field">' . gravityview_get_sortable_fields( $curr_form, $current_settings[ 'sort_field' ] ) . '</select>';
30 30
 
31 31
 	GravityView_Render_Settings::render_setting_row( 'sort_field', $current_settings, $sort_fields_input );
32 32
 
Please login to merge, or discard this patch.
includes/class-admin-approve-entries.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 
322 322
 			if( class_exists( 'GravityView_Entry_Notes' ) ){
323 323
 				global $current_user;
324
-      			get_currentuserinfo();
324
+	  			get_currentuserinfo();
325 325
 				GravityView_Entry_Notes::add_note( $entry_id, $current_user->ID, $current_user->display_name, $note );
326 326
 			}
327 327
 
@@ -356,12 +356,12 @@  discard block
 block discarded – undo
356 356
 
357 357
 		$approvedcolumn = self::get_approved_column( $form['id'] );
358 358
 
359
-        /**
360
-         * If the form doesn't contain the approve field, don't assume anything.
361
-         */
362
-        if( empty( $approvedcolumn ) ) {
363
-            return;
364
-        }
359
+		/**
360
+		 * If the form doesn't contain the approve field, don't assume anything.
361
+		 */
362
+		if( empty( $approvedcolumn ) ) {
363
+			return;
364
+		}
365 365
 
366 366
 		$entry = GFAPI::get_entry( $entry_id );
367 367
 
@@ -474,17 +474,17 @@  discard block
 block discarded – undo
474 474
 	 */
475 475
 	static public function get_approved_column( $form ) {
476 476
 
477
-        if( empty( $form ) ) {
478
-            return null;
479
-        }
477
+		if( empty( $form ) ) {
478
+			return null;
479
+		}
480 480
 
481
-        if( !is_array( $form ) ) {
482
-            $form = GVCommon::get_form( $form );
483
-        }
481
+		if( !is_array( $form ) ) {
482
+			$form = GVCommon::get_form( $form );
483
+		}
484 484
 
485 485
 		foreach( $form['fields'] as $key => $field ) {
486 486
 
487
-            $field = (array) $field;
487
+			$field = (array) $field;
488 488
 
489 489
 			if( !empty( $field['gravityview_approved'] ) ) {
490 490
 				if( !empty($field['inputs'][0]['id']) ) {
@@ -492,14 +492,14 @@  discard block
 block discarded – undo
492 492
 				}
493 493
 			}
494 494
 
495
-            // Note: This is just for backward compatibility from GF Directory plugin and old GV versions - when using i18n it may not work..
496
-            if( 'checkbox' == $field['type'] && isset( $field['inputs'] ) && is_array( $field['inputs'] ) ) {
497
-                foreach ( $field['inputs'] as $key2 => $input ) {
498
-                    if ( strtolower( $input['label'] ) == 'approved' ) {
499
-                        return $input['id'];
500
-                    }
501
-                }
502
-            }
495
+			// Note: This is just for backward compatibility from GF Directory plugin and old GV versions - when using i18n it may not work..
496
+			if( 'checkbox' == $field['type'] && isset( $field['inputs'] ) && is_array( $field['inputs'] ) ) {
497
+				foreach ( $field['inputs'] as $key2 => $input ) {
498
+					if ( strtolower( $input['label'] ) == 'approved' ) {
499
+						return $input['id'];
500
+					}
501
+				}
502
+			}
503 503
 		}
504 504
 
505 505
 		return null;
Please login to merge, or discard this patch.
Spacing   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -34,19 +34,19 @@  discard block
 block discarded – undo
34 34
 		/** gf_entries page - entries table screen */
35 35
 
36 36
 		// capture bulk actions
37
-		add_action( 'init', array( $this, 'process_bulk_action') );
37
+		add_action( 'init', array( $this, 'process_bulk_action' ) );
38 38
 		// add hidden field with approve status
39 39
 		add_action( 'gform_entries_first_column', array( $this, 'add_entry_approved_hidden_input' ), 1, 5 );
40 40
 		// process ajax approve entry requests
41
-		add_action('wp_ajax_gv_update_approved', array( $this, 'ajax_update_approved'));
41
+		add_action( 'wp_ajax_gv_update_approved', array( $this, 'ajax_update_approved' ) );
42 42
 
43 43
 		// in case entry is edited (on admin or frontend)
44
-		add_action( 'gform_after_update_entry', array( $this, 'after_update_entry_update_approved_meta' ), 10, 2);
44
+		add_action( 'gform_after_update_entry', array( $this, 'after_update_entry_update_approved_meta' ), 10, 2 );
45 45
 
46 46
 		add_filter( 'gravityview_tooltips', array( $this, 'tooltips' ) );
47 47
 
48 48
 		// adding styles and scripts
49
-		add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles') );
49
+		add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles' ) );
50 50
 		// bypass Gravity Forms no-conflict mode
51 51
 		add_filter( 'gform_noconflict_scripts', array( $this, 'register_gform_noconflict_script' ) );
52 52
 		add_filter( 'gform_noconflict_styles', array( $this, 'register_gform_noconflict_style' ) );
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 	 */
62 62
 	function tooltips( $tooltips ) {
63 63
 
64
-		$tooltips['form_gravityview_fields'] = array(
65
-			'title' => __('GravityView Fields', 'gravityview'),
66
-			'value' => __( 'Allow administrators to approve or reject entries and users to opt-in or opt-out of their entries being displayed.', 'gravityview'),
64
+		$tooltips[ 'form_gravityview_fields' ] = array(
65
+			'title' => __( 'GravityView Fields', 'gravityview' ),
66
+			'value' => __( 'Allow administrators to approve or reject entries and users to opt-in or opt-out of their entries being displayed.', 'gravityview' ),
67 67
 		);
68 68
 
69 69
 		return $tooltips;
@@ -178,12 +178,12 @@  discard block
 block discarded – undo
178 178
 		}
179 179
 
180 180
 		// gforms_update_note is sent when bulk editing entry notes. We don't want to process then.
181
-		if ( 'bulk' === RGForms::post( 'action' ) && empty( $_POST['gforms_update_note'] ) ) {
181
+		if ( 'bulk' === RGForms::post( 'action' ) && empty( $_POST[ 'gforms_update_note' ] ) ) {
182 182
 
183 183
 			check_admin_referer( 'gforms_entry_list', 'gforms_entry_list' );
184 184
 
185 185
 			// The action is formatted like: approve-16 or disapprove-16, where the first word is the name of the action and the second is the ID of the form. Bulk action 2 is the bottom bulk action select form.
186
-			$bulk_action = ! empty( $_POST['bulk_action'] ) ? $_POST['bulk_action'] : $_POST['bulk_action2'];
186
+			$bulk_action = ! empty( $_POST[ 'bulk_action' ] ) ? $_POST[ 'bulk_action' ] : $_POST[ 'bulk_action2' ];
187 187
 
188 188
 			/**
189 189
 			 * The extra '-' is to make sure that there are at *least* two items in array.
@@ -199,13 +199,13 @@  discard block
 block discarded – undo
199 199
 			}
200 200
 
201 201
 			// All entries are set to be updated, not just the visible ones
202
-			if ( ! empty( $_POST['all_entries'] ) ) {
202
+			if ( ! empty( $_POST[ 'all_entries' ] ) ) {
203 203
 
204 204
 				// Convert the current entry search into GF-formatted search criteria
205 205
 				$search = array(
206
-					'search_field' => isset( $_POST['f'] ) ? $_POST['f'][0] : 0,
207
-					'search_value' => isset( $_POST['v'][0] ) ? $_POST['v'][0] : '',
208
-					'search_operator' => isset( $_POST['o'][0] ) ? $_POST['o'][0] : 'contains',
206
+					'search_field' => isset( $_POST[ 'f' ] ) ? $_POST[ 'f' ][ 0 ] : 0,
207
+					'search_value' => isset( $_POST[ 'v' ][ 0 ] ) ? $_POST[ 'v' ][ 0 ] : '',
208
+					'search_operator' => isset( $_POST[ 'o' ][ 0 ] ) ? $_POST[ 'o' ][ 0 ] : 'contains',
209 209
 				);
210 210
 
211 211
 				$search_criteria = GravityView_frontend::get_search_criteria( $search, $form_id );
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
 			} else {
217 217
 
218
-				$entries = $_POST['lead'];
218
+				$entries = $_POST[ 'lead' ];
219 219
 
220 220
 			}
221 221
 
@@ -256,12 +256,12 @@  discard block
 block discarded – undo
256 256
 	 */
257 257
 	private static function update_bulk( $entries, $approved, $form_id ) {
258 258
 
259
-		if( empty($entries) || ( $entries !== true && !is_array($entries) ) ) {
259
+		if ( empty( $entries ) || ( $entries !== true && ! is_array( $entries ) ) ) {
260 260
 			do_action( 'gravityview_log_error', __METHOD__ . ' Entries were empty or malformed.', $entries );
261 261
 			return false;
262 262
 		}
263 263
 
264
-		if( ! GVCommon::has_cap( 'gravityview_moderate_entries' ) ) {
264
+		if ( ! GVCommon::has_cap( 'gravityview_moderate_entries' ) ) {
265 265
 			do_action( 'gravityview_log_error', __METHOD__ . ' User does not have the `gravityview_moderate_entries` capability.' );
266 266
 			return false;
267 267
 		}
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 		// calculate approved field id
272 272
 		$approved_column_id = self::get_approved_column( $form_id );
273 273
 
274
-		foreach( $entries as $entry_id ) {
274
+		foreach ( $entries as $entry_id ) {
275 275
 			self::update_approved( (int)$entry_id, $approved, $form_id, $approved_column_id );
276 276
 		}
277 277
 	}
@@ -290,14 +290,14 @@  discard block
 block discarded – undo
290 290
 	 * @param int $approvedcolumn (default: 0)
291 291
 	 * @return boolean True: It worked; False: it failed
292 292
 	 */
293
-	public static function update_approved( $entry_id = 0, $approved = 0, $form_id = 0, $approvedcolumn = 0) {
293
+	public static function update_approved( $entry_id = 0, $approved = 0, $form_id = 0, $approvedcolumn = 0 ) {
294 294
 
295
-		if( !class_exists( 'GFAPI' ) ) {
295
+		if ( ! class_exists( 'GFAPI' ) ) {
296 296
 			do_action( 'gravityview_log_error', __METHOD__ . 'GFAPI does not exist' );
297 297
 			return false;
298 298
 		}
299 299
 
300
-		if( empty( $approvedcolumn ) ) {
300
+		if ( empty( $approvedcolumn ) ) {
301 301
 			$approvedcolumn = self::get_approved_column( $form_id );
302 302
 		}
303 303
 
@@ -316,10 +316,10 @@  discard block
 block discarded – undo
316 316
 		self::update_approved_meta( $entry_id, $approved );
317 317
 
318 318
 		// add note to entry
319
-		if( $result === true ) {
319
+		if ( $result === true ) {
320 320
 			$note = empty( $approved ) ? __( 'Disapproved the Entry for GravityView', 'gravityview' ) : __( 'Approved the Entry for GravityView', 'gravityview' );
321 321
 
322
-			if( class_exists( 'GravityView_Entry_Notes' ) ){
322
+			if ( class_exists( 'GravityView_Entry_Notes' ) ) {
323 323
 				global $current_user;
324 324
       			get_currentuserinfo();
325 325
 				GravityView_Entry_Notes::add_note( $entry_id, $current_user->ID, $current_user->display_name, $note );
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 			 */
333 333
 			do_action( 'gravityview_clear_form_cache', $form_id );
334 334
 
335
-		} else if( is_wp_error( $result ) ) {
335
+		} else if ( is_wp_error( $result ) ) {
336 336
 
337 337
 			do_action( 'gravityview_log_error', __METHOD__ . sprintf( ' - Entry approval not updated: %s', $result->get_error_message() ) );
338 338
 
@@ -354,12 +354,12 @@  discard block
 block discarded – undo
354 354
 	 */
355 355
 	public static function after_update_entry_update_approved_meta( $form, $entry_id = NULL ) {
356 356
 
357
-		$approvedcolumn = self::get_approved_column( $form['id'] );
357
+		$approvedcolumn = self::get_approved_column( $form[ 'id' ] );
358 358
 
359 359
         /**
360 360
          * If the form doesn't contain the approve field, don't assume anything.
361 361
          */
362
-        if( empty( $approvedcolumn ) ) {
362
+        if ( empty( $approvedcolumn ) ) {
363 363
             return;
364 364
         }
365 365
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 	private static function update_approved_meta( $entry_id, $is_approved ) {
382 382
 
383 383
 		// update entry meta
384
-		if( function_exists('gform_update_meta') ) {
384
+		if ( function_exists( 'gform_update_meta' ) ) {
385 385
 
386 386
 			gform_update_meta( $entry_id, 'is_approved', $is_approved );
387 387
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 			 */
394 394
 			do_action( 'gravityview/approve_entries/updated', $entry_id, $is_approved );
395 395
 
396
-			if( empty( $is_approved ) ) {
396
+			if ( empty( $is_approved ) ) {
397 397
 
398 398
 				/**
399 399
 				 * @action `gravityview/approve_entries/disapproved` Triggered when an entry is rejected
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 
416 416
 		} else {
417 417
 
418
-			do_action('gravityview_log_error', __METHOD__ . ' - `gform_update_meta` does not exist.' );
418
+			do_action( 'gravityview_log_error', __METHOD__ . ' - `gform_update_meta` does not exist.' );
419 419
 
420 420
 		}
421 421
 	}
@@ -427,21 +427,21 @@  discard block
 block discarded – undo
427 427
 	 */
428 428
 	public function ajax_update_approved() {
429 429
 
430
-		if( empty( $_POST['entry_id'] ) || empty( $_POST['form_id'] ) ) {
430
+		if ( empty( $_POST[ 'entry_id' ] ) || empty( $_POST[ 'form_id' ] ) ) {
431 431
 
432 432
 			do_action( 'gravityview_log_error', __METHOD__ . ' entry_id or form_id are empty.', $_POST );
433 433
 
434 434
 			$result = false;
435 435
 		}
436 436
 
437
-		else if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'gravityview_ajaxgfentries' ) ) {
437
+		else if ( ! isset( $_POST[ 'nonce' ] ) || ! wp_verify_nonce( $_POST[ 'nonce' ], 'gravityview_ajaxgfentries' ) ) {
438 438
 
439 439
 			do_action( 'gravityview_log_error', __METHOD__ . ' Security check failed.', $_POST );
440 440
 
441 441
 			$result = false;
442 442
 		}
443 443
 
444
-		else if( ! GVCommon::has_cap( 'gravityview_moderate_entries', $_POST['entry_id'] ) ) {
444
+		else if ( ! GVCommon::has_cap( 'gravityview_moderate_entries', $_POST[ 'entry_id' ] ) ) {
445 445
 
446 446
 			do_action( 'gravityview_log_error', __METHOD__ . ' User does not have the `gravityview_moderate_entries` capability.' );
447 447
 
@@ -450,11 +450,11 @@  discard block
 block discarded – undo
450 450
 
451 451
 		else {
452 452
 
453
-			$result = self::update_approved( $_POST['entry_id'], $_POST['approved'], $_POST['form_id'] );
453
+			$result = self::update_approved( $_POST[ 'entry_id' ], $_POST[ 'approved' ], $_POST[ 'form_id' ] );
454 454
 
455
-			if( is_wp_error( $result ) ) {
455
+			if ( is_wp_error( $result ) ) {
456 456
 				/** @var WP_Error $result */
457
-				do_action( 'gravityview_log_error', __METHOD__ .' Error updating approval: ' . $result->get_error_message() );
457
+				do_action( 'gravityview_log_error', __METHOD__ . ' Error updating approval: ' . $result->get_error_message() );
458 458
 				$result = false;
459 459
 			}
460 460
 
@@ -474,29 +474,29 @@  discard block
 block discarded – undo
474 474
 	 */
475 475
 	static public function get_approved_column( $form ) {
476 476
 
477
-        if( empty( $form ) ) {
477
+        if ( empty( $form ) ) {
478 478
             return null;
479 479
         }
480 480
 
481
-        if( !is_array( $form ) ) {
481
+        if ( ! is_array( $form ) ) {
482 482
             $form = GVCommon::get_form( $form );
483 483
         }
484 484
 
485
-		foreach( $form['fields'] as $key => $field ) {
485
+		foreach ( $form[ 'fields' ] as $key => $field ) {
486 486
 
487
-            $field = (array) $field;
487
+            $field = (array)$field;
488 488
 
489
-			if( !empty( $field['gravityview_approved'] ) ) {
490
-				if( !empty($field['inputs'][0]['id']) ) {
491
-					return $field['inputs'][0]['id'];
489
+			if ( ! empty( $field[ 'gravityview_approved' ] ) ) {
490
+				if ( ! empty( $field[ 'inputs' ][ 0 ][ 'id' ] ) ) {
491
+					return $field[ 'inputs' ][ 0 ][ 'id' ];
492 492
 				}
493 493
 			}
494 494
 
495 495
             // Note: This is just for backward compatibility from GF Directory plugin and old GV versions - when using i18n it may not work..
496
-            if( 'checkbox' == $field['type'] && isset( $field['inputs'] ) && is_array( $field['inputs'] ) ) {
497
-                foreach ( $field['inputs'] as $key2 => $input ) {
498
-                    if ( strtolower( $input['label'] ) == 'approved' ) {
499
-                        return $input['id'];
496
+            if ( 'checkbox' == $field[ 'type' ] && isset( $field[ 'inputs' ] ) && is_array( $field[ 'inputs' ] ) ) {
497
+                foreach ( $field[ 'inputs' ] as $key2 => $input ) {
498
+                    if ( strtolower( $input[ 'label' ] ) == 'approved' ) {
499
+                        return $input[ 'id' ];
500 500
                     }
501 501
                 }
502 502
             }
@@ -507,18 +507,18 @@  discard block
 block discarded – undo
507 507
 
508 508
 
509 509
 
510
-	static public function add_entry_approved_hidden_input(  $form_id, $field_id, $value, $entry, $query_string ) {
510
+	static public function add_entry_approved_hidden_input( $form_id, $field_id, $value, $entry, $query_string ) {
511 511
 
512
-		if( ! GVCommon::has_cap( 'gravityview_moderate_entries', $entry['id'] ) ) {
512
+		if ( ! GVCommon::has_cap( 'gravityview_moderate_entries', $entry[ 'id' ] ) ) {
513 513
 			return;
514 514
 		}
515 515
 
516
-		if( empty( $entry['id'] ) ) {
516
+		if ( empty( $entry[ 'id' ] ) ) {
517 517
 			return;
518 518
 		}
519 519
 
520
-		if( gform_get_meta( $entry['id'], 'is_approved' ) ) {
521
-			echo '<input type="hidden" class="entry_approved" id="entry_approved_'. $entry['id'] .'" value="true" />';
520
+		if ( gform_get_meta( $entry[ 'id' ], 'is_approved' ) ) {
521
+			echo '<input type="hidden" class="entry_approved" id="entry_approved_' . $entry[ 'id' ] . '" value="true" />';
522 522
 		}
523 523
 	}
524 524
 
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 
528 528
 	function add_scripts_and_styles( $hook ) {
529 529
 
530
-		if( !class_exists( 'RGForms' ) ) {
530
+		if ( ! class_exists( 'RGForms' ) ) {
531 531
 
532 532
 			do_action( 'gravityview_log_error', 'GravityView_Admin_ApproveEntries[add_scripts_and_styles] RGForms does not exist.' );
533 533
 
@@ -536,39 +536,39 @@  discard block
 block discarded – undo
536 536
 
537 537
 		// enqueue styles & scripts gf_entries
538 538
 		// But only if we're on the main Entries page, not on reports pages
539
-		if( RGForms::get_page() === 'entry_list' ) {
539
+		if ( RGForms::get_page() === 'entry_list' ) {
540 540
 
541
-			$form_id = RGForms::get('id');
541
+			$form_id = RGForms::get( 'id' );
542 542
 
543 543
 			// If there are no forms identified, use the first form. That's how GF does it.
544
-			if( empty( $form_id ) && class_exists('RGFormsModel') ) {
544
+			if ( empty( $form_id ) && class_exists( 'RGFormsModel' ) ) {
545 545
 				$forms = gravityview_get_forms();
546
-				if( !empty( $forms ) ) {
547
-					$form_id = $forms[0]['id'];
546
+				if ( ! empty( $forms ) ) {
547
+					$form_id = $forms[ 0 ][ 'id' ];
548 548
 				}
549 549
 			}
550 550
 
551 551
 			$approvedcolumn = self::get_approved_column( $form_id );
552 552
 
553
-			wp_register_style( 'gravityview_entries_list', plugins_url('assets/css/admin-entries-list.css', GRAVITYVIEW_FILE), array(), GravityView_Plugin::version );
553
+			wp_register_style( 'gravityview_entries_list', plugins_url( 'assets/css/admin-entries-list.css', GRAVITYVIEW_FILE ), array(), GravityView_Plugin::version );
554 554
 			wp_enqueue_style( 'gravityview_entries_list' );
555 555
 
556
-			$script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
556
+			$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
557 557
 
558
-			wp_register_script( 'gravityview_gf_entries_scripts', plugins_url('assets/js/admin-entries-list'.$script_debug.'.js', GRAVITYVIEW_FILE), array( 'jquery' ), GravityView_Plugin::version );
558
+			wp_register_script( 'gravityview_gf_entries_scripts', plugins_url( 'assets/js/admin-entries-list' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version );
559 559
 			wp_enqueue_script( 'gravityview_gf_entries_scripts' );
560 560
 
561 561
 			wp_localize_script( 'gravityview_gf_entries_scripts', 'gvGlobals', array(
562
-				'nonce' => wp_create_nonce( 'gravityview_ajaxgfentries'),
562
+				'nonce' => wp_create_nonce( 'gravityview_ajaxgfentries' ),
563 563
 				'form_id' => $form_id,
564 564
 				'show_column' => (int)$this->show_approve_entry_column( $form_id ),
565 565
 				'add_bulk_action' => (int)GVCommon::has_cap( 'gravityview_moderate_entries' ),
566 566
 				'bulk_actions' => $this->get_bulk_actions( $form_id ),
567 567
 				'bulk_message' => $this->bulk_update_message,
568
-				'approve_title' => __( 'Entry not approved for directory viewing. Click to approve this entry.', 'gravityview'),
569
-				'unapprove_title' => __( 'Entry approved for directory viewing. Click to disapprove this entry.', 'gravityview'),
570
-				'column_title' => __( 'Show entry in directory view?', 'gravityview'),
571
-				'column_link' => esc_url( add_query_arg( array('sort' => $approvedcolumn) ) ),
568
+				'approve_title' => __( 'Entry not approved for directory viewing. Click to approve this entry.', 'gravityview' ),
569
+				'unapprove_title' => __( 'Entry approved for directory viewing. Click to disapprove this entry.', 'gravityview' ),
570
+				'column_title' => __( 'Show entry in directory view?', 'gravityview' ),
571
+				'column_link' => esc_url( add_query_arg( array( 'sort' => $approvedcolumn ) ) ),
572 572
 			) );
573 573
 
574 574
 		}
@@ -611,8 +611,8 @@  discard block
 block discarded – undo
611 611
 		// Sanitize the values, just to be sure.
612 612
 		foreach ( $bulk_actions as $key => $group ) {
613 613
 			foreach ( $group as $i => $action ) {
614
-				$bulk_actions[ $key ][ $i ]['label'] = esc_html( $bulk_actions[ $key ][ $i ]['label'] );
615
-				$bulk_actions[ $key ][ $i ]['value'] = esc_attr( $bulk_actions[ $key ][ $i ]['value'] );
614
+				$bulk_actions[ $key ][ $i ][ 'label' ] = esc_html( $bulk_actions[ $key ][ $i ][ 'label' ] );
615
+				$bulk_actions[ $key ][ $i ][ 'value' ] = esc_attr( $bulk_actions[ $key ][ $i ][ 'value' ] );
616 616
 			}
617 617
 		}
618 618
 
@@ -637,13 +637,13 @@  discard block
 block discarded – undo
637 637
 		 * @since 1.7.2
638 638
 		 * @param boolean $hide_if_no_connections
639 639
 		 */
640
-		$hide_if_no_connections = apply_filters('gravityview/approve_entries/hide-if-no-connections', false );
640
+		$hide_if_no_connections = apply_filters( 'gravityview/approve_entries/hide-if-no-connections', false );
641 641
 
642
-		if( $hide_if_no_connections ) {
642
+		if ( $hide_if_no_connections ) {
643 643
 
644 644
 			$connected_views = gravityview_get_connected_views( $form_id );
645 645
 
646
-			if( empty( $connected_views ) ) {
646
+			if ( empty( $connected_views ) ) {
647 647
 				$show_approve_column = false;
648 648
 			}
649 649
 		}
@@ -653,18 +653,18 @@  discard block
 block discarded – undo
653 653
 		 * @param boolean $show_approve_column Whether the column will be shown
654 654
 		 * @param int $form_id The ID of the Gravity Forms form for which entries are being shown
655 655
 		 */
656
-		$show_approve_column = apply_filters('gravityview/approve_entries/show-column', $show_approve_column, $form_id );
656
+		$show_approve_column = apply_filters( 'gravityview/approve_entries/show-column', $show_approve_column, $form_id );
657 657
 
658 658
 		return $show_approve_column;
659 659
 	}
660 660
 
661 661
 	function register_gform_noconflict_script( $scripts ) {
662
-		$scripts[] = 'gravityview_gf_entries_scripts';
662
+		$scripts[ ] = 'gravityview_gf_entries_scripts';
663 663
 		return $scripts;
664 664
 	}
665 665
 
666 666
 	function register_gform_noconflict_style( $styles ) {
667
-		$styles[] = 'gravityview_entries_list';
667
+		$styles[ ] = 'gravityview_entries_list';
668 668
 		return $styles;
669 669
 	}
670 670
 
Please login to merge, or discard this patch.