Completed
Pull Request — develop (#1392)
by Gennady
18:53
created
includes/class-ajax.php 1 patch
Doc Comments   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 * @since 1.15
29 29
 	 * @param bool|false $mixed
30 30
 	 *
31
-	 * @return bool
31
+	 * @return boolean|null
32 32
 	 */
33 33
 	private function _exit( $mixed = NULL ) {
34 34
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 	 * Import Gravity Form XML or JSON
203 203
 	 *
204 204
 	 * @param  string $xml_or_json_path Path to form XML or JSON file
205
-	 * @return int|bool       Imported form ID or false
205
+	 * @return false|string       Imported form ID or false
206 206
 	 */
207 207
 	function import_form( $xml_or_json_path = '' ) {
208 208
 
@@ -300,6 +300,7 @@  discard block
 block discarded – undo
300 300
 	 * Get the the form fields for a preset (no form created yet)
301 301
 	 * @param  string $template_id Preset template
302 302
 	 *
303
+	 * @return integer
303 304
 	 */
304 305
 	static function pre_get_form_fields( $template_id = '') {
305 306
 
Please login to merge, or discard this patch.
includes/class-admin-welcome.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 	 * @since 1.0
34 34
 	 */
35 35
 	public function __construct() {
36
-		add_action( 'admin_menu', array( $this, 'admin_menus'), 200 );
36
+		add_action( 'admin_menu', array( $this, 'admin_menus' ), 200 );
37 37
 		add_action( 'admin_head', array( $this, 'admin_head' ) );
38
-		add_action( 'admin_init', array( $this, 'welcome'    ) );
39
-		add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page'), 10, 2 );
38
+		add_action( 'admin_init', array( $this, 'welcome' ) );
39
+		add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page' ), 10, 2 );
40 40
 	}
41 41
 
42 42
 	/**
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
 		// Add help page to GravityView menu
53 53
 		add_submenu_page(
54 54
 			'edit.php?post_type=gravityview',
55
-			__('GravityView: Getting Started', 'gravityview'),
56
-			__('Getting Started', 'gravityview'),
55
+			__( 'GravityView: Getting Started', 'gravityview' ),
56
+			__( 'Getting Started', 'gravityview' ),
57 57
 			$this->minimum_capability,
58 58
 			'gv-getting-started',
59 59
 			array( $this, 'getting_started_screen' )
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
 	 *
87 87
 	 * @return boolean  $is_page   True: yep; false: nope
88 88
 	 */
89
-	public function is_dashboard_page($is_page = false, $hook = NULL) {
89
+	public function is_dashboard_page( $is_page = false, $hook = NULL ) {
90 90
 		global $plugin_page;
91 91
 
92
-		if($is_page) { return $is_page; }
92
+		if ( $is_page ) { return $is_page; }
93 93
 
94 94
 		return in_array( $plugin_page, array( 'gv-about', 'gv-credits', 'gv-getting-started' ) );
95 95
 	}
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-credits' );
108 108
 		remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-changelog' );
109 109
 
110
-		if( !$this->is_dashboard_page() ) { return; }
110
+		if ( ! $this->is_dashboard_page() ) { return; }
111 111
 
112 112
 		?>
113 113
         <style type="text/css" media="screen" xmlns="http://www.w3.org/1999/html">
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 		// Don't fetch -beta, etc.
132 132
 		list( $display_version ) = explode( '-', GravityView_Plugin::version );
133 133
 
134
-		$selected = !empty( $plugin_page ) ? $plugin_page : 'gv-getting-started';
134
+		$selected = ! empty( $plugin_page ) ? $plugin_page : 'gv-getting-started';
135 135
 
136 136
 		echo gravityview_get_floaty( 132 );
137 137
 		?>
@@ -140,13 +140,13 @@  discard block
 block discarded – undo
140 140
 		<div class="about-text"><?php esc_html_e( 'Thank you for installing GravityView. Beautifully display your Gravity Forms entries.', 'gravityview' ); ?></div>
141 141
 
142 142
 		<h2 class="nav-tab-wrapper clear">
143
-			<a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>">
143
+			<a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>">
144 144
 				<?php _e( "Getting Started", 'gravityview' ); ?>
145 145
 			</a>
146
-			<a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>">
146
+			<a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>">
147 147
 				<?php _e( "List of Changes", 'gravityview' ); ?>
148 148
 			</a>
149
-			<a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>">
149
+			<a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>">
150 150
 				<?php _e( 'Credits', 'gravityview' ); ?>
151 151
 			</a>
152 152
 		</h2>
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 					<h3>Create a View</h3>
182 182
 
183 183
                     <ol class="ol-decimal">
184
-						<li>Go to <a href="<?php echo admin_url('post-new.php?post_type=gravityview'); ?>">Views &gt; New View</a></li>
184
+						<li>Go to <a href="<?php echo admin_url( 'post-new.php?post_type=gravityview' ); ?>">Views &gt; New View</a></li>
185 185
 						<li>Select <strong>an existing form&rsquo;s entries</strong> as a source for this view.</li>
186 186
 						<li>Select the type of View you would like to create. There are two core types of Views: <strong>Table</strong> and <strong>Listing</strong>.
187 187
 							<ul class="ul-square">
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 					</ul>
482 482
 
483 483
 					<h4><?php esc_attr_e( 'Want to contribute?', 'gravityview' ); ?></h4>
484
-					<p><?php echo sprintf( esc_attr__( 'If you want to contribute to the code, %syou can on Github%s. If your contributions are accepted, you will be thanked here.', 'gravityview'), '<a href="https://github.com/katzwebservices/GravityView">', '</a>' ); ?></p>
484
+					<p><?php echo sprintf( esc_attr__( 'If you want to contribute to the code, %syou can on Github%s. If your contributions are accepted, you will be thanked here.', 'gravityview' ), '<a href="https://github.com/katzwebservices/GravityView">', '</a>' ); ?></p>
485 485
 				</div>
486 486
 			</div>
487 487
 
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 		global $plugin_page;
525 525
 
526 526
 		// Bail if we're just editing the plugin
527
-		if( $plugin_page === 'plugin-editor.php' ) { return; }
527
+		if ( $plugin_page === 'plugin-editor.php' ) { return; }
528 528
 
529 529
 		// Bail if no activation redirect
530 530
 		if ( ! get_transient( '_gv_activation_redirect' ) ) { return; }
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 		$upgrade = get_option( 'gv_version_upgraded_from' );
536 536
 
537 537
 		// Don't do anything if they've already seen the new version info
538
-		if( $upgrade === GravityView_Plugin::version ) {
538
+		if ( $upgrade === GravityView_Plugin::version ) {
539 539
 			return;
540 540
 		}
541 541
 
@@ -543,10 +543,10 @@  discard block
 block discarded – undo
543 543
 		update_option( 'gv_version_upgraded_from', GravityView_Plugin::version );
544 544
 
545 545
 		// Bail if activating from network, or bulk
546
-		if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { return; }
546
+		if ( is_network_admin() || isset( $_GET[ 'activate-multi' ] ) ) { return; }
547 547
 
548 548
 		// First time install
549
-		if( ! $upgrade ) {
549
+		if ( ! $upgrade ) {
550 550
 			wp_safe_redirect( admin_url( 'edit.php?post_type=gravityview&page=gv-getting-started' ) ); exit;
551 551
 		}
552 552
 		// Update
Please login to merge, or discard this patch.
includes/widgets/search-widget/class-search-widget.php 1 patch
Spacing   +173 added lines, -173 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 				'type' => 'radio',
65 65
 				'full_width' => true,
66 66
 				'label' => esc_html__( 'Search Mode', 'gravityview' ),
67
-				'desc' => __('Should search results match all search fields, or any?', 'gravityview'),
67
+				'desc' => __( 'Should search results match all search fields, or any?', 'gravityview' ),
68 68
 				'value' => 'any',
69 69
 				'class' => 'hide-if-js',
70 70
 				'options' => array(
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
 			// admin - add scripts - run at 1100 to make sure GravityView_Admin_Views::add_scripts_and_styles() runs first at 999
85 85
 			add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles' ), 1100 );
86
-			add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts') );
86
+			add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );
87 87
 			add_filter( 'gravityview_noconflict_scripts', array( $this, 'register_no_conflict' ) );
88 88
 
89 89
 			// ajax - get the searchable fields
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 		$script_min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
228 228
 		$script_source = empty( $script_min ) ? '/source' : '';
229 229
 
230
-		wp_enqueue_script( 'gravityview_searchwidget_admin', plugins_url( 'assets/js'.$script_source.'/admin-search-widget'.$script_min.'.js', __FILE__ ), array( 'jquery', 'gravityview_views_scripts' ), \GV\Plugin::$version );
230
+		wp_enqueue_script( 'gravityview_searchwidget_admin', plugins_url( 'assets/js' . $script_source . '/admin-search-widget' . $script_min . '.js', __FILE__ ), array( 'jquery', 'gravityview_views_scripts' ), \GV\Plugin::$version );
231 231
 
232 232
 		wp_localize_script( 'gravityview_searchwidget_admin', 'gvSearchVar', array(
233 233
 			'nonce' => wp_create_nonce( 'gravityview_ajaxsearchwidget' ),
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 	 * @return array Scripts allowed in no-conflict mode, plus the search widget script
250 250
 	 */
251 251
 	public function register_no_conflict( $allowed ) {
252
-		$allowed[] = 'gravityview_searchwidget_admin';
252
+		$allowed[ ] = 'gravityview_searchwidget_admin';
253 253
 		return $allowed;
254 254
 	}
255 255
 
@@ -262,20 +262,20 @@  discard block
 block discarded – undo
262 262
 	 */
263 263
 	public static function get_searchable_fields() {
264 264
 
265
-		if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'gravityview_ajaxsearchwidget' ) ) {
265
+		if ( ! isset( $_POST[ 'nonce' ] ) || ! wp_verify_nonce( $_POST[ 'nonce' ], 'gravityview_ajaxsearchwidget' ) ) {
266 266
 			exit( '0' );
267 267
 		}
268 268
 
269 269
 		$form = '';
270 270
 
271 271
 		// Fetch the form for the current View
272
-		if ( ! empty( $_POST['view_id'] ) ) {
272
+		if ( ! empty( $_POST[ 'view_id' ] ) ) {
273 273
 
274
-			$form = gravityview_get_form_id( $_POST['view_id'] );
274
+			$form = gravityview_get_form_id( $_POST[ 'view_id' ] );
275 275
 
276
-		} elseif ( ! empty( $_POST['formid'] ) ) {
276
+		} elseif ( ! empty( $_POST[ 'formid' ] ) ) {
277 277
 
278
-			$form = (int) $_POST['formid'];
278
+			$form = (int)$_POST[ 'formid' ];
279 279
 
280 280
 		}
281 281
 
@@ -325,14 +325,14 @@  discard block
 block discarded – undo
325 325
 		);
326 326
 
327 327
 		if ( gravityview()->plugin->supports( \GV\Plugin::FEATURE_GFQUERY ) ) {
328
-			$custom_fields['is_approved'] = array(
328
+			$custom_fields[ 'is_approved' ] = array(
329 329
 				'text' => esc_html__( 'Approval Status', 'gravityview' ),
330 330
 				'type' => 'multi',
331 331
 			);
332 332
 		}
333 333
 
334
-		foreach( $custom_fields as $custom_field_key => $custom_field ) {
335
-			$output .= sprintf( '<option value="%s" %s data-inputtypes="%s" data-placeholder="%s">%s</option>', $custom_field_key, selected( $custom_field_key, $current, false ), $custom_field['type'], self::get_field_label( array('field' => $custom_field_key ) ), $custom_field['text'] );
334
+		foreach ( $custom_fields as $custom_field_key => $custom_field ) {
335
+			$output .= sprintf( '<option value="%s" %s data-inputtypes="%s" data-placeholder="%s">%s</option>', $custom_field_key, selected( $custom_field_key, $current, false ), $custom_field[ 'type' ], self::get_field_label( array( 'field' => $custom_field_key ) ), $custom_field[ 'text' ] );
336 336
 		}
337 337
 
338 338
 		// Get fields with sub-inputs and no parent
@@ -354,13 +354,13 @@  discard block
 block discarded – undo
354 354
 
355 355
 			foreach ( $fields as $id => $field ) {
356 356
 
357
-				if ( in_array( $field['type'], $blacklist_field_types ) ) {
357
+				if ( in_array( $field[ 'type' ], $blacklist_field_types ) ) {
358 358
 					continue;
359 359
 				}
360 360
 
361
-				$types = self::get_search_input_types( $id, $field['type'] );
361
+				$types = self::get_search_input_types( $id, $field[ 'type' ] );
362 362
 
363
-				$output .= '<option value="'. $id .'" '. selected( $id, $current, false ).'data-inputtypes="'. esc_attr( $types ) .'">'. esc_html( $field['label'] ) .'</option>';
363
+				$output .= '<option value="' . $id . '" ' . selected( $id, $current, false ) . 'data-inputtypes="' . esc_attr( $types ) . '">' . esc_html( $field[ 'label' ] ) . '</option>';
364 364
 			}
365 365
 		}
366 366
 
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 	public static function get_search_input_types( $field_id = '', $field_type = null ) {
384 384
 
385 385
 		// @todo - This needs to be improved - many fields have . including products and addresses
386
-		if ( false !== strpos( (string) $field_id, '.' ) && in_array( $field_type, array( 'checkbox' ) ) || in_array( $field_id, array( 'is_fulfilled' ) ) ) {
386
+		if ( false !== strpos( (string)$field_id, '.' ) && in_array( $field_type, array( 'checkbox' ) ) || in_array( $field_id, array( 'is_fulfilled' ) ) ) {
387 387
 			$input_type = 'boolean'; // on/off checkbox
388 388
 		} elseif ( in_array( $field_type, array( 'checkbox', 'post_category', 'multiselect' ) ) ) {
389 389
 			$input_type = 'multi'; //multiselect
@@ -429,19 +429,19 @@  discard block
 block discarded – undo
429 429
 			$post_id = 0;
430 430
 
431 431
 			// We're in the WordPress Widget context, and an overriding post ID has been set.
432
-			if ( ! empty( $widget_args['post_id'] ) ) {
433
-				$post_id = absint( $widget_args['post_id'] );
432
+			if ( ! empty( $widget_args[ 'post_id' ] ) ) {
433
+				$post_id = absint( $widget_args[ 'post_id' ] );
434 434
 			}
435 435
 			// We're in the WordPress Widget context, and the base View ID should be used
436
-			else if ( ! empty( $widget_args['view_id'] ) ) {
437
-				$post_id = absint( $widget_args['view_id'] );
436
+			else if ( ! empty( $widget_args[ 'view_id' ] ) ) {
437
+				$post_id = absint( $widget_args[ 'view_id' ] );
438 438
 			}
439 439
 
440 440
 			$args = gravityview_get_permalink_query_args( $post_id );
441 441
 
442 442
 			// Add hidden fields to the search form
443 443
 			foreach ( $args as $key => $value ) {
444
-				$search_fields[] = array(
444
+				$search_fields[ ] = array(
445 445
 					'name'  => $key,
446 446
 					'input' => 'hidden',
447 447
 					'value' => $value,
@@ -480,28 +480,28 @@  discard block
 block discarded – undo
480 480
 		/**
481 481
 		 * Include the sidebar Widgets.
482 482
 		 */
483
-		$widgets = (array) get_option( 'widget_gravityview_search', array() );
483
+		$widgets = (array)get_option( 'widget_gravityview_search', array() );
484 484
 
485 485
 		foreach ( $widgets as $widget ) {
486
-			if ( ! empty( $widget['view_id'] ) && $widget['view_id'] == $view->ID ) {
487
-				if( $_fields = json_decode( $widget['search_fields'], true ) ) {
486
+			if ( ! empty( $widget[ 'view_id' ] ) && $widget[ 'view_id' ] == $view->ID ) {
487
+				if ( $_fields = json_decode( $widget[ 'search_fields' ], true ) ) {
488 488
 					foreach ( $_fields as $field ) {
489
-						if ( empty( $field['form_id'] ) ) {
490
-							$field['form_id'] = $view->form ? $view->form->ID : 0;
489
+						if ( empty( $field[ 'form_id' ] ) ) {
490
+							$field[ 'form_id' ] = $view->form ? $view->form->ID : 0;
491 491
 						}
492
-						$searchable_fields[] = $with_full_field ? $field : $field['field'];
492
+						$searchable_fields[ ] = $with_full_field ? $field : $field[ 'field' ];
493 493
 					}
494 494
 				}
495 495
 			}
496 496
 		}
497 497
 
498 498
 		foreach ( $view->widgets->by_id( $this->get_widget_id() )->all() as $widget ) {
499
-			if( $_fields = json_decode( $widget->configuration->get( 'search_fields' ), true ) ) {
499
+			if ( $_fields = json_decode( $widget->configuration->get( 'search_fields' ), true ) ) {
500 500
 				foreach ( $_fields as $field ) {
501
-					if ( empty( $field['form_id'] ) ) {
502
-						$field['form_id'] = $view->form ? $view->form->ID : 0;
501
+					if ( empty( $field[ 'form_id' ] ) ) {
502
+						$field[ 'form_id' ] = $view->form ? $view->form->ID : 0;
503 503
 					}
504
-					$searchable_fields[] = $with_full_field ? $field : $field['field'];
504
+					$searchable_fields[ ] = $with_full_field ? $field : $field[ 'field' ];
505 505
 				}
506 506
 			}
507 507
 		}
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 			return $search_criteria; // Return the original criteria, GF_Query modification kicks in later
540 540
 		}
541 541
 
542
-		if( 'post' === $this->search_method ) {
542
+		if ( 'post' === $this->search_method ) {
543 543
 			$get = $_POST;
544 544
 		} else {
545 545
 			$get = $_GET;
@@ -558,15 +558,15 @@  discard block
 block discarded – undo
558 558
 		$get = gv_map_deep( $get, 'rawurldecode' );
559 559
 
560 560
 		// Make sure array key is set up
561
-		$search_criteria['field_filters'] = \GV\Utils::get( $search_criteria, 'field_filters', array() );
561
+		$search_criteria[ 'field_filters' ] = \GV\Utils::get( $search_criteria, 'field_filters', array() );
562 562
 
563 563
 		$searchable_fields = $this->get_view_searchable_fields( $view );
564 564
 		$searchable_field_objects = $this->get_view_searchable_fields( $view, true );
565 565
 
566 566
 		// add free search
567
-		if ( isset( $get['gv_search'] ) && '' !== $get['gv_search'] && in_array( 'search_all', $searchable_fields ) ) {
567
+		if ( isset( $get[ 'gv_search' ] ) && '' !== $get[ 'gv_search' ] && in_array( 'search_all', $searchable_fields ) ) {
568 568
 
569
-			$search_all_value = trim( $get['gv_search'] );
569
+			$search_all_value = trim( $get[ 'gv_search' ] );
570 570
 
571 571
 			/**
572 572
 			 * @filter `gravityview/search-all-split-words` Search for each word separately or the whole phrase?
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 			}
592 592
 
593 593
 			foreach ( $words as $word ) {
594
-				$search_criteria['field_filters'][] = array(
594
+				$search_criteria[ 'field_filters' ][ ] = array(
595 595
 					'key' => null, // The field ID to search
596 596
 					'value' => $word, // The value to search
597 597
 					'operator' => 'contains', // What to search in. Options: `is` or `contains`
@@ -604,14 +604,14 @@  discard block
 block discarded – undo
604 604
 			/**
605 605
 			 * Get and normalize the dates according to the input format.
606 606
 			 */
607
-			if ( $curr_start = ! empty( $get['gv_start'] ) ? $get['gv_start'] : '' ) {
608
-				if( $curr_start_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_start ) ) {
607
+			if ( $curr_start = ! empty( $get[ 'gv_start' ] ) ? $get[ 'gv_start' ] : '' ) {
608
+				if ( $curr_start_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_start ) ) {
609 609
 					$curr_start = $curr_start_date->format( 'Y-m-d' );
610 610
 				}
611 611
 			}
612 612
 
613
-			if ( $curr_end = ! empty( $get['gv_start'] ) ? ( ! empty( $get['gv_end'] ) ? $get['gv_end'] : '' ) : '' ) {
614
-				if( $curr_end_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_end ) ) {
613
+			if ( $curr_end = ! empty( $get[ 'gv_start' ] ) ? ( ! empty( $get[ 'gv_end' ] ) ? $get[ 'gv_end' ] : '' ) : '' ) {
614
+				if ( $curr_end_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_end ) ) {
615 615
 					$curr_end = $curr_end_date->format( 'Y-m-d' );
616 616
 				}
617 617
 			}
@@ -646,22 +646,22 @@  discard block
 block discarded – undo
646 646
 			 */
647 647
 			if ( ! empty( $curr_start ) ) {
648 648
 				$curr_start = date( 'Y-m-d H:i:s', strtotime( $curr_start ) );
649
-				$search_criteria['start_date'] = $adjust_tz ? get_gmt_from_date( $curr_start ) : $curr_start;
649
+				$search_criteria[ 'start_date' ] = $adjust_tz ? get_gmt_from_date( $curr_start ) : $curr_start;
650 650
 			}
651 651
 
652 652
 			if ( ! empty( $curr_end ) ) {
653 653
 				// Fast-forward 24 hour on the end time
654 654
 				$curr_end = date( 'Y-m-d H:i:s', strtotime( $curr_end ) + DAY_IN_SECONDS );
655
-				$search_criteria['end_date'] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end;
656
-				if ( strpos( $search_criteria['end_date'], '00:00:00' ) ) { // See https://github.com/gravityview/GravityView/issues/1056
657
-					$search_criteria['end_date'] = date( 'Y-m-d H:i:s', strtotime( $search_criteria['end_date'] ) - 1 );
655
+				$search_criteria[ 'end_date' ] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end;
656
+				if ( strpos( $search_criteria[ 'end_date' ], '00:00:00' ) ) { // See https://github.com/gravityview/GravityView/issues/1056
657
+					$search_criteria[ 'end_date' ] = date( 'Y-m-d H:i:s', strtotime( $search_criteria[ 'end_date' ] ) - 1 );
658 658
 				}
659 659
 			}
660 660
 		}
661 661
 
662 662
 		// search for a specific entry ID
663 663
 		if ( ! empty( $get[ 'gv_id' ] ) && in_array( 'entry_id', $searchable_fields ) ) {
664
-			$search_criteria['field_filters'][] = array(
664
+			$search_criteria[ 'field_filters' ][ ] = array(
665 665
 				'key' => 'id',
666 666
 				'value' => absint( $get[ 'gv_id' ] ),
667 667
 				'operator' => $this->get_operator( $get, 'gv_id', array( '=' ), '=' ),
@@ -670,20 +670,20 @@  discard block
 block discarded – undo
670 670
 
671 671
 		// search for a specific Created_by ID
672 672
 		if ( ! empty( $get[ 'gv_by' ] ) && in_array( 'created_by', $searchable_fields ) ) {
673
-			$search_criteria['field_filters'][] = array(
673
+			$search_criteria[ 'field_filters' ][ ] = array(
674 674
 				'key' => 'created_by',
675
-				'value' => $get['gv_by'],
675
+				'value' => $get[ 'gv_by' ],
676 676
 				'operator' => $this->get_operator( $get, 'gv_by', array( '=' ), '=' ),
677 677
 			);
678 678
 		}
679 679
 
680 680
 		// Get search mode passed in URL
681
-		$mode = isset( $get['mode'] ) && in_array( $get['mode'], array( 'any', 'all' ) ) ?  $get['mode'] : 'any';
681
+		$mode = isset( $get[ 'mode' ] ) && in_array( $get[ 'mode' ], array( 'any', 'all' ) ) ? $get[ 'mode' ] : 'any';
682 682
 
683 683
 		// get the other search filters
684 684
 		foreach ( $get as $key => $value ) {
685 685
 
686
-			if ( 0 !== strpos( $key, 'filter_' ) || gv_empty( $value, false, false ) || ( is_array( $value ) && count( $value ) === 1 && gv_empty( $value[0], false, false ) ) ) {
686
+			if ( 0 !== strpos( $key, 'filter_' ) || gv_empty( $value, false, false ) || ( is_array( $value ) && count( $value ) === 1 && gv_empty( $value[ 0 ], false, false ) ) ) {
687 687
 				continue; // Not a filter, or empty
688 688
 			}
689 689
 
@@ -697,19 +697,19 @@  discard block
 block discarded – undo
697 697
 				continue;
698 698
 			}
699 699
 
700
-			if ( ! isset( $filter['operator'] ) ) {
701
-				$filter['operator'] = $this->get_operator( $get, $key, array( 'contains' ), 'contains' );
700
+			if ( ! isset( $filter[ 'operator' ] ) ) {
701
+				$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'contains' ), 'contains' );
702 702
 			}
703 703
 
704
-			if ( isset( $filter[0]['value'] ) ) {
705
-				$search_criteria['field_filters'] = array_merge( $search_criteria['field_filters'], $filter );
704
+			if ( isset( $filter[ 0 ][ 'value' ] ) ) {
705
+				$search_criteria[ 'field_filters' ] = array_merge( $search_criteria[ 'field_filters' ], $filter );
706 706
 
707 707
 				// if date range type, set search mode to ALL
708
-				if ( ! empty( $filter[0]['operator'] ) && in_array( $filter[0]['operator'], array( '>=', '<=', '>', '<' ) ) ) {
708
+				if ( ! empty( $filter[ 0 ][ 'operator' ] ) && in_array( $filter[ 0 ][ 'operator' ], array( '>=', '<=', '>', '<' ) ) ) {
709 709
 					$mode = 'all';
710 710
 				}
711
-			} elseif( !empty( $filter ) ) {
712
-				$search_criteria['field_filters'][] = $filter;
711
+			} elseif ( ! empty( $filter ) ) {
712
+				$search_criteria[ 'field_filters' ][ ] = $filter;
713 713
 			}
714 714
 		}
715 715
 
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
 		 * @since 1.5.1
719 719
 		 * @param[out,in] string $mode Search mode (`any` vs `all`)
720 720
 		 */
721
-		$search_criteria['field_filters']['mode'] = apply_filters( 'gravityview/search/mode', $mode );
721
+		$search_criteria[ 'field_filters' ][ 'mode' ] = apply_filters( 'gravityview/search/mode', $mode );
722 722
 
723 723
 		gravityview()->log->debug( 'Returned Search Criteria: ', array( 'data' => $search_criteria ) );
724 724
 
@@ -752,19 +752,19 @@  discard block
 block discarded – undo
752 752
 
753 753
 		$query_class = $view->get_query_class();
754 754
 
755
-		if ( empty( $search_criteria['field_filters'] ) ) {
755
+		if ( empty( $search_criteria[ 'field_filters' ] ) ) {
756 756
 			return;
757 757
 		}
758 758
 
759 759
 		$widgets = $view->widgets->by_id( $this->widget_id );
760 760
 		if ( $widgets->count() ) {
761 761
 			$widgets = $widgets->all();
762
-			$widget  = $widgets[0];
762
+			$widget  = $widgets[ 0 ];
763 763
 
764 764
 			$search_fields = json_decode( $widget->configuration->get( 'search_fields' ), true );
765 765
 
766
-			foreach ( (array) $search_fields as $search_field ) {
767
-				if ( 'created_by' === $search_field['field'] && 'input_text' === $search_field['input'] ) {
766
+			foreach ( (array)$search_fields as $search_field ) {
767
+				if ( 'created_by' === $search_field[ 'field' ] && 'input_text' === $search_field[ 'input' ] ) {
768 768
 					$created_by_text_mode = true;
769 769
 				}
770 770
 			}
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 		$extra_conditions = array();
774 774
 		$mode = 'any';
775 775
 
776
-		foreach ( $search_criteria['field_filters'] as &$filter ) {
776
+		foreach ( $search_criteria[ 'field_filters' ] as &$filter ) {
777 777
 			if ( ! is_array( $filter ) ) {
778 778
 				if ( in_array( strtolower( $filter ), array( 'any', 'all' ) ) ) {
779 779
 					$mode = $filter;
@@ -782,13 +782,13 @@  discard block
 block discarded – undo
782 782
 			}
783 783
 
784 784
 			// Construct a manual query for unapproved statuses
785
-			if ( 'is_approved' === $filter['key'] && in_array( \GravityView_Entry_Approval_Status::UNAPPROVED, (array) $filter['value'] ) ) {
786
-				$_tmp_query       = new $query_class( $view->form->ID, array(
785
+			if ( 'is_approved' === $filter[ 'key' ] && in_array( \GravityView_Entry_Approval_Status::UNAPPROVED, (array)$filter[ 'value' ] ) ) {
786
+				$_tmp_query = new $query_class( $view->form->ID, array(
787 787
 					'field_filters' => array(
788 788
 						array(
789 789
 							'operator' => 'in',
790 790
 							'key'      => 'is_approved',
791
-							'value'    => (array) $filter['value'],
791
+							'value'    => (array)$filter[ 'value' ],
792 792
 						),
793 793
 						array(
794 794
 							'operator' => 'is',
@@ -800,30 +800,30 @@  discard block
 block discarded – undo
800 800
 				) );
801 801
 				$_tmp_query_parts = $_tmp_query->_introspect();
802 802
 
803
-				$extra_conditions[] = $_tmp_query_parts['where'];
803
+				$extra_conditions[ ] = $_tmp_query_parts[ 'where' ];
804 804
 
805 805
 				$filter = false;
806 806
 				continue;
807 807
 			}
808 808
 
809 809
 			// Construct manual query for text mode creator search
810
-			if ( 'created_by' === $filter['key'] && ! empty( $created_by_text_mode ) ) {
811
-				$extra_conditions[] = new GravityView_Widget_Search_Author_GF_Query_Condition( $filter, $view );
810
+			if ( 'created_by' === $filter[ 'key' ] && ! empty( $created_by_text_mode ) ) {
811
+				$extra_conditions[ ] = new GravityView_Widget_Search_Author_GF_Query_Condition( $filter, $view );
812 812
 				$filter = false;
813 813
 				continue;
814 814
 			}
815 815
 
816 816
 			// By default, we want searches to be wildcard for each field.
817
-			$filter['operator'] = empty( $filter['operator'] ) ? 'contains' : $filter['operator'];
817
+			$filter[ 'operator' ] = empty( $filter[ 'operator' ] ) ? 'contains' : $filter[ 'operator' ];
818 818
 
819 819
 			// For multichoice, let's have an in (OR) search.
820
-			if ( is_array( $filter['value'] ) ) {
821
-				$filter['operator'] = 'in'; // @todo what about in contains (OR LIKE chains)?
820
+			if ( is_array( $filter[ 'value' ] ) ) {
821
+				$filter[ 'operator' ] = 'in'; // @todo what about in contains (OR LIKE chains)?
822 822
 			}
823 823
 
824 824
 			// Default form with joins functionality
825
-			if ( empty( $filter['form_id'] ) ) {
826
-				$filter['form_id'] = $view->form ? $view->form->ID : 0;
825
+			if ( empty( $filter[ 'form_id' ] ) ) {
826
+				$filter[ 'form_id' ] = $view->form ? $view->form->ID : 0;
827 827
 			}
828 828
 
829 829
 			/**
@@ -833,28 +833,28 @@  discard block
 block discarded – undo
833 833
 			 * @since develop
834 834
 			 * @param \GV\View $view The View we're operating on.
835 835
 			 */
836
-			$filter['operator'] = apply_filters( 'gravityview_search_operator', $filter['operator'], $filter, $view );
836
+			$filter[ 'operator' ] = apply_filters( 'gravityview_search_operator', $filter[ 'operator' ], $filter, $view );
837 837
 		}
838 838
 
839
-		if ( ! empty( $search_criteria['start_date'] ) || ! empty( $search_criteria['end_date'] ) ) {
839
+		if ( ! empty( $search_criteria[ 'start_date' ] ) || ! empty( $search_criteria[ 'end_date' ] ) ) {
840 840
 			$date_criteria = array();
841 841
 
842
-			if ( isset( $search_criteria['start_date'] ) ) {
843
-				$date_criteria['start_date'] = $search_criteria['start_date'];
842
+			if ( isset( $search_criteria[ 'start_date' ] ) ) {
843
+				$date_criteria[ 'start_date' ] = $search_criteria[ 'start_date' ];
844 844
 			}
845 845
 
846
-			if ( isset( $search_criteria['end_date'] ) ) {
847
-				$date_criteria['end_date'] = $search_criteria['end_date'];
846
+			if ( isset( $search_criteria[ 'end_date' ] ) ) {
847
+				$date_criteria[ 'end_date' ] = $search_criteria[ 'end_date' ];
848 848
 			}
849 849
 
850 850
 			$_tmp_query         = new $query_class( $view->form->ID, $date_criteria );
851 851
 			$_tmp_query_parts   = $_tmp_query->_introspect();
852
-			$extra_conditions[] = $_tmp_query_parts['where'];
852
+			$extra_conditions[ ] = $_tmp_query_parts[ 'where' ];
853 853
 		}
854 854
 
855 855
 		$search_conditions = array();
856 856
 
857
-		if ( $filters = array_filter( $search_criteria['field_filters'] ) ) {
857
+		if ( $filters = array_filter( $search_criteria[ 'field_filters' ] ) ) {
858 858
 			foreach ( $filters as &$filter ) {
859 859
 				if ( ! is_array( $filter ) ) {
860 860
 					continue;
@@ -866,12 +866,12 @@  discard block
 block discarded – undo
866 866
 				 * code by reusing what's inside GF_Query already as they
867 867
 				 * take care of many small things like forcing numeric, etc.
868 868
 				 */
869
-				$_tmp_query       = new $query_class( $filter['form_id'], array( 'mode' => 'any', 'field_filters' => array( $filter ) ) );
869
+				$_tmp_query       = new $query_class( $filter[ 'form_id' ], array( 'mode' => 'any', 'field_filters' => array( $filter ) ) );
870 870
 				$_tmp_query_parts = $_tmp_query->_introspect();
871
-				$search_condition = $_tmp_query_parts['where'];
871
+				$search_condition = $_tmp_query_parts[ 'where' ];
872 872
 
873
-				if ( empty( $filter['key'] ) && $search_condition->expressions ) {
874
-					$search_conditions[] = $search_condition;
873
+				if ( empty( $filter[ 'key' ] ) && $search_condition->expressions ) {
874
+					$search_conditions[ ] = $search_condition;
875 875
 				} else {
876 876
 					$left = $search_condition->left;
877 877
 					$alias = $query->_alias( $left->field_id, $left->source, $left->is_entry_column() ? 't' : 'm' );
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
 							$on = $_join->join_on;
882 882
 							$join = $_join->join;
883 883
 
884
-							$search_conditions[] = GF_Query_Condition::_or(
884
+							$search_conditions[ ] = GF_Query_Condition::_or(
885 885
 								// Join
886 886
 								new GF_Query_Condition(
887 887
 									new GF_Query_Column( GF_Query_Column::META, $join->ID, $query->_alias( GF_Query_Column::META, $join->ID, 'm' ) ),
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
 							);
898 898
 						}
899 899
 					} else {
900
-						$search_conditions[] = new GF_Query_Condition(
900
+						$search_conditions[ ] = new GF_Query_Condition(
901 901
 							new GF_Query_Column( $left->field_id, $left->source, $alias ),
902 902
 							$search_condition->operator,
903 903
 							$search_condition->right
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
 		/**
920 920
 		 * Combine the parts as a new WHERE clause.
921 921
 		 */
922
-		$where = call_user_func_array( '\GF_Query_Condition::_and', array_merge( array( $query_parts['where'] ), $search_conditions, $extra_conditions ) );
922
+		$where = call_user_func_array( '\GF_Query_Condition::_and', array_merge( array( $query_parts[ 'where' ] ), $search_conditions, $extra_conditions ) );
923 923
 		$query->where( $where );
924 924
 	}
925 925
 
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
 		$field_id = str_replace( 'filter_', '', $key );
943 943
 
944 944
 		// calculates field_id, removing 'filter_' and for '_' for advanced fields ( like name or checkbox )
945
-		if ( preg_match('/^[0-9_]+$/ism', $field_id ) ) {
945
+		if ( preg_match( '/^[0-9_]+$/ism', $field_id ) ) {
946 946
 			$field_id = str_replace( '_', '.', $field_id );
947 947
 		}
948 948
 
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
 			// form is in searchable fields
1000 1000
 			$found = false;
1001 1001
 			foreach ( $searchable_fields as $field ) {
1002
-				if ( $field_id == $field['field'] && $form->ID == $field['form_id'] ) {
1002
+				if ( $field_id == $field[ 'field' ] && $form->ID == $field[ 'form_id' ] ) {
1003 1003
 					$found = true;
1004 1004
 					break;
1005 1005
 				}
@@ -1039,7 +1039,7 @@  discard block
 block discarded – undo
1039 1039
 
1040 1040
 			case 'select':
1041 1041
 			case 'radio':
1042
-				$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1042
+				$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1043 1043
 				break;
1044 1044
 
1045 1045
 			case 'post_category':
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
 
1054 1054
 				foreach ( $value as $val ) {
1055 1055
 					$cat = get_term( $val, 'category' );
1056
-					$filter[] = array(
1056
+					$filter[ ] = array(
1057 1057
 						'key'      => $field_id,
1058 1058
 						'value'    => esc_attr( $cat->name ) . ':' . $val,
1059 1059
 						'operator' => $this->get_operator( $get, $key, array( 'is' ), 'is' ),
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
 				$filter = array();
1073 1073
 
1074 1074
 				foreach ( $value as $val ) {
1075
-					$filter[] = array( 'key' => $field_id, 'value' => $val );
1075
+					$filter[ ] = array( 'key' => $field_id, 'value' => $val );
1076 1076
 				}
1077 1077
 
1078 1078
 				break;
@@ -1081,9 +1081,9 @@  discard block
 block discarded – undo
1081 1081
 				// convert checkbox on/off into the correct search filter
1082 1082
 				if ( false !== strpos( $field_id, '.' ) && ! empty( $form_field->inputs ) && ! empty( $form_field->choices ) ) {
1083 1083
 					foreach ( $form_field->inputs as $k => $input ) {
1084
-						if ( $input['id'] == $field_id ) {
1085
-							$filter['value'] = $form_field->choices[ $k ]['value'];
1086
-							$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1084
+						if ( $input[ 'id' ] == $field_id ) {
1085
+							$filter[ 'value' ] = $form_field->choices[ $k ][ 'value' ];
1086
+							$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1087 1087
 							break;
1088 1088
 						}
1089 1089
 					}
@@ -1093,7 +1093,7 @@  discard block
 block discarded – undo
1093 1093
 					$filter = array();
1094 1094
 
1095 1095
 					foreach ( $value as $val ) {
1096
-						$filter[] = array(
1096
+						$filter[ ] = array(
1097 1097
 							'key'      => $field_id,
1098 1098
 							'value'    => $val,
1099 1099
 							'operator' => $this->get_operator( $get, $key, array( 'is' ), 'is' ),
@@ -1114,9 +1114,9 @@  discard block
 block discarded – undo
1114 1114
 					foreach ( $words as $word ) {
1115 1115
 						if ( ! empty( $word ) && strlen( $word ) > 1 ) {
1116 1116
 							// Keep the same key for each filter
1117
-							$filter['value'] = $word;
1117
+							$filter[ 'value' ] = $word;
1118 1118
 							// Add a search for the value
1119
-							$filters[] = $filter;
1119
+							$filters[ ] = $filter;
1120 1120
 						}
1121 1121
 					}
1122 1122
 
@@ -1130,19 +1130,19 @@  discard block
 block discarded – undo
1130 1130
 
1131 1131
 					foreach ( $searchable_fields as $searchable_field ) {
1132 1132
 
1133
-						if( $form_field->ID !== $searchable_field['field'] ) {
1133
+						if ( $form_field->ID !== $searchable_field[ 'field' ] ) {
1134 1134
 							continue;
1135 1135
 						}
1136 1136
 
1137 1137
 						// Only exact-match dropdowns, not text search
1138
-						if( in_array( $searchable_field['input'], array( 'text', 'search' ), true ) ) {
1138
+						if ( in_array( $searchable_field[ 'input' ], array( 'text', 'search' ), true ) ) {
1139 1139
 							continue;
1140 1140
 						}
1141 1141
 
1142 1142
 						$input_id = gravityview_get_input_id_from_id( $form_field->ID );
1143 1143
 
1144 1144
 						if ( 4 === $input_id ) {
1145
-							$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1145
+							$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1146 1146
 						};
1147 1147
 					}
1148 1148
 				}
@@ -1169,12 +1169,12 @@  discard block
 block discarded – undo
1169 1169
 						 * @since 1.16.3
1170 1170
 						 * Safeguard until GF implements '<=' operator
1171 1171
 						 */
1172
-						if( !GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) {
1172
+						if ( ! GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) {
1173 1173
 							$operator = '<';
1174 1174
 							$date = date( 'Y-m-d', strtotime( self::get_formatted_date( $date, 'Y-m-d', $date_format ) . ' +1 day' ) );
1175 1175
 						}
1176 1176
 
1177
-						$filter[] = array(
1177
+						$filter[ ] = array(
1178 1178
 							'key'      => $field_id,
1179 1179
 							'value'    => self::get_formatted_date( $date, 'Y-m-d', $date_format ),
1180 1180
 							'operator' => $this->get_operator( $get, $key, array( $operator ), $operator ),
@@ -1182,8 +1182,8 @@  discard block
 block discarded – undo
1182 1182
 					}
1183 1183
 				} else {
1184 1184
 					$date = $value;
1185
-					$filter['value'] = self::get_formatted_date( $date, 'Y-m-d', $date_format );
1186
-					$filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1185
+					$filter[ 'value' ] = self::get_formatted_date( $date, 'Y-m-d', $date_format );
1186
+					$filter[ 'operator' ] = $this->get_operator( $get, $key, array( 'is' ), 'is' );
1187 1187
 				}
1188 1188
 
1189 1189
 				break;
@@ -1214,7 +1214,7 @@  discard block
 block discarded – undo
1214 1214
 			'ymd_dot' => 'Y.m.d',
1215 1215
 		);
1216 1216
 
1217
-		if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ){
1217
+		if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ) {
1218 1218
 			$format = $datepicker[ $field->dateFormat ];
1219 1219
 		}
1220 1220
 
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
 	public function add_template_path( $file_paths ) {
1252 1252
 
1253 1253
 		// Index 100 is the default GravityView template path.
1254
-		$file_paths[102] = self::$file . 'templates/';
1254
+		$file_paths[ 102 ] = self::$file . 'templates/';
1255 1255
 
1256 1256
 		return $file_paths;
1257 1257
 	}
@@ -1270,7 +1270,7 @@  discard block
 block discarded – undo
1270 1270
 		$has_date = false;
1271 1271
 
1272 1272
 		foreach ( $search_fields as $k => $field ) {
1273
-			if ( in_array( $field['input'], array( 'date', 'date_range', 'entry_date' ) ) ) {
1273
+			if ( in_array( $field[ 'input' ], array( 'date', 'date_range', 'entry_date' ) ) ) {
1274 1274
 				$has_date = true;
1275 1275
 				break;
1276 1276
 			}
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
 		}
1298 1298
 
1299 1299
 		// get configured search fields
1300
-		$search_fields = ! empty( $widget_args['search_fields'] ) ? json_decode( $widget_args['search_fields'], true ) : '';
1300
+		$search_fields = ! empty( $widget_args[ 'search_fields' ] ) ? json_decode( $widget_args[ 'search_fields' ], true ) : '';
1301 1301
 
1302 1302
 		if ( empty( $search_fields ) || ! is_array( $search_fields ) ) {
1303 1303
 			gravityview()->log->debug( 'No search fields configured for widget:', array( 'data' => $widget_args ) );
@@ -1313,40 +1313,40 @@  discard block
 block discarded – undo
1313 1313
 
1314 1314
 			$updated_field = $this->get_search_filter_details( $updated_field, $context );
1315 1315
 
1316
-			switch ( $field['field'] ) {
1316
+			switch ( $field[ 'field' ] ) {
1317 1317
 
1318 1318
 				case 'search_all':
1319
-					$updated_field['key'] = 'search_all';
1320
-					$updated_field['input'] = 'search_all';
1321
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_search' );
1319
+					$updated_field[ 'key' ] = 'search_all';
1320
+					$updated_field[ 'input' ] = 'search_all';
1321
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_search' );
1322 1322
 					break;
1323 1323
 
1324 1324
 				case 'entry_date':
1325
-					$updated_field['key'] = 'entry_date';
1326
-					$updated_field['input'] = 'entry_date';
1327
-					$updated_field['value'] = array(
1325
+					$updated_field[ 'key' ] = 'entry_date';
1326
+					$updated_field[ 'input' ] = 'entry_date';
1327
+					$updated_field[ 'value' ] = array(
1328 1328
 						'start' => $this->rgget_or_rgpost( 'gv_start' ),
1329 1329
 						'end' => $this->rgget_or_rgpost( 'gv_end' ),
1330 1330
 					);
1331 1331
 					break;
1332 1332
 
1333 1333
 				case 'entry_id':
1334
-					$updated_field['key'] = 'entry_id';
1335
-					$updated_field['input'] = 'entry_id';
1336
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_id' );
1334
+					$updated_field[ 'key' ] = 'entry_id';
1335
+					$updated_field[ 'input' ] = 'entry_id';
1336
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_id' );
1337 1337
 					break;
1338 1338
 
1339 1339
 				case 'created_by':
1340
-					$updated_field['key'] = 'created_by';
1341
-					$updated_field['name'] = 'gv_by';
1342
-					$updated_field['value'] = $this->rgget_or_rgpost( 'gv_by' );
1343
-					$updated_field['choices'] = self::get_created_by_choices( $view );
1340
+					$updated_field[ 'key' ] = 'created_by';
1341
+					$updated_field[ 'name' ] = 'gv_by';
1342
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'gv_by' );
1343
+					$updated_field[ 'choices' ] = self::get_created_by_choices( $view );
1344 1344
 					break;
1345 1345
 
1346 1346
 				case 'is_approved':
1347
-					$updated_field['key'] = 'is_approved';
1348
-					$updated_field['value'] = $this->rgget_or_rgpost( 'filter_is_approved' );
1349
-					$updated_field['choices'] = self::get_is_approved_choices();
1347
+					$updated_field[ 'key' ] = 'is_approved';
1348
+					$updated_field[ 'value' ] = $this->rgget_or_rgpost( 'filter_is_approved' );
1349
+					$updated_field[ 'choices' ] = self::get_is_approved_choices();
1350 1350
 					break;
1351 1351
 			}
1352 1352
 
@@ -1367,16 +1367,16 @@  discard block
 block discarded – undo
1367 1367
 
1368 1368
 		$gravityview_view->permalink_fields = $this->add_no_permalink_fields( array(), $this, $widget_args );
1369 1369
 
1370
-		$gravityview_view->search_layout = ! empty( $widget_args['search_layout'] ) ? $widget_args['search_layout'] : 'horizontal';
1370
+		$gravityview_view->search_layout = ! empty( $widget_args[ 'search_layout' ] ) ? $widget_args[ 'search_layout' ] : 'horizontal';
1371 1371
 
1372 1372
 		/** @since 1.14 */
1373
-		$gravityview_view->search_mode = ! empty( $widget_args['search_mode'] ) ? $widget_args['search_mode'] : 'any';
1373
+		$gravityview_view->search_mode = ! empty( $widget_args[ 'search_mode' ] ) ? $widget_args[ 'search_mode' ] : 'any';
1374 1374
 
1375
-		$custom_class = ! empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : '';
1375
+		$custom_class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : '';
1376 1376
 
1377 1377
 		$gravityview_view->search_class = self::get_search_class( $custom_class );
1378 1378
 
1379
-		$gravityview_view->search_clear = ! empty( $widget_args['search_clear'] ) ? $widget_args['search_clear'] : false;
1379
+		$gravityview_view->search_clear = ! empty( $widget_args[ 'search_clear' ] ) ? $widget_args[ 'search_clear' ] : false;
1380 1380
 
1381 1381
 		if ( $this->has_date_field( $search_fields ) ) {
1382 1382
 			// enqueue datepicker stuff only if needed!
@@ -1398,10 +1398,10 @@  discard block
 block discarded – undo
1398 1398
 	public static function get_search_class( $custom_class = '' ) {
1399 1399
 		$gravityview_view = GravityView_View::getInstance();
1400 1400
 
1401
-		$search_class = 'gv-search-'.$gravityview_view->search_layout;
1401
+		$search_class = 'gv-search-' . $gravityview_view->search_layout;
1402 1402
 
1403
-		if ( ! empty( $custom_class )  ) {
1404
-			$search_class .= ' '.$custom_class;
1403
+		if ( ! empty( $custom_class ) ) {
1404
+			$search_class .= ' ' . $custom_class;
1405 1405
 		}
1406 1406
 
1407 1407
 		/**
@@ -1445,9 +1445,9 @@  discard block
 block discarded – undo
1445 1445
 
1446 1446
 		if ( ! $label ) {
1447 1447
 
1448
-			$label = isset( $form_field['label'] ) ? $form_field['label'] : '';
1448
+			$label = isset( $form_field[ 'label' ] ) ? $form_field[ 'label' ] : '';
1449 1449
 
1450
-			switch( $field['field'] ) {
1450
+			switch ( $field[ 'field' ] ) {
1451 1451
 				case 'search_all':
1452 1452
 					$label = __( 'Search Entries:', 'gravityview' );
1453 1453
 					break;
@@ -1459,10 +1459,10 @@  discard block
 block discarded – undo
1459 1459
 					break;
1460 1460
 				default:
1461 1461
 					// If this is a field input, not a field
1462
-					if ( strpos( $field['field'], '.' ) > 0 && ! empty( $form_field['inputs'] ) ) {
1462
+					if ( strpos( $field[ 'field' ], '.' ) > 0 && ! empty( $form_field[ 'inputs' ] ) ) {
1463 1463
 
1464 1464
 						// Get the label for the field in question, which returns an array
1465
-						$items = wp_list_filter( $form_field['inputs'], array( 'id' => $field['field'] ) );
1465
+						$items = wp_list_filter( $form_field[ 'inputs' ], array( 'id' => $field[ 'field' ] ) );
1466 1466
 
1467 1467
 						// Get the item with the `label` key
1468 1468
 						$values = wp_list_pluck( $items, 'label' );
@@ -1503,35 +1503,35 @@  discard block
 block discarded – undo
1503 1503
 		$form = $gravityview_view->getForm();
1504 1504
 
1505 1505
 		// for advanced field ids (eg, first name / last name )
1506
-		$name = 'filter_' . str_replace( '.', '_', $field['field'] );
1506
+		$name = 'filter_' . str_replace( '.', '_', $field[ 'field' ] );
1507 1507
 
1508 1508
 		// get searched value from $_GET/$_POST (string or array)
1509 1509
 		$value = $this->rgget_or_rgpost( $name );
1510 1510
 
1511 1511
 		// get form field details
1512
-		$form_field = gravityview_get_field( $form, $field['field'] );
1512
+		$form_field = gravityview_get_field( $form, $field[ 'field' ] );
1513 1513
 
1514 1514
 		$filter = array(
1515
-			'key' => $field['field'],
1515
+			'key' => $field[ 'field' ],
1516 1516
 			'name' => $name,
1517 1517
 			'label' => self::get_field_label( $field, $form_field ),
1518
-			'input' => $field['input'],
1518
+			'input' => $field[ 'input' ],
1519 1519
 			'value' => $value,
1520
-			'type' => $form_field['type'],
1520
+			'type' => $form_field[ 'type' ],
1521 1521
 		);
1522 1522
 
1523 1523
 		// collect choices
1524
-		if ( 'post_category' === $form_field['type'] && ! empty( $form_field['displayAllCategories'] ) && empty( $form_field['choices'] ) ) {
1525
-			$filter['choices'] = gravityview_get_terms_choices();
1526
-		} elseif ( ! empty( $form_field['choices'] ) ) {
1527
-			$filter['choices'] = $form_field['choices'];
1524
+		if ( 'post_category' === $form_field[ 'type' ] && ! empty( $form_field[ 'displayAllCategories' ] ) && empty( $form_field[ 'choices' ] ) ) {
1525
+			$filter[ 'choices' ] = gravityview_get_terms_choices();
1526
+		} elseif ( ! empty( $form_field[ 'choices' ] ) ) {
1527
+			$filter[ 'choices' ] = $form_field[ 'choices' ];
1528 1528
 		}
1529 1529
 
1530
-		if ( 'date_range' === $field['input'] && empty( $value ) ) {
1531
-			$filter['value'] = array( 'start' => '', 'end' => '' );
1530
+		if ( 'date_range' === $field[ 'input' ] && empty( $value ) ) {
1531
+			$filter[ 'value' ] = array( 'start' => '', 'end' => '' );
1532 1532
 		}
1533 1533
 
1534
-		if ( ! empty( $filter['choices'] ) ) {
1534
+		if ( ! empty( $filter[ 'choices' ] ) ) {
1535 1535
 			/**
1536 1536
 			 * @filter `gravityview/search/sieve_choices` Only output used choices for this field.
1537 1537
 			 * @param[in,out] bool Yes or no.
@@ -1539,7 +1539,7 @@  discard block
 block discarded – undo
1539 1539
 			 * @param \GV\Context The context.
1540 1540
 			 */
1541 1541
 			if ( apply_filters( 'gravityview/search/sieve_choices', false, $field, $context ) ) {
1542
-				$filter['choices'] = $this->sieve_filter_choices( $filter, $context );
1542
+				$filter[ 'choices' ] = $this->sieve_filter_choices( $filter, $context );
1543 1543
 			}
1544 1544
 		}
1545 1545
 
@@ -1568,11 +1568,11 @@  discard block
 block discarded – undo
1568 1568
 	 * @return array The filter choices.
1569 1569
 	 */
1570 1570
 	private function sieve_filter_choices( $filter, $context ) {
1571
-		if ( empty( $filter['key'] ) || empty( $filter['choices'] ) ) {
1571
+		if ( empty( $filter[ 'key' ] ) || empty( $filter[ 'choices' ] ) ) {
1572 1572
 			return $filter; // @todo Populate plugins might give us empty choices
1573 1573
 		}
1574 1574
 
1575
-		if ( ! is_numeric( $filter['key'] ) ) {
1575
+		if ( ! is_numeric( $filter[ 'key' ] ) ) {
1576 1576
 			return $filter;
1577 1577
 		}
1578 1578
 
@@ -1582,29 +1582,29 @@  discard block
 block discarded – undo
1582 1582
 
1583 1583
 		$table = GFFormsModel::get_entry_meta_table_name();
1584 1584
 
1585
-		$key_like = $wpdb->esc_like( $filter['key'] ) . '.%';
1585
+		$key_like = $wpdb->esc_like( $filter[ 'key' ] ) . '.%';
1586 1586
 
1587 1587
 		switch ( \GV\Utils::get( $filter, 'type' ) ):
1588 1588
 			case 'post_category':
1589 1589
 				$choices = $wpdb->get_col( $wpdb->prepare(
1590 1590
 					"SELECT DISTINCT SUBSTRING_INDEX(meta_value, ':', 1) FROM $table WHERE (meta_key LIKE %s OR meta_key = %d) AND form_id = %d",
1591
-					$key_like, $filter['key'], $form_id
1591
+					$key_like, $filter[ 'key' ], $form_id
1592 1592
 				) );
1593 1593
 				break;
1594 1594
 			default:
1595 1595
 				$choices = $wpdb->get_col( $wpdb->prepare(
1596 1596
 					"SELECT DISTINCT meta_value FROM $table WHERE (meta_key LIKE %s OR meta_key = %d) AND form_id = %d",
1597
-					$key_like, $filter['key'], $form_id
1597
+					$key_like, $filter[ 'key' ], $form_id
1598 1598
 				) );
1599 1599
 
1600
-				if ( ( $field = gravityview_get_field( $form_id, $filter['key'] ) ) && 'json' === $field->storageType ) {
1600
+				if ( ( $field = gravityview_get_field( $form_id, $filter[ 'key' ] ) ) && 'json' === $field->storageType ) {
1601 1601
 					$choices = array_map( 'json_decode', $choices );
1602 1602
 					$_choices_array = array();
1603 1603
 					foreach ( $choices as $choice ) {
1604 1604
 						if ( is_array( $choice ) ) {
1605 1605
 							$_choices_array = array_merge( $_choices_array, $choice );
1606 1606
 						} else {
1607
-							$_choices_array []= $choice;
1607
+							$_choices_array [ ] = $choice;
1608 1608
 						}
1609 1609
 					}
1610 1610
 					$choices = array_unique( $_choices_array );
@@ -1614,9 +1614,9 @@  discard block
 block discarded – undo
1614 1614
 		endswitch;
1615 1615
 
1616 1616
 		$filter_choices = array();
1617
-		foreach ( $filter['choices'] as $choice ) {
1618
-			if ( in_array( $choice['text'], $choices, true ) || in_array( $choice['value'], $choices, true ) ) {
1619
-				$filter_choices[] = $choice;
1617
+		foreach ( $filter[ 'choices' ] as $choice ) {
1618
+			if ( in_array( $choice[ 'text' ], $choices, true ) || in_array( $choice[ 'value' ], $choices, true ) ) {
1619
+				$filter_choices[ ] = $choice;
1620 1620
 			}
1621 1621
 		}
1622 1622
 
@@ -1651,7 +1651,7 @@  discard block
 block discarded – undo
1651 1651
 			 * @param \GV\View $view The view.
1652 1652
 			 */
1653 1653
 			$text = apply_filters( 'gravityview/search/created_by/text', $user->display_name, $user, $view );
1654
-			$choices[] = array(
1654
+			$choices[ ] = array(
1655 1655
 				'value' => $user->ID,
1656 1656
 				'text' => $text,
1657 1657
 			);
@@ -1671,9 +1671,9 @@  discard block
 block discarded – undo
1671 1671
 
1672 1672
 		$choices = array();
1673 1673
 		foreach ( GravityView_Entry_Approval_Status::get_all() as $status ) {
1674
-			$choices[] = array(
1675
-				'value' => $status['value'],
1676
-				'text' => $status['label'],
1674
+			$choices[ ] = array(
1675
+				'value' => $status[ 'value' ],
1676
+				'text' => $status[ 'label' ],
1677 1677
 			);
1678 1678
 		}
1679 1679
 
@@ -1725,7 +1725,7 @@  discard block
 block discarded – undo
1725 1725
 	 */
1726 1726
 	public function add_datepicker_js_dependency( $js_dependencies ) {
1727 1727
 
1728
-		$js_dependencies[] = 'jquery-ui-datepicker';
1728
+		$js_dependencies[ ] = 'jquery-ui-datepicker';
1729 1729
 
1730 1730
 		return $js_dependencies;
1731 1731
 	}
@@ -1769,7 +1769,7 @@  discard block
 block discarded – undo
1769 1769
 			'isRTL'             => is_rtl(),
1770 1770
 		), $view_data );
1771 1771
 
1772
-		$localizations['datepicker'] = $datepicker_settings;
1772
+		$localizations[ 'datepicker' ] = $datepicker_settings;
1773 1773
 
1774 1774
 		return $localizations;
1775 1775
 
@@ -1796,7 +1796,7 @@  discard block
 block discarded – undo
1796 1796
 	 * @return void
1797 1797
 	 */
1798 1798
 	private function maybe_enqueue_flexibility() {
1799
-		if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/MSIE [8-9]/', $_SERVER['HTTP_USER_AGENT'] ) ) {
1799
+		if ( isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) && preg_match( '/MSIE [8-9]/', $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {
1800 1800
 			wp_enqueue_script( 'gv-flexibility' );
1801 1801
 		}
1802 1802
 	}
@@ -1818,7 +1818,7 @@  discard block
 block discarded – undo
1818 1818
 		add_filter( 'gravityview_js_localization', array( $this, 'add_datepicker_localization' ), 10, 2 );
1819 1819
 
1820 1820
 		$scheme = is_ssl() ? 'https://' : 'http://';
1821
-		wp_enqueue_style( 'jquery-ui-datepicker', $scheme.'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' );
1821
+		wp_enqueue_style( 'jquery-ui-datepicker', $scheme . 'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' );
1822 1822
 
1823 1823
 		/**
1824 1824
 		 * @filter `gravityview_search_datepicker_class`
@@ -1897,7 +1897,7 @@  discard block
 block discarded – undo
1897 1897
 	public function add_preview_inputs() {
1898 1898
 		global $wp;
1899 1899
 
1900
-		if ( ! is_preview() || ! current_user_can( 'publish_gravityviews') ) {
1900
+		if ( ! is_preview() || ! current_user_can( 'publish_gravityviews' ) ) {
1901 1901
 			return;
1902 1902
 		}
1903 1903
 
@@ -1949,7 +1949,7 @@  discard block
 block discarded – undo
1949 1949
  */
1950 1950
 class GravityView_Widget_Search_Author_GF_Query_Condition extends \GF_Query_Condition {
1951 1951
 	public function __construct( $filter, $view ) {
1952
-		$this->value = $filter['value'];
1952
+		$this->value = $filter[ 'value' ];
1953 1953
 		$this->view = $view;
1954 1954
 	}
1955 1955
 
@@ -1981,11 +1981,11 @@  discard block
 block discarded – undo
1981 1981
 		$conditions = array();
1982 1982
 
1983 1983
 		foreach ( $user_fields as $user_field ) {
1984
-			$conditions[] = $wpdb->prepare( "`u`.`$user_field` LIKE %s", '%' . $wpdb->esc_like( $this->value ) .  '%' );
1984
+			$conditions[ ] = $wpdb->prepare( "`u`.`$user_field` LIKE %s", '%' . $wpdb->esc_like( $this->value ) . '%' );
1985 1985
 		}
1986 1986
 
1987 1987
 		foreach ( $user_meta_fields as $meta_field ) {
1988
-			$conditions[] = $wpdb->prepare( "(`um`.`meta_key` = %s AND `um`.`meta_value` LIKE %s)", $meta_field, '%' . $wpdb->esc_like( $this->value ) .  '%' );
1988
+			$conditions[ ] = $wpdb->prepare( "(`um`.`meta_key` = %s AND `um`.`meta_value` LIKE %s)", $meta_field, '%' . $wpdb->esc_like( $this->value ) . '%' );
1989 1989
 		}
1990 1990
 
1991 1991
 		$conditions = '(' . implode( ' OR ', $conditions ) . ')';
Please login to merge, or discard this patch.
includes/admin/metaboxes/views/data-source.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 wp_nonce_field( 'gravityview_select_form', 'gravityview_select_form_nonce' );
11 11
 
12 12
 //current value
13
-$current_form = (int) \GV\Utils::_GET( 'form_id', gravityview_get_form_id( $post->ID ) );
13
+$current_form = (int)\GV\Utils::_GET( 'form_id', gravityview_get_form_id( $post->ID ) );
14 14
 
15 15
 // If form is in trash or not existing, show error
16 16
 GravityView_Admin::connected_form_warning( $current_form );
17 17
 
18 18
 // check for available gravity forms
19
-$forms = gravityview_get_forms('any');
19
+$forms = gravityview_get_forms( 'any' );
20 20
 
21 21
 /**
22 22
  * @param int $current_form Form currently selected in the View (0 if none selected)
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
 	<?php
33 33
 
34 34
 	// If there are no forms to select, show no forms.
35
-	if( !empty( $forms ) ) { ?>
35
+	if ( ! empty( $forms ) ) { ?>
36 36
 		<select name="gravityview_form_id" id="gravityview_form_id">
37 37
 			<?php
38
-				if ( isset( $_GET['preset'] ) ) {
38
+				if ( isset( $_GET[ 'preset' ] ) ) {
39 39
 					?>
40 40
 						<option value="" <?php selected( '', $current_form, true ); ?>>&mdash; <?php esc_html_e( 'a new form', 'gravityview' ); ?> &mdash;</option>
41 41
 					<?php
@@ -45,15 +45,15 @@  discard block
 block discarded – undo
45 45
 					<?php
46 46
 				}
47 47
 			?>
48
-			<?php foreach( $forms as $form ) { ?>
49
-				<option value="<?php echo $form['id']; ?>" <?php selected( $form['id'], $current_form, true ); ?>><?php echo esc_html( $form['title'] ); ?></option>
48
+			<?php foreach ( $forms as $form ) { ?>
49
+				<option value="<?php echo $form[ 'id' ]; ?>" <?php selected( $form[ 'id' ], $current_form, true ); ?>><?php echo esc_html( $form[ 'title' ] ); ?></option>
50 50
 			<?php } ?>
51 51
 		</select>
52 52
 	<?php } else { ?>
53 53
 		<select name="gravityview_form_id" id="gravityview_form_id" class="hidden"><option selected="selected" value=""></option></select>
54 54
 	<?php } ?>
55 55
 
56
-	&nbsp;<a class="button button-primary" <?php if( empty( $current_form ) ) { echo 'style="display:none;"'; } ?> id="gv_switch_view_button" href="#gv_switch_view" title="<?php esc_attr_e( 'Switch View', 'gravityview' ); ?>"><?php esc_html_e( 'Switch View Type', 'gravityview' ); ?></a>
56
+	&nbsp;<a class="button button-primary" <?php if ( empty( $current_form ) ) { echo 'style="display:none;"'; } ?> id="gv_switch_view_button" href="#gv_switch_view" title="<?php esc_attr_e( 'Switch View', 'gravityview' ); ?>"><?php esc_html_e( 'Switch View Type', 'gravityview' ); ?></a>
57 57
 </p>
58 58
 
59 59
 <?php // confirm dialog box ?>
Please login to merge, or discard this patch.
includes/class-admin-views.php 1 patch
Spacing   +182 added lines, -182 removed lines patch added patch discarded remove patch
@@ -27,32 +27,32 @@  discard block
 block discarded – undo
27 27
 		add_filter( 'gravityview_blacklist_field_types', array( $this, 'default_field_blacklist' ), 10, 2 );
28 28
 
29 29
 		// Tooltips
30
-		add_filter( 'gform_tooltips', array( $this, 'tooltips') );
30
+		add_filter( 'gform_tooltips', array( $this, 'tooltips' ) );
31 31
 
32 32
 		// adding styles and scripts
33
-		add_action( 'admin_enqueue_scripts', array( 'GravityView_Admin_Views', 'add_scripts_and_styles'), 999 );
34
-		add_filter( 'gform_noconflict_styles', array( $this, 'register_no_conflict') );
35
-		add_filter( 'gform_noconflict_scripts', array( $this, 'register_no_conflict') );
36
-		add_filter( 'gravityview_noconflict_styles', array( $this, 'register_no_conflict') );
37
-		add_filter( 'gravityview_noconflict_scripts', array( $this, 'register_no_conflict') );
38
-
39
-		add_action( 'gravityview_render_directory_active_areas', array( $this, 'render_directory_active_areas'), 10, 4 );
40
-		add_action( 'gravityview_render_widgets_active_areas', array( $this, 'render_widgets_active_areas'), 10, 3 );
41
-		add_action( 'gravityview_render_field_pickers', array( $this, 'render_field_pickers') );
42
-		add_action( 'gravityview_render_available_fields', array( $this, 'render_available_fields'), 10, 2 );
43
-		add_action( 'gravityview_render_available_widgets', array( $this, 'render_available_widgets') );
44
-		add_action( 'gravityview_render_active_areas', array( $this, 'render_active_areas'), 10, 5 );
33
+		add_action( 'admin_enqueue_scripts', array( 'GravityView_Admin_Views', 'add_scripts_and_styles' ), 999 );
34
+		add_filter( 'gform_noconflict_styles', array( $this, 'register_no_conflict' ) );
35
+		add_filter( 'gform_noconflict_scripts', array( $this, 'register_no_conflict' ) );
36
+		add_filter( 'gravityview_noconflict_styles', array( $this, 'register_no_conflict' ) );
37
+		add_filter( 'gravityview_noconflict_scripts', array( $this, 'register_no_conflict' ) );
38
+
39
+		add_action( 'gravityview_render_directory_active_areas', array( $this, 'render_directory_active_areas' ), 10, 4 );
40
+		add_action( 'gravityview_render_widgets_active_areas', array( $this, 'render_widgets_active_areas' ), 10, 3 );
41
+		add_action( 'gravityview_render_field_pickers', array( $this, 'render_field_pickers' ) );
42
+		add_action( 'gravityview_render_available_fields', array( $this, 'render_available_fields' ), 10, 2 );
43
+		add_action( 'gravityview_render_available_widgets', array( $this, 'render_available_widgets' ) );
44
+		add_action( 'gravityview_render_active_areas', array( $this, 'render_active_areas' ), 10, 5 );
45 45
 
46 46
 		// @todo check if this hook is needed..
47 47
 		//add_action( 'gravityview_render_field_options', array( $this, 'render_field_options'), 10, 9 );
48 48
 
49 49
 		// Add Connected Form column
50
-		add_filter('manage_gravityview_posts_columns' , array( $this, 'add_post_type_columns' ) );
50
+		add_filter( 'manage_gravityview_posts_columns', array( $this, 'add_post_type_columns' ) );
51 51
 
52 52
 		add_filter( 'gform_toolbar_menu', array( 'GravityView_Admin_Views', 'gform_toolbar_menu' ), 10, 2 );
53 53
 		add_action( 'gform_form_actions', array( 'GravityView_Admin_Views', 'gform_toolbar_menu' ), 10, 2 );
54 54
 
55
-		add_action( 'manage_gravityview_posts_custom_column', array( $this, 'add_custom_column_content'), 10, 2 );
55
+		add_action( 'manage_gravityview_posts_custom_column', array( $this, 'add_custom_column_content' ), 10, 2 );
56 56
 
57 57
 		add_action( 'restrict_manage_posts', array( $this, 'add_view_dropdown' ) );
58 58
 
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
 	 */
72 72
 	function suggest_support_articles( $localization_data = array() ) {
73 73
 
74
-	    if( ! gravityview()->request->is_view() ) {
74
+	    if ( ! gravityview()->request->is_view() ) {
75 75
 	        return $localization_data;
76 76
         }
77 77
 
78
-		$localization_data['suggest'] = array(
78
+		$localization_data[ 'suggest' ] = array(
79 79
             '57ef23539033602e61d4a560',
80 80
             '54c67bb9e4b0512429885513',
81 81
             '54c67bb9e4b0512429885512',
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
 	public function filter_pre_get_posts_by_gravityview_form_id( &$query ) {
97 97
 		global $pagenow;
98 98
 
99
-		if ( !is_admin() ) {
99
+		if ( ! is_admin() ) {
100 100
 			return;
101 101
 		}
102 102
 
103
-		$form_id = isset( $_GET['gravityview_form_id'] ) ? (int) $_GET['gravityview_form_id'] : false;
103
+		$form_id = isset( $_GET[ 'gravityview_form_id' ] ) ? (int)$_GET[ 'gravityview_form_id' ] : false;
104 104
 
105
-		if( 'edit.php' !== $pagenow || ! $form_id || ! isset( $query->query_vars[ 'post_type' ] ) ) {
105
+		if ( 'edit.php' !== $pagenow || ! $form_id || ! isset( $query->query_vars[ 'post_type' ] ) ) {
106 106
 			return;
107 107
 		}
108 108
 
@@ -119,18 +119,18 @@  discard block
 block discarded – undo
119 119
 	function add_view_dropdown() {
120 120
 		$current_screen = get_current_screen();
121 121
 
122
-		if( 'gravityview' !== $current_screen->post_type ) {
122
+		if ( 'gravityview' !== $current_screen->post_type ) {
123 123
 			return;
124 124
 		}
125 125
 
126 126
 		$forms = gravityview_get_forms();
127 127
 		$current_form = \GV\Utils::_GET( 'gravityview_form_id' );
128 128
 		// If there are no forms to select, show no forms.
129
-		if( !empty( $forms ) ) { ?>
129
+		if ( ! empty( $forms ) ) { ?>
130 130
 			<select name="gravityview_form_id" id="gravityview_form_id">
131 131
 				<option value="" <?php selected( '', $current_form, true ); ?>><?php esc_html_e( 'All forms', 'gravityview' ); ?></option>
132
-				<?php foreach( $forms as $form ) { ?>
133
-					<option value="<?php echo $form['id']; ?>" <?php selected( $form['id'], $current_form, true ); ?>><?php echo esc_html( $form['title'] ); ?></option>
132
+				<?php foreach ( $forms as $form ) { ?>
133
+					<option value="<?php echo $form[ 'id' ]; ?>" <?php selected( $form[ 'id' ], $current_form, true ); ?>><?php echo esc_html( $form[ 'title' ] ); ?></option>
134 134
 				<?php } ?>
135 135
 			</select>
136 136
 		<?php }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 */
144 144
 	public static function render_setting_row( $key = '', $current_settings = array(), $override_input = null, $name = 'template_settings[%s]', $id = 'gravityview_se_%s' ) {
145 145
 		_deprecated_function( 'GravityView_Admin_Views::render_setting_row', '1.1.7', 'GravityView_Render_Settings::render_setting_row' );
146
-		GravityView_Render_Settings::render_setting_row( $key, $current_settings, $override_input, $name , $id );
146
+		GravityView_Render_Settings::render_setting_row( $key, $current_settings, $override_input, $name, $id );
147 147
 	}
148 148
 
149 149
 	/**
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	public static function gform_toolbar_menu( $menu_items = array(), $id = NULL ) {
166 166
 
167 167
 		// Don't show on Trashed forms
168
-		if( 'trash' === rgget( 'filter') ) {
168
+		if ( 'trash' === rgget( 'filter' ) ) {
169 169
 			return $menu_items;
170 170
 		}
171 171
 
@@ -173,13 +173,13 @@  discard block
 block discarded – undo
173 173
 
174 174
 		$priority = 0;
175 175
 
176
-		if( 'form_list' === GFForms::get_page() ) {
176
+		if ( 'form_list' === GFForms::get_page() ) {
177 177
 			$priority = 790;
178 178
         }
179 179
 
180
-		if( empty( $connected_views ) ) {
180
+		if ( empty( $connected_views ) ) {
181 181
 
182
-		    $menu_items['gravityview'] = array(
182
+		    $menu_items[ 'gravityview' ] = array(
183 183
 				'label'          => esc_attr__( 'Create a View', 'gravityview' ),
184 184
 				'icon'           => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>',
185 185
 				'title'          => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
@@ -195,22 +195,22 @@  discard block
 block discarded – undo
195 195
 		$sub_menu_items = array();
196 196
 		foreach ( (array)$connected_views as $view ) {
197 197
 
198
-			if( ! GVCommon::has_cap( 'edit_gravityview', $view->ID ) ) {
198
+			if ( ! GVCommon::has_cap( 'edit_gravityview', $view->ID ) ) {
199 199
 				continue;
200 200
 			}
201 201
 
202
-			$label = empty( $view->post_title ) ? sprintf( __('No Title (View #%d)', 'gravityview' ), $view->ID ) : $view->post_title;
202
+			$label = empty( $view->post_title ) ? sprintf( __( 'No Title (View #%d)', 'gravityview' ), $view->ID ) : $view->post_title;
203 203
 
204
-			$sub_menu_items[] = array(
204
+			$sub_menu_items[ ] = array(
205 205
 				'label' => esc_attr( $label ),
206
-				'url' => admin_url( 'post.php?action=edit&post='.$view->ID ),
206
+				'url' => admin_url( 'post.php?action=edit&post=' . $view->ID ),
207 207
 			);
208 208
 		}
209 209
 
210 210
 		// If there were no items added, then let's create the parent menu
211
-		if( $sub_menu_items ) {
211
+		if ( $sub_menu_items ) {
212 212
 
213
-		    $sub_menu_items[] = array(
213
+		    $sub_menu_items[ ] = array(
214 214
 			    'label' => esc_attr__( 'Create a View', 'gravityview' ),
215 215
                 'link_class' => 'gv-create-view',
216 216
 			    'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
@@ -219,14 +219,14 @@  discard block
 block discarded – undo
219 219
             );
220 220
 
221 221
 			// Make sure Gravity Forms uses the submenu; if there's only one item, it uses a link instead of a dropdown
222
-			$sub_menu_items[] = array(
222
+			$sub_menu_items[ ] = array(
223 223
 				'url' => '#',
224 224
 				'label' => '',
225 225
 				'menu_class' => 'hidden',
226 226
 				'capabilities' => '',
227 227
 			);
228 228
 
229
-			$menu_items['gravityview'] = array(
229
+			$menu_items[ 'gravityview' ] = array(
230 230
 				'label'          => __( 'Connected Views', 'gravityview' ),
231 231
 				'icon'           => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>',
232 232
 				'title'          => __( 'GravityView Views using this form as a data source', 'gravityview' ),
@@ -255,8 +255,8 @@  discard block
 block discarded – undo
255 255
 		$add = array( 'captcha', 'page' );
256 256
 
257 257
 		// Don't allowing editing the following values:
258
-		if( $context === 'edit' ) {
259
-			$add[] = 'post_id';
258
+		if ( $context === 'edit' ) {
259
+			$add[ ] = 'post_id';
260 260
 		}
261 261
 
262 262
 		$return = array_merge( $array, $add );
@@ -279,32 +279,32 @@  discard block
 block discarded – undo
279 279
 		foreach ( $default_args as $key => $arg ) {
280 280
 
281 281
 			// If an arg has `tooltip` defined, but it's false, don't display a tooltip
282
-			if( isset( $arg['tooltip'] ) && empty( $arg['tooltip'] ) ) { continue; }
282
+			if ( isset( $arg[ 'tooltip' ] ) && empty( $arg[ 'tooltip' ] ) ) { continue; }
283 283
 
284 284
 			// By default, use `tooltip` if defined.
285
-			$tooltip = empty( $arg['tooltip'] ) ? NULL : $arg['tooltip'];
285
+			$tooltip = empty( $arg[ 'tooltip' ] ) ? NULL : $arg[ 'tooltip' ];
286 286
 
287 287
 			// Otherwise, use the description as a tooltip.
288
-			if( empty( $tooltip ) && !empty( $arg['desc'] ) ) {
289
-				$tooltip = $arg['desc'];
288
+			if ( empty( $tooltip ) && ! empty( $arg[ 'desc' ] ) ) {
289
+				$tooltip = $arg[ 'desc' ];
290 290
 			}
291 291
 
292 292
 			// If there's no tooltip set, continue
293
-			if( empty( $tooltip ) ) {
293
+			if ( empty( $tooltip ) ) {
294 294
 				continue;
295 295
 			}
296 296
 
297 297
 			// Add the tooltip
298
-			$gv_tooltips[ 'gv_'.$key ] = array(
299
-				'title'	=> $arg['label'],
298
+			$gv_tooltips[ 'gv_' . $key ] = array(
299
+				'title'	=> $arg[ 'label' ],
300 300
 				'value'	=> $tooltip,
301 301
 			);
302 302
 
303 303
 		}
304 304
 
305
-		$gv_tooltips['gv_css_merge_tags'] = array(
306
-			'title' => __('CSS Merge Tags', 'gravityview'),
307
-			'value' => sprintf( __( 'Developers: The CSS classes will be sanitized using the %ssanitize_title_with_dashes()%s function.', 'gravityview'), '<code>', '</code>' )
305
+		$gv_tooltips[ 'gv_css_merge_tags' ] = array(
306
+			'title' => __( 'CSS Merge Tags', 'gravityview' ),
307
+			'value' => sprintf( __( 'Developers: The CSS classes will be sanitized using the %ssanitize_title_with_dashes()%s function.', 'gravityview' ), '<code>', '</code>' )
308 308
 		);
309 309
 
310 310
 		/**
@@ -322,9 +322,9 @@  discard block
 block discarded – undo
322 322
 
323 323
 		foreach ( $gv_tooltips as $key => $tooltip ) {
324 324
 
325
-			$title = empty( $tooltip['title'] ) ? '' : '<h6>'.esc_html( $tooltip['title'] ) .'</h6>';
325
+			$title = empty( $tooltip[ 'title' ] ) ? '' : '<h6>' . esc_html( $tooltip[ 'title' ] ) . '</h6>';
326 326
 
327
-			$tooltips[ $key ] = $title . wpautop( esc_html( $tooltip['value'] ) );
327
+			$tooltips[ $key ] = $title . wpautop( esc_html( $tooltip[ 'value' ] ) );
328 328
 		}
329 329
 
330 330
 		return $tooltips;
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	 *
339 339
 	 * @return void
340 340
 	 */
341
-	public function add_custom_column_content( $column_name = NULL, $post_id )	{
341
+	public function add_custom_column_content( $column_name = NULL, $post_id ) {
342 342
 
343 343
 		$output = '';
344 344
 
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 				// Generate backup if label doesn't exist: `example_name` => `Example Name`
361 361
 				$template_id_pretty = ucwords( implode( ' ', explode( '_', $template_id ) ) );
362 362
 
363
-				$output = $template ? $template['label'] : $template_id_pretty;
363
+				$output = $template ? $template[ 'label' ] : $template_id_pretty;
364 364
 
365 365
 				break;
366 366
 
@@ -401,44 +401,44 @@  discard block
 block discarded – undo
401 401
 	static public function get_connected_form_links( $form, $include_form_link = true ) {
402 402
 
403 403
 		// Either the form is empty or the form ID is 0, not yet set.
404
-		if( empty( $form ) ) {
404
+		if ( empty( $form ) ) {
405 405
 			return '';
406 406
 		}
407 407
 
408 408
 		// The $form is passed as the form ID
409
-		if( !is_array( $form ) ) {
409
+		if ( ! is_array( $form ) ) {
410 410
 			$form = gravityview_get_form( $form );
411 411
 		}
412 412
 
413
-		$form_id = $form['id'];
413
+		$form_id = $form[ 'id' ];
414 414
 		$links = array();
415 415
 
416
-		if( GVCommon::has_cap( 'gravityforms_edit_forms' ) ) {
416
+		if ( GVCommon::has_cap( 'gravityforms_edit_forms' ) ) {
417 417
 			$form_url = admin_url( sprintf( 'admin.php?page=gf_edit_forms&amp;id=%d', $form_id ) );
418
-			$form_link = '<strong class="gv-form-title">'.gravityview_get_link( $form_url, $form['title'], 'class=row-title' ).'</strong>';
419
-			$links[] = '<span>'.gravityview_get_link( $form_url, __('Edit Form', 'gravityview') ).'</span>';
418
+			$form_link = '<strong class="gv-form-title">' . gravityview_get_link( $form_url, $form[ 'title' ], 'class=row-title' ) . '</strong>';
419
+			$links[ ] = '<span>' . gravityview_get_link( $form_url, __( 'Edit Form', 'gravityview' ) ) . '</span>';
420 420
 		} else {
421
-			$form_link = '<strong class="gv-form-title">'. esc_html( $form['title'] ). '</strong>';
421
+			$form_link = '<strong class="gv-form-title">' . esc_html( $form[ 'title' ] ) . '</strong>';
422 422
 		}
423 423
 
424
-		if( GVCommon::has_cap( 'gravityforms_view_entries' ) ) {
424
+		if ( GVCommon::has_cap( 'gravityforms_view_entries' ) ) {
425 425
 			$entries_url = admin_url( sprintf( 'admin.php?page=gf_entries&amp;id=%d', $form_id ) );
426
-			$links[] = '<span>'.gravityview_get_link( $entries_url, __('Entries', 'gravityview') ).'</span>';
426
+			$links[ ] = '<span>' . gravityview_get_link( $entries_url, __( 'Entries', 'gravityview' ) ) . '</span>';
427 427
 		}
428 428
 
429
-		if( GVCommon::has_cap( array( 'gravityforms_edit_settings', 'gravityview_view_settings' ) ) ) {
429
+		if ( GVCommon::has_cap( array( 'gravityforms_edit_settings', 'gravityview_view_settings' ) ) ) {
430 430
 			$settings_url = admin_url( sprintf( 'admin.php?page=gf_edit_forms&amp;view=settings&amp;id=%d', $form_id ) );
431
-			$links[] = '<span>'.gravityview_get_link( $settings_url, __('Settings', 'gravityview'), 'title='.__('Edit settings for this form', 'gravityview') ).'</span>';
431
+			$links[ ] = '<span>' . gravityview_get_link( $settings_url, __( 'Settings', 'gravityview' ), 'title=' . __( 'Edit settings for this form', 'gravityview' ) ) . '</span>';
432 432
 		}
433 433
 
434
-		if( GVCommon::has_cap( array("gravityforms_edit_forms", "gravityforms_create_form", "gravityforms_preview_forms") ) ) {
434
+		if ( GVCommon::has_cap( array( "gravityforms_edit_forms", "gravityforms_create_form", "gravityforms_preview_forms" ) ) ) {
435 435
 			$preview_url = site_url( sprintf( '?gf_page=preview&amp;id=%d', $form_id ) );
436
-			$links[] = '<span>'.gravityview_get_link( $preview_url, __('Preview Form', 'gravityview'), 'title='.__('Preview this form', 'gravityview') ).'</span>';
436
+			$links[ ] = '<span>' . gravityview_get_link( $preview_url, __( 'Preview Form', 'gravityview' ), 'title=' . __( 'Preview this form', 'gravityview' ) ) . '</span>';
437 437
 		}
438 438
 
439 439
 		$output = '';
440 440
 
441
-		if( !empty( $include_form_link ) ) {
441
+		if ( ! empty( $include_form_link ) ) {
442 442
 			$output .= $form_link;
443 443
 		}
444 444
 
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 		 */
451 451
 		$links = apply_filters( 'gravityview_connected_form_links', $links, $form );
452 452
 
453
-		$output .= '<div class="row-actions">'. implode( ' | ', $links ) .'</div>';
453
+		$output .= '<div class="row-actions">' . implode( ' | ', $links ) . '</div>';
454 454
 
455 455
 		return $output;
456 456
 	}
@@ -464,8 +464,8 @@  discard block
 block discarded – undo
464 464
 		// Get the date column and save it for later to add back in.
465 465
 		// This adds it after the Data Source column.
466 466
 		// This way, we don't need to do array_slice, array_merge, etc.
467
-		$date = $columns['date'];
468
-		unset( $columns['date'] );
467
+		$date = $columns[ 'date' ];
468
+		unset( $columns[ 'date' ] );
469 469
 
470 470
 		$data_source_required_caps = array(
471 471
 			'gravityforms_edit_forms',
@@ -476,14 +476,14 @@  discard block
 block discarded – undo
476 476
 			'gravityforms_preview_forms',
477 477
 		);
478 478
 
479
-		if( GVCommon::has_cap( $data_source_required_caps ) ) {
480
-			$columns['gv_connected_form'] = __( 'Data Source', 'gravityview' );
479
+		if ( GVCommon::has_cap( $data_source_required_caps ) ) {
480
+			$columns[ 'gv_connected_form' ] = __( 'Data Source', 'gravityview' );
481 481
 		}
482 482
 
483
-		$columns['gv_template'] = _x( 'Template', 'Column title that shows what template is being used for Views', 'gravityview' );
483
+		$columns[ 'gv_template' ] = _x( 'Template', 'Column title that shows what template is being used for Views', 'gravityview' );
484 484
 
485 485
 		// Add the date back in.
486
-		$columns['date'] = $date;
486
+		$columns[ 'date' ] = $date;
487 487
 
488 488
 		return $columns;
489 489
 	}
@@ -497,12 +497,12 @@  discard block
 block discarded – undo
497 497
 	 */
498 498
 	function save_postdata( $post_id ) {
499 499
 
500
-		if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ){
500
+		if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
501 501
 			return;
502 502
 		}
503 503
 
504 504
 		// validate post_type
505
-		if ( ! isset( $_POST['post_type'] ) || 'gravityview' != $_POST['post_type'] ) {
505
+		if ( ! isset( $_POST[ 'post_type' ] ) || 'gravityview' != $_POST[ 'post_type' ] ) {
506 506
 			return;
507 507
 		}
508 508
 
@@ -517,63 +517,63 @@  discard block
 block discarded – undo
517 517
 		$statii = array();
518 518
 
519 519
 		// check if this is a start fresh View
520
-		if ( isset( $_POST['gravityview_select_form_nonce'] ) && wp_verify_nonce( $_POST['gravityview_select_form_nonce'], 'gravityview_select_form' ) ) {
520
+		if ( isset( $_POST[ 'gravityview_select_form_nonce' ] ) && wp_verify_nonce( $_POST[ 'gravityview_select_form_nonce' ], 'gravityview_select_form' ) ) {
521 521
 
522
-			$form_id = !empty( $_POST['gravityview_form_id'] ) ? $_POST['gravityview_form_id'] : '';
522
+			$form_id = ! empty( $_POST[ 'gravityview_form_id' ] ) ? $_POST[ 'gravityview_form_id' ] : '';
523 523
 			// save form id
524
-			$statii['form_id'] = update_post_meta( $post_id, '_gravityview_form_id', $form_id );
524
+			$statii[ 'form_id' ] = update_post_meta( $post_id, '_gravityview_form_id', $form_id );
525 525
 
526 526
 		}
527 527
 
528
-		if( false === GVCommon::has_cap( 'gravityforms_create_form' ) && empty( $statii['form_id'] ) ) {
528
+		if ( false === GVCommon::has_cap( 'gravityforms_create_form' ) && empty( $statii[ 'form_id' ] ) ) {
529 529
 			gravityview()->log->error( 'Current user does not have the capability to create a new Form.', array( 'data' => wp_get_current_user() ) );
530 530
 			return;
531 531
 		}
532 532
 
533 533
 		// Was this a start fresh?
534
-		if ( ! empty( $_POST['gravityview_form_id_start_fresh'] ) ) {
535
-			$statii['start_fresh'] = add_post_meta( $post_id, '_gravityview_start_fresh', 1 );
534
+		if ( ! empty( $_POST[ 'gravityview_form_id_start_fresh' ] ) ) {
535
+			$statii[ 'start_fresh' ] = add_post_meta( $post_id, '_gravityview_start_fresh', 1 );
536 536
 		} else {
537
-			$statii['start_fresh'] = delete_post_meta( $post_id, '_gravityview_start_fresh' );
537
+			$statii[ 'start_fresh' ] = delete_post_meta( $post_id, '_gravityview_start_fresh' );
538 538
 		}
539 539
 
540 540
 		// Check if we have a template id
541
-		if ( isset( $_POST['gravityview_select_template_nonce'] ) && wp_verify_nonce( $_POST['gravityview_select_template_nonce'], 'gravityview_select_template' ) ) {
541
+		if ( isset( $_POST[ 'gravityview_select_template_nonce' ] ) && wp_verify_nonce( $_POST[ 'gravityview_select_template_nonce' ], 'gravityview_select_template' ) ) {
542 542
 
543
-			$template_id = !empty( $_POST['gravityview_directory_template'] ) ? $_POST['gravityview_directory_template'] : '';
543
+			$template_id = ! empty( $_POST[ 'gravityview_directory_template' ] ) ? $_POST[ 'gravityview_directory_template' ] : '';
544 544
 
545 545
 			// now save template id
546
-			$statii['directory_template'] = update_post_meta( $post_id, '_gravityview_directory_template', $template_id );
546
+			$statii[ 'directory_template' ] = update_post_meta( $post_id, '_gravityview_directory_template', $template_id );
547 547
 		}
548 548
 
549 549
 
550 550
 		// save View Configuration metabox
551
-		if ( isset( $_POST['gravityview_view_configuration_nonce'] ) && wp_verify_nonce( $_POST['gravityview_view_configuration_nonce'], 'gravityview_view_configuration' ) ) {
551
+		if ( isset( $_POST[ 'gravityview_view_configuration_nonce' ] ) && wp_verify_nonce( $_POST[ 'gravityview_view_configuration_nonce' ], 'gravityview_view_configuration' ) ) {
552 552
 
553 553
 			// template settings
554
-			if( empty( $_POST['template_settings'] ) ) {
555
-				$_POST['template_settings'] = array();
554
+			if ( empty( $_POST[ 'template_settings' ] ) ) {
555
+				$_POST[ 'template_settings' ] = array();
556 556
 			}
557
-			$statii['template_settings'] = update_post_meta( $post_id, '_gravityview_template_settings', $_POST['template_settings'] );
557
+			$statii[ 'template_settings' ] = update_post_meta( $post_id, '_gravityview_template_settings', $_POST[ 'template_settings' ] );
558 558
 
559 559
 			// guard against unloaded View configuration page
560
-			if ( isset( $_POST['gv_fields'] ) && isset( $_POST['gv_fields_done'] ) ) {
560
+			if ( isset( $_POST[ 'gv_fields' ] ) && isset( $_POST[ 'gv_fields_done' ] ) ) {
561 561
 				$fields = array();
562 562
 
563
-				if ( ! empty( $_POST['gv_fields'] ) ) {
563
+				if ( ! empty( $_POST[ 'gv_fields' ] ) ) {
564 564
 					$fields = _gravityview_process_posted_fields();
565 565
 				}
566 566
 
567 567
 				$fields = wp_slash( $fields );
568 568
 
569
-				$statii['directory_fields'] = update_post_meta( $post_id, '_gravityview_directory_fields', $fields );
569
+				$statii[ 'directory_fields' ] = update_post_meta( $post_id, '_gravityview_directory_fields', $fields );
570 570
 			}
571 571
 
572 572
 			// Directory Visible Widgets
573
-			if( empty( $_POST['widgets'] ) ) {
574
-				$_POST['widgets'] = array();
573
+			if ( empty( $_POST[ 'widgets' ] ) ) {
574
+				$_POST[ 'widgets' ] = array();
575 575
 			}
576
-			$statii['directory_widgets'] = gravityview_set_directory_widgets( $post_id, $_POST['widgets'] );
576
+			$statii[ 'directory_widgets' ] = gravityview_set_directory_widgets( $post_id, $_POST[ 'widgets' ] );
577 577
 
578 578
 		} // end save view configuration
579 579
 
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 		 * @param array $statii Array of statuses of the post meta saving processes. If saving worked, each key should be mapped to a value of the post ID (`directory_widgets` => `124`). If failed (or didn't change), the value will be false.
584 584
 		 * @since 1.17.2
585 585
 		 */
586
-		do_action('gravityview_view_saved', $post_id, $statii );
586
+		do_action( 'gravityview_view_saved', $post_id, $statii );
587 587
 
588 588
 		gravityview()->log->debug( '[save_postdata] Update Post Meta Statuses (also returns false if nothing changed)', array( 'data' => array_map( 'intval', $statii ) ) );
589 589
 	}
@@ -627,20 +627,20 @@  discard block
 block discarded – undo
627 627
 
628 628
 		$output = '';
629 629
 
630
-		if( !empty( $fields ) ) {
630
+		if ( ! empty( $fields ) ) {
631 631
 
632
-			foreach( $fields as $id => $details ) {
632
+			foreach ( $fields as $id => $details ) {
633 633
 
634
-				if( in_array( $details['type'], (array) $blacklist_field_types ) ) {
634
+				if ( in_array( $details[ 'type' ], (array)$blacklist_field_types ) ) {
635 635
 					continue;
636 636
 				}
637 637
 
638 638
 				// Edit mode only allows editing the parent fields, not single inputs.
639
-				if( $context === 'edit' && !empty( $details['parent'] ) ) {
639
+				if ( $context === 'edit' && ! empty( $details[ 'parent' ] ) ) {
640 640
 					continue;
641 641
 				}
642 642
 
643
-				$output .= new GravityView_Admin_View_Field( $details['label'], $id, $details, $settings = array(), $form );
643
+				$output .= new GravityView_Admin_View_Field( $details[ 'label' ], $id, $details, $settings = array(), $form );
644 644
 
645 645
 			} // End foreach
646 646
 		}
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 		echo $output;
649 649
 
650 650
 		// For the EDIT view we only want to allow the form fields.
651
-		if( $context === 'edit' ) {
651
+		if ( $context === 'edit' ) {
652 652
 			return;
653 653
 		}
654 654
 
@@ -672,16 +672,16 @@  discard block
 block discarded – undo
672 672
 		$additional_fields = apply_filters( 'gravityview_additional_fields', array(
673 673
 			array(
674 674
 				'label_text' => __( '+ Add All Fields', 'gravityview' ),
675
-				'desc' => __('Add all the available fields at once.', 'gravityview'),
675
+				'desc' => __( 'Add all the available fields at once.', 'gravityview' ),
676 676
 				'field_id' => 'all-fields',
677 677
 				'label_type' => 'field',
678 678
 				'input_type' => NULL,
679 679
 				'field_options' => NULL,
680 680
 				'settings_html'	=> NULL,
681 681
 			)
682
-		));
682
+		) );
683 683
 
684
-		if( !empty( $additional_fields )) {
684
+		if ( ! empty( $additional_fields ) ) {
685 685
 			foreach ( (array)$additional_fields as $item ) {
686 686
 
687 687
 				// Prevent items from not having index set
@@ -692,16 +692,16 @@  discard block
 block discarded – undo
692 692
 					'input_type' => NULL,
693 693
 					'field_options' => NULL,
694 694
 					'settings_html'	=> NULL,
695
-				));
695
+				) );
696 696
 
697 697
 				// Backward compat.
698
-				if( !empty( $item['field_options'] ) ) {
698
+				if ( ! empty( $item[ 'field_options' ] ) ) {
699 699
 					// Use settings_html from now on.
700
-					$item['settings_html'] = $item['field_options'];
700
+					$item[ 'settings_html' ] = $item[ 'field_options' ];
701 701
 				}
702 702
 
703 703
 				// Render a label for each of them
704
-				echo new GravityView_Admin_View_Field( $item['label_text'], $item['field_id'], $item, $settings = array(), $form );
704
+				echo new GravityView_Admin_View_Field( $item[ 'label_text' ], $item[ 'field_id' ], $item, $settings = array(), $form );
705 705
 
706 706
 			}
707 707
 		}
@@ -714,54 +714,54 @@  discard block
 block discarded – undo
714 714
 	 * @param  string $zone   Either 'single', 'directory', 'header', 'footer'
715 715
 	 * @return array
716 716
 	 */
717
-	function get_entry_default_fields($form, $zone) {
717
+	function get_entry_default_fields( $form, $zone ) {
718 718
 
719 719
 		$entry_default_fields = array();
720 720
 
721
-		if( in_array( $zone, array( 'directory', 'single' ) ) ) {
721
+		if ( in_array( $zone, array( 'directory', 'single' ) ) ) {
722 722
 
723 723
 			$entry_default_fields = array(
724 724
 				'id' => array(
725
-					'label' => __('Entry ID', 'gravityview'),
725
+					'label' => __( 'Entry ID', 'gravityview' ),
726 726
 					'type' => 'id',
727
-					'desc'	=> __('The unique ID of the entry.', 'gravityview'),
727
+					'desc'	=> __( 'The unique ID of the entry.', 'gravityview' ),
728 728
 				),
729 729
 				'date_created' => array(
730
-					'label' => __('Entry Date', 'gravityview'),
731
-					'desc'	=> __('The date the entry was created.', 'gravityview'),
730
+					'label' => __( 'Entry Date', 'gravityview' ),
731
+					'desc'	=> __( 'The date the entry was created.', 'gravityview' ),
732 732
 					'type' => 'date_created',
733 733
 				),
734 734
 				'source_url' => array(
735
-					'label' => __('Source URL', 'gravityview'),
735
+					'label' => __( 'Source URL', 'gravityview' ),
736 736
 					'type' => 'source_url',
737
-					'desc'	=> __('The URL of the page where the form was submitted.', 'gravityview'),
737
+					'desc'	=> __( 'The URL of the page where the form was submitted.', 'gravityview' ),
738 738
 				),
739 739
 				'ip' => array(
740
-					'label' => __('User IP', 'gravityview'),
740
+					'label' => __( 'User IP', 'gravityview' ),
741 741
 					'type' => 'ip',
742
-					'desc'	=> __('The IP Address of the user who created the entry.', 'gravityview'),
742
+					'desc'	=> __( 'The IP Address of the user who created the entry.', 'gravityview' ),
743 743
 				),
744 744
 				'created_by' => array(
745
-					'label' => __('User', 'gravityview'),
745
+					'label' => __( 'User', 'gravityview' ),
746 746
 					'type' => 'created_by',
747
-					'desc'	=> __('Details of the logged-in user who created the entry (if any).', 'gravityview'),
747
+					'desc'	=> __( 'Details of the logged-in user who created the entry (if any).', 'gravityview' ),
748 748
 				),
749 749
 
750 750
 				/**
751 751
 				 * @since 1.7.2
752 752
 				 */
753 753
 			    'other_entries' => array(
754
-				    'label'	=> __('Other Entries', 'gravityview'),
754
+				    'label'	=> __( 'Other Entries', 'gravityview' ),
755 755
 				    'type'	=> 'other_entries',
756
-				    'desc'	=> __('Display other entries created by the entry creator.', 'gravityview'),
756
+				    'desc'	=> __( 'Display other entries created by the entry creator.', 'gravityview' ),
757 757
 			    ),
758 758
 	        );
759 759
 
760
-			if( 'single' !== $zone) {
760
+			if ( 'single' !== $zone ) {
761 761
 
762
-				$entry_default_fields['entry_link'] = array(
763
-					'label' => __('Link to Entry', 'gravityview'),
764
-					'desc'	=> __('A dedicated link to the single entry with customizable text.', 'gravityview'),
762
+				$entry_default_fields[ 'entry_link' ] = array(
763
+					'label' => __( 'Link to Entry', 'gravityview' ),
764
+					'desc'	=> __( 'A dedicated link to the single entry with customizable text.', 'gravityview' ),
765 765
 					'type' => 'entry_link',
766 766
 				);
767 767
 			}
@@ -771,19 +771,19 @@  discard block
 block discarded – undo
771 771
 		/**
772 772
 		 * @since  1.2
773 773
 		 */
774
-		$entry_default_fields['custom']	= array(
775
-			'label'	=> __('Custom Content', 'gravityview'),
774
+		$entry_default_fields[ 'custom' ] = array(
775
+			'label'	=> __( 'Custom Content', 'gravityview' ),
776 776
 			'type'	=> 'custom',
777
-			'desc'	=> __('Insert custom text or HTML.', 'gravityview'),
777
+			'desc'	=> __( 'Insert custom text or HTML.', 'gravityview' ),
778 778
 		);
779 779
 
780 780
 		/**
781 781
 		 * @since develop
782 782
 		 */
783
-		$entry_default_fields['sequence'] = array(
784
-			'label'	=> __('Result Number', 'gravityview'),
783
+		$entry_default_fields[ 'sequence' ] = array(
784
+			'label'	=> __( 'Result Number', 'gravityview' ),
785 785
 			'type'	=> 'sequence',
786
-			'desc'	=> __('Display a sequential result number for each entry.', 'gravityview'),
786
+			'desc'	=> __( 'Display a sequential result number for each entry.', 'gravityview' ),
787 787
 		);
788 788
 
789 789
 		/**
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 		 * @param  string|array $form form_ID or form object
793 793
 		 * @param  string $zone   Either 'single', 'directory', 'header', 'footer'
794 794
 		 */
795
-		return apply_filters( 'gravityview_entry_default_fields', $entry_default_fields, $form, $zone);
795
+		return apply_filters( 'gravityview_entry_default_fields', $entry_default_fields, $form, $zone );
796 796
 	}
797 797
 
798 798
 	/**
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
 	 */
804 804
 	function get_available_fields( $form = '', $zone = NULL ) {
805 805
 
806
-		if( empty( $form ) ) {
806
+		if ( empty( $form ) ) {
807 807
 			gravityview()->log->error( '$form is empty' );
808 808
 			return array();
809 809
 		}
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
 		$fields = gravityview_get_form_fields( $form, true );
813 813
 
814 814
 		// get meta fields ( only if form was already created )
815
-		if( !is_array( $form ) ) {
815
+		if ( ! is_array( $form ) ) {
816 816
 			$meta_fields = gravityview_get_entry_meta( $form );
817 817
 		} else {
818 818
 			$meta_fields = array();
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
 		$fields = $fields + $meta_fields + $default_fields;
826 826
 
827 827
 		// Move Custom Content to top
828
-		$fields = array( 'custom' => $fields['custom'] ) + $fields;
828
+		$fields = array( 'custom' => $fields[ 'custom' ] ) + $fields;
829 829
 
830 830
 		/**
831 831
 		 * @filter `gravityview/admin/available_fields` Modify the available fields that can be used in a View.
@@ -845,11 +845,11 @@  discard block
 block discarded – undo
845 845
 
846 846
 		$widgets = $this->get_registered_widgets();
847 847
 
848
-		if( !empty( $widgets ) ) {
848
+		if ( ! empty( $widgets ) ) {
849 849
 
850
-			foreach( $widgets as $id => $details ) {
850
+			foreach ( $widgets as $id => $details ) {
851 851
 
852
-				echo new GravityView_Admin_View_Widget( $details['label'], $id, $details );
852
+				echo new GravityView_Admin_View_Widget( $details[ 'label' ], $id, $details );
853 853
 
854 854
 			}
855 855
 		}
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 	function render_active_areas( $template_id, $type, $zone, $rows, $values ) {
879 879
 		global $post;
880 880
 
881
-		if( $type === 'widget' ) {
881
+		if ( $type === 'widget' ) {
882 882
 			$button_label = __( 'Add Widget', 'gravityview' );
883 883
 		} else {
884 884
 			$button_label = __( 'Add Field', 'gravityview' );
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 		$form_id = null;
891 891
 
892 892
 		// if saved values, get available fields to label everyone
893
-		if( !empty( $values ) && ( !empty( $post->ID ) || !empty( $_POST['template_id'] ) ) ) {
893
+		if ( ! empty( $values ) && ( ! empty( $post->ID ) || ! empty( $_POST[ 'template_id' ] ) ) ) {
894 894
 
895 895
 			$form_id = $form = gravityview_get_form_id( $post->ID );
896 896
 
@@ -907,44 +907,44 @@  discard block
 block discarded – undo
907 907
 			}
908 908
 		}
909 909
 
910
-		foreach( $rows as $row ) :
911
-			foreach( $row as $col => $areas ) :
912
-				$column = ($col == '2-2') ? '1-2' : $col; ?>
910
+		foreach ( $rows as $row ) :
911
+			foreach ( $row as $col => $areas ) :
912
+				$column = ( $col == '2-2' ) ? '1-2' : $col; ?>
913 913
 
914 914
 				<div class="gv-grid-col-<?php echo esc_attr( $column ); ?>">
915 915
 
916
-					<?php foreach( $areas as $area ) : 	?>
916
+					<?php foreach ( $areas as $area ) : 	?>
917 917
 
918
-						<div class="gv-droppable-area" data-areaid="<?php echo esc_attr( $zone .'_'. $area['areaid'] ); ?>" data-context="<?php echo esc_attr( $zone ); ?>">
919
-							<div class="active-drop active-drop-<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone .'_'. $area['areaid'] ); ?>">
918
+						<div class="gv-droppable-area" data-areaid="<?php echo esc_attr( $zone . '_' . $area[ 'areaid' ] ); ?>" data-context="<?php echo esc_attr( $zone ); ?>">
919
+							<div class="active-drop active-drop-<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone . '_' . $area[ 'areaid' ] ); ?>">
920 920
 
921 921
 								<?php // render saved fields
922 922
 
923
-								if( ! empty( $values[ $zone .'_'. $area['areaid'] ] ) ) {
923
+								if ( ! empty( $values[ $zone . '_' . $area[ 'areaid' ] ] ) ) {
924 924
 
925
-									foreach( $values[ $zone .'_'. $area['areaid'] ] as $uniqid => $field ) {
925
+									foreach ( $values[ $zone . '_' . $area[ 'areaid' ] ] as $uniqid => $field ) {
926 926
 
927 927
 										// Maybe has a form ID
928
-										$form_id = empty( $field['form_id'] ) ? $form_id : $field['form_id'];
928
+										$form_id = empty( $field[ 'form_id' ] ) ? $form_id : $field[ 'form_id' ];
929 929
 
930 930
 										$input_type = NULL;
931 931
 
932 932
 										if ( $form_id ) {
933
-											$original_item = isset( $available_items[ $form_id ] [ $field['id'] ] ) ? $available_items[ $form_id ] [ $field['id'] ] : false ;
933
+											$original_item = isset( $available_items[ $form_id ] [ $field[ 'id' ] ] ) ? $available_items[ $form_id ] [ $field[ 'id' ] ] : false;
934 934
                                         } else {
935
-											$original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ;
935
+											$original_item = isset( $available_items[ $field[ 'id' ] ] ) ? $available_items[ $field[ 'id' ] ] : false;
936 936
                                         }
937 937
 
938
-										if ( !$original_item ) {
939
-											gravityview()->log->error( 'An item was not available when rendering the output; maybe it was added by a plugin that is now de-activated.', array(' data' => array('available_items' => $available_items, 'field' => $field ) ) );
938
+										if ( ! $original_item ) {
939
+											gravityview()->log->error( 'An item was not available when rendering the output; maybe it was added by a plugin that is now de-activated.', array( ' data' => array( 'available_items' => $available_items, 'field' => $field ) ) );
940 940
 
941 941
 											$original_item = $field;
942 942
 										} else {
943
-											$input_type = isset( $original_item['type'] ) ? $original_item['type'] : NULL;
943
+											$input_type = isset( $original_item[ 'type' ] ) ? $original_item[ 'type' ] : NULL;
944 944
 										}
945 945
 
946 946
 										// Field options dialog box
947
-										$field_options = GravityView_Render_Settings::render_field_options( $form_id, $type, $template_id, $field['id'], $original_item['label'], $zone .'_'. $area['areaid'], $input_type, $uniqid, $field, $zone, $original_item );
947
+										$field_options = GravityView_Render_Settings::render_field_options( $form_id, $type, $template_id, $field[ 'id' ], $original_item[ 'label' ], $zone . '_' . $area[ 'areaid' ], $input_type, $uniqid, $field, $zone, $original_item );
948 948
 
949 949
 										$item = array(
950 950
 											'input_type' => $input_type,
@@ -957,23 +957,23 @@  discard block
 block discarded – undo
957 957
 											$item = wp_parse_args( $item, $original_item );
958 958
 										}
959 959
 
960
-										switch( $type ) {
960
+										switch ( $type ) {
961 961
 											case 'widget':
962
-												echo new GravityView_Admin_View_Widget( $item['label'], $field['id'], $item, $field );
962
+												echo new GravityView_Admin_View_Widget( $item[ 'label' ], $field[ 'id' ], $item, $field );
963 963
 												break;
964 964
 											default:
965
-												echo new GravityView_Admin_View_Field( $field['label'], $field['id'], $item, $field, $form_id );
965
+												echo new GravityView_Admin_View_Field( $field[ 'label' ], $field[ 'id' ], $item, $field, $form_id );
966 966
 										}
967 967
 									}
968 968
 
969 969
 								} // End if zone is not empty ?>
970 970
 
971
-								<span class="drop-message"><?php echo sprintf(esc_attr__('"+ %s" or drag existing %ss here.', 'gravityview'), $button_label, $type ); ?></span>
971
+								<span class="drop-message"><?php echo sprintf( esc_attr__( '"+ %s" or drag existing %ss here.', 'gravityview' ), $button_label, $type ); ?></span>
972 972
 							</div>
973 973
 							<div class="gv-droppable-area-action">
974
-								<a href="#" class="gv-add-field button-secondary" title="" data-objecttype="<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone .'_'. $area['areaid'] ); ?>" data-context="<?php echo esc_attr( $zone ); ?>" data-formid="<?php echo $view ? esc_attr( $view->form ? $view->form->ID : '' ) : ''; ?>"><?php echo '+ '.esc_html( $button_label ); ?></a>
974
+								<a href="#" class="gv-add-field button-secondary" title="" data-objecttype="<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone . '_' . $area[ 'areaid' ] ); ?>" data-context="<?php echo esc_attr( $zone ); ?>" data-formid="<?php echo $view ? esc_attr( $view->form ? $view->form->ID : '' ) : ''; ?>"><?php echo '+ ' . esc_html( $button_label ); ?></a>
975 975
 
976
-								<p class="gv-droppable-area-title"><strong><?php echo esc_html( $area['title'] ); ?></strong><?php if( !empty( $area['subtitle'] ) ) { ?><span class="gv-droppable-area-subtitle"> &ndash; <?php echo esc_html( $area['subtitle'] ); ?></span><?php } ?></p>
976
+								<p class="gv-droppable-area-title"><strong><?php echo esc_html( $area[ 'title' ] ); ?></strong><?php if ( ! empty( $area[ 'subtitle' ] ) ) { ?><span class="gv-droppable-area-subtitle"> &ndash; <?php echo esc_html( $area[ 'subtitle' ] ); ?></span><?php } ?></p>
977 977
 							</div>
978 978
 						</div>
979 979
 
@@ -1001,7 +1001,7 @@  discard block
 block discarded – undo
1001 1001
 				// This is a new View, prefill the widgets
1002 1002
 				$widgets = array(
1003 1003
 					'header_top' => array(
1004
-						substr( md5( microtime( true ) ), 0, 13 ) => array (
1004
+						substr( md5( microtime( true ) ), 0, 13 ) => array(
1005 1005
 							'id' => 'search_bar',
1006 1006
 							'label' => __( 'Search Bar', 'gravityview' ),
1007 1007
 							'search_layout' => 'horizontal',
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
 		// list of available fields to be shown in the popup
1074 1074
 		$forms = gravityview_get_forms( 'any' );
1075 1075
 
1076
-		$form_ids = array_map( function ($form) { return $form['id']; }, $forms);
1076
+		$form_ids = array_map( function( $form ) { return $form[ 'id' ]; }, $forms );
1077 1077
 
1078 1078
 		foreach ( $form_ids as $form_id ) {
1079 1079
 			$filter_field_id = sprintf( 'gv-field-filter-%s-%d', $context, $form_id );
@@ -1086,7 +1086,7 @@  discard block
 block discarded – undo
1086 1086
                 </div>
1087 1087
 
1088 1088
                 <div id="available-fields-<?php echo $filter_field_id; ?>" aria-live="polite" role="listbox">
1089
-                <?php do_action('gravityview_render_available_fields', $form_id, $context ); ?>
1089
+                <?php do_action( 'gravityview_render_available_fields', $form_id, $context ); ?>
1090 1090
                 </div>
1091 1091
 
1092 1092
                 <div class="gv-no-results hidden description"><?php esc_html_e( 'No fields were found matching the search.', 'gravityview' ); ?></div>
@@ -1105,7 +1105,7 @@  discard block
 block discarded – undo
1105 1105
 	 * @return string HTML of the active areas
1106 1106
 	 */
1107 1107
 	function render_directory_active_areas( $template_id = '', $context = 'single', $post_id = '', $echo = false ) {
1108
-		if( empty( $template_id ) ) {
1108
+		if ( empty( $template_id ) ) {
1109 1109
 			gravityview()->log->debug( '[render_directory_active_areas] {template_id} is empty', array( 'template_id' => $template_id ) );
1110 1110
 			return '';
1111 1111
 		}
@@ -1119,12 +1119,12 @@  discard block
 block discarded – undo
1119 1119
 		 */
1120 1120
 		$template_areas = apply_filters( 'gravityview_template_active_areas', array(), $template_id, $context );
1121 1121
 
1122
-		if( empty( $template_areas ) ) {
1122
+		if ( empty( $template_areas ) ) {
1123 1123
 
1124 1124
 			gravityview()->log->debug( '[render_directory_active_areas] No areas defined. Maybe template {template_id} is disabled.', array( 'data' => $template_id ) );
1125 1125
 			$output = '<div>';
1126
-			$output .= '<h2 class="description" style="font-size: 16px; margin:0">'. sprintf( esc_html__( 'This View is configured using the %s View type, which is disabled.', 'gravityview' ), '<em>'.$template_id.'</em>' ) .'</h2>';
1127
-			$output .= '<p class="description" style="font-size: 14px; margin:0 0 1em 0;padding:0">'.esc_html__('The data is not lost; re-activate the associated plugin and the configuration will re-appear.', 'gravityview').'</p>';
1126
+			$output .= '<h2 class="description" style="font-size: 16px; margin:0">' . sprintf( esc_html__( 'This View is configured using the %s View type, which is disabled.', 'gravityview' ), '<em>' . $template_id . '</em>' ) . '</h2>';
1127
+			$output .= '<p class="description" style="font-size: 14px; margin:0 0 1em 0;padding:0">' . esc_html__( 'The data is not lost; re-activate the associated plugin and the configuration will re-appear.', 'gravityview' ) . '</p>';
1128 1128
 			$output .= '</div>';
1129 1129
 		} else {
1130 1130
 
@@ -1139,7 +1139,7 @@  discard block
 block discarded – undo
1139 1139
 
1140 1140
 		}
1141 1141
 
1142
-		if( $echo ) {
1142
+		if ( $echo ) {
1143 1143
 			echo $output;
1144 1144
 		}
1145 1145
 
@@ -1159,32 +1159,32 @@  discard block
 block discarded – undo
1159 1159
 		$is_widgets_page = ( $pagenow === 'widgets.php' );
1160 1160
 
1161 1161
 		// Add the GV font (with the Astronaut)
1162
-        wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version );
1162
+        wp_enqueue_style( 'gravityview_global', plugins_url( 'assets/css/admin-global.css', GRAVITYVIEW_FILE ), array(), \GV\Plugin::$version );
1163 1163
 		wp_register_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array( 'dashicons', 'wp-jquery-ui-dialog' ), \GV\Plugin::$version );
1164 1164
 
1165
-		wp_register_script( 'gravityview-jquery-cookie', plugins_url('assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE), array( 'jquery' ), \GV\Plugin::$version, true );
1165
+		wp_register_script( 'gravityview-jquery-cookie', plugins_url( 'assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE ), array( 'jquery' ), \GV\Plugin::$version, true );
1166 1166
 
1167
-		if( GFForms::get_page() === 'form_list' ) {
1167
+		if ( GFForms::get_page() === 'form_list' ) {
1168 1168
 			wp_enqueue_style( 'gravityview_views_styles' );
1169 1169
 			return;
1170 1170
         }
1171 1171
 
1172 1172
 		// Don't process any scripts below here if it's not a GravityView page.
1173
-		if( ! gravityview()->request->is_admin( $hook, 'single' ) && ! $is_widgets_page ) {
1173
+		if ( ! gravityview()->request->is_admin( $hook, 'single' ) && ! $is_widgets_page ) {
1174 1174
 		    return;
1175 1175
 		}
1176 1176
 
1177 1177
         wp_enqueue_script( 'jquery-ui-datepicker' );
1178
-        wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version );
1178
+        wp_enqueue_style( 'gravityview_views_datepicker', plugins_url( 'assets/css/admin-datepicker.css', GRAVITYVIEW_FILE ), \GV\Plugin::$version );
1179 1179
 
1180
-        $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
1180
+        $script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
1181 1181
 
1182 1182
         //enqueue scripts
1183 1183
         wp_enqueue_script( 'gravityview_views_scripts', plugins_url( 'assets/js/admin-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery-ui-tabs', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-ui-tooltip', 'jquery-ui-dialog', 'gravityview-jquery-cookie', 'jquery-ui-datepicker', 'underscore' ), \GV\Plugin::$version );
1184 1184
 
1185
-        wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1185
+        wp_localize_script( 'gravityview_views_scripts', 'gvGlobals', array(
1186 1186
             'cookiepath' => COOKIEPATH,
1187
-            'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ),
1187
+            'passed_form_id' => (bool)\GV\Utils::_GET( 'form_id' ),
1188 1188
             'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1189 1189
             'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1190 1190
             'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ),
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
             'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1200 1200
             'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1201 1201
             'remove_all_fields' => __( 'Would you like to remove all fields in this zone? (You are seeing this message because you were holding down the ALT key)', 'gravityview' ),
1202
-        ));
1202
+        ) );
1203 1203
 
1204 1204
 		wp_enqueue_style( 'gravityview_views_styles' );
1205 1205
 
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 		);
1227 1227
 
1228 1228
 		if ( wp_is_mobile() ) {
1229
-		    $scripts[] = 'jquery-touch-punch';
1229
+		    $scripts[ ] = 'jquery-touch-punch';
1230 1230
 		}
1231 1231
 
1232 1232
 		wp_enqueue_script( $scripts );
Please login to merge, or discard this patch.