Completed
Pull Request — develop (#1573)
by Zack
20:26
created
includes/admin/field-types/type_hidden.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 			return;
16 16
 		}
17 17
 
18
-        $class = !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
18
+		$class = !empty( $this->field['class'] ) ? $this->field['class'] : 'widefat';
19 19
 
20 20
 		?>
21 21
 		<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="hidden" value="<?php echo esc_attr( $this->value ); ?>" class="<?php echo esc_attr( $class ); ?>" />
Please login to merge, or discard this patch.
includes/class-admin-welcome.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly
15
-if ( ! defined( 'ABSPATH' ) ) exit;
15
+if ( ! defined( 'ABSPATH' ) ) {
16
+	exit;
17
+}
16 18
 
17 19
 /**
18 20
  * GravityView_Welcome Class
Please login to merge, or discard this patch.
includes/class-gravityview-image.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 	var $style = NULL;
24 24
 
25 25
 	/**
26
- 	 * String representing size of image - Choose from "full", "medium", "thumb", "tiny"
26
+	 * String representing size of image - Choose from "full", "medium", "thumb", "tiny"
27 27
 	 * @var string
28 28
 	 */
29 29
 	var $size = NULL;
Please login to merge, or discard this patch.
includes/class-gravityview-migrate.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -180,8 +180,8 @@
 block discarded – undo
180 180
 
181 181
 					// check widget settings:
182 182
 					//  [search_free] => 1
183
-			        //  [search_date] => 1
184
-			        $search_generic = array();
183
+					//  [search_date] => 1
184
+					$search_generic = array();
185 185
 					if( !empty( $widget['search_free'] ) ) {
186 186
 						$search_generic[] = array( 'field' => 'search_all', 'input' => 'input_text' );
187 187
 					}
Please login to merge, or discard this patch.
includes/class-gravityview-roles-capabilities.php 1 patch
Indentation   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 		add_filter( 'members_get_capabilities', array( 'GravityView_Roles_Capabilities', 'merge_with_all_caps' ) );
57 57
 		add_action( 'members_register_cap_groups', array( $this, 'members_register_cap_group' ), 20 );
58 58
 		add_filter( 'user_has_cap', array( $this, 'filter_user_has_cap' ), 10, 4 );
59
-        add_action( 'admin_init', array( $this, 'add_caps') );
59
+		add_action( 'admin_init', array( $this, 'add_caps') );
60 60
 	}
61 61
 
62 62
 
@@ -360,7 +360,6 @@  discard block
 block discarded – undo
360 360
 	 * Add Gravity Forms and GravityView's "full access" caps when any other caps are checked against.
361 361
 	 *
362 362
 	 * @since 1.15
363
-
364 363
 	 * @param array $caps_to_check
365 364
 	 *
366 365
 	 * @return array
Please login to merge, or discard this patch.
includes/helper-functions.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -307,7 +307,7 @@
 block discarded – undo
307 307
 		! isset( $value ) // If it's not set, it's empty!
308 308
 		|| false === $value
309 309
 		|| null === $value
310
-	    || '' === $value // Empty string
310
+		|| '' === $value // Empty string
311 311
 		|| array() === $value // Empty array
312 312
 		|| ( is_object( $value ) && ! get_object_vars( $value ) ) // Empty object
313 313
 	) {
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-time.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -255,7 +255,6 @@
 block discarded – undo
255 255
 	 * Get the default date format for a field based on the field ID and the time format setting
256 256
 	 *
257 257
 	 * @since 1.14
258
-
259 258
 	 * @param string $time_format The time format ("12" or "24"). Default: "12" {@since 1.14}
260 259
 	 * @param int $field_id The ID of the field. Used to figure out full time/hours/minutes/am/pm {@since 1.14}
261 260
 	 *
Please login to merge, or discard this patch.
includes/class-admin-views.php 2 patches
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 	 *
271 271
 	 * @return void
272 272
 	 */
273
-	public function add_custom_column_content( $column_name = NULL, $post_id )	{
273
+	public function add_custom_column_content( $column_name = NULL, $post_id ) {
274 274
 
275 275
 		$output = '';
276 276
 
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 	 */
430 430
 	function save_postdata( $post_id ) {
431 431
 
432
-		if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ){
432
+		if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
433 433
 			return;
434 434
 		}
435 435
 
Please login to merge, or discard this patch.
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 		// Enqueue code editor and settings for manipulating HTML.
47 47
 		add_action('admin_enqueue_scripts', function() {
48 48
 
49
-		    $settings = wp_enqueue_code_editor( array( 'type' => 'text/html' ) );
49
+			$settings = wp_enqueue_code_editor( array( 'type' => 'text/html' ) );
50 50
 		});
51 51
 
52 52
 		// @todo check if this hook is needed..
@@ -68,28 +68,28 @@  discard block
 block discarded – undo
68 68
 	}
69 69
 
70 70
 	/**
71
-     * When on the Add/Edit View screen, suggest most popular articles related to that
72
-     *
71
+	 * When on the Add/Edit View screen, suggest most popular articles related to that
72
+	 *
73 73
 	 * @param array $localization_data Data to be passed to the Support Port JS
74 74
 	 *
75 75
 	 * @return array
76 76
 	 */
77 77
 	function suggest_support_articles( $localization_data = array() ) {
78 78
 
79
-	    if( ! gravityview()->request->is_view() ) {
80
-	        return $localization_data;
81
-        }
79
+		if( ! gravityview()->request->is_view() ) {
80
+			return $localization_data;
81
+		}
82 82
 
83 83
 		$localization_data['suggest'] = array(
84
-            '57ef23539033602e61d4a560',
85
-            '54c67bb9e4b0512429885513',
86
-            '54c67bb9e4b0512429885512',
87
-            '54c67bbbe4b07997ea3f3f6b',
88
-            '54d1a33ae4b086c0c0964ce9',
89
-            '57ef253c9033602e61d4a563',
90
-            '552355bfe4b0221aadf2572b',
91
-            '54c67bcde4b051242988553e',
92
-        );
84
+			'57ef23539033602e61d4a560',
85
+			'54c67bb9e4b0512429885513',
86
+			'54c67bb9e4b0512429885512',
87
+			'54c67bbbe4b07997ea3f3f6b',
88
+			'54d1a33ae4b086c0c0964ce9',
89
+			'57ef253c9033602e61d4a563',
90
+			'552355bfe4b0221aadf2572b',
91
+			'54c67bcde4b051242988553e',
92
+		);
93 93
 
94 94
 		return $localization_data;
95 95
 	}
@@ -235,11 +235,11 @@  discard block
 block discarded – undo
235 235
 
236 236
 		if( 'form_list' === GFForms::get_page() ) {
237 237
 			$priority = 790;
238
-        }
238
+		}
239 239
 
240 240
 		if( empty( $connected_views ) ) {
241 241
 
242
-		    $menu_items['gravityview'] = array(
242
+			$menu_items['gravityview'] = array(
243 243
 				'label'          => esc_attr__( 'Create a View', 'gravityview' ),
244 244
 				'icon'           => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>', // Only appears in GF pre-2.5
245 245
 				'title'          => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
@@ -271,13 +271,13 @@  discard block
 block discarded – undo
271 271
 		// If there were no items added, then let's create the parent menu
272 272
 		if( $sub_menu_items ) {
273 273
 
274
-		    $sub_menu_items[] = array(
275
-			    'label' => esc_attr__( 'Create a View', 'gravityview' ),
276
-			    'icon' => '<span class="dashicons dashicons-plus"></span>',
277
-			    'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
278
-			    'url'   => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ),
279
-			    'capabilities'   => array( 'edit_gravityviews' ),
280
-            );
274
+			$sub_menu_items[] = array(
275
+				'label' => esc_attr__( 'Create a View', 'gravityview' ),
276
+				'icon' => '<span class="dashicons dashicons-plus"></span>',
277
+				'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
278
+				'url'   => admin_url( 'post-new.php?post_type=gravityview&form_id=' . $id ),
279
+				'capabilities'   => array( 'edit_gravityviews' ),
280
+			);
281 281
 
282 282
 			// Make sure Gravity Forms uses the submenu; if there's only one item, it uses a link instead of a dropdown
283 283
 			$sub_menu_items[] = array(
@@ -659,16 +659,16 @@  discard block
 block discarded – undo
659 659
 	/**
660 660
 	 * Render html for displaying available fields based on a Form ID
661 661
 	 *
662
-     * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action
662
+	 * @see GravityView_Ajax::get_available_fields_html() Triggers `gravityview_render_available_fields` action
663 663
 	 *
664 664
 	 * @param int $form Gravity Forms Form ID (default: '')
665 665
 	 * @param string $context (default: 'single')
666
-     *
666
+	 *
667 667
 	 * @return void
668 668
 	 */
669 669
 	function render_available_fields( $form = 0, $context = 'single' ) {
670 670
 
671
-	    // Determine if form is a preset and convert it to an array with fields
671
+		// Determine if form is a preset and convert it to an array with fields
672 672
 		$form = ( is_string( $form ) && preg_match( '/^preset_/', $form ) ) ? GravityView_Ajax::pre_get_form_fields( $form ) : $form;
673 673
 
674 674
 		/**
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 
681 681
 		if ( ! is_array( $blacklist_field_types ) ) {
682 682
 
683
-		    gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) );
683
+			gravityview()->log->error( '$blacklist_field_types is not an array', array( 'data' => print_r( $blacklist_field_types, true ) ) );
684 684
 
685 685
 			$blacklist_field_types = array();
686 686
 		}
@@ -938,9 +938,9 @@  discard block
 block discarded – undo
938 938
 
939 939
 				$joined_forms = gravityview_get_joined_forms( $post->ID );
940 940
 
941
-                foreach ( $joined_forms as $form ) {
942
-                    $available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone );
943
-                }
941
+				foreach ( $joined_forms as $form ) {
942
+					$available_items[ $form->ID ] = $this->get_available_fields( $form->ID, $zone );
943
+				}
944 944
 			} else {
945 945
 				$available_items[ $form ] = \GV\Widget::registered();
946 946
 			}
@@ -979,9 +979,9 @@  discard block
 block discarded – undo
979 979
 
980 980
 										if ( $form_id ) {
981 981
 											$original_item = isset( $available_items[ $form_id ] [ $field['id'] ] ) ? $available_items[ $form_id ] [ $field['id'] ] : false ;
982
-                                        } else {
982
+										} else {
983 983
 											$original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ;
984
-                                        }
984
+										}
985 985
 
986 986
 										if ( !$original_item ) {
987 987
 											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 ) ) );
@@ -1231,7 +1231,7 @@  discard block
 block discarded – undo
1231 1231
 		}
1232 1232
 
1233 1233
 		// Add the GV font (with the Astronaut)
1234
-        wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version );
1234
+		wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), \GV\Plugin::$version );
1235 1235
 		wp_register_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array( 'dashicons', 'wp-jquery-ui-dialog' ), \GV\Plugin::$version );
1236 1236
 
1237 1237
 		wp_register_script( 'gravityview-jquery-cookie', plugins_url('assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE), array( 'jquery' ), \GV\Plugin::$version, true );
@@ -1239,45 +1239,45 @@  discard block
 block discarded – undo
1239 1239
 		if( GFForms::get_page() === 'form_list' ) {
1240 1240
 			wp_enqueue_style( 'gravityview_views_styles' );
1241 1241
 			return;
1242
-        }
1242
+		}
1243 1243
 
1244 1244
 		// Don't process any scripts below here if it's not a GravityView page.
1245 1245
 		if( ! gravityview()->request->is_admin( $hook, 'single' ) && ! $is_widgets_page ) {
1246
-		    return;
1246
+			return;
1247 1247
 		}
1248 1248
 
1249
-        wp_enqueue_script( 'jquery-ui-datepicker' );
1250
-        wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version );
1251
-
1252
-        // Enqueue scripts
1253
-        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 );
1254
-
1255
-        wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1256
-            'cookiepath' => COOKIEPATH,
1257
-            'admin_cookiepath' => ADMIN_COOKIE_PATH,
1258
-            'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ),
1259
-            'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1260
-            'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1261
-            'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ),
1262
-            'label_add_search_field' => __( 'Add Search Field', 'gravityview' ),
1263
-            'label_remove_search_field' => __( 'Remove Search Field', 'gravityview' ),
1264
-            'label_close' => __( 'Close', 'gravityview' ),
1265
-            'label_cancel' => __( 'Cancel', 'gravityview' ),
1266
-            'label_continue' => __( 'Continue', 'gravityview' ),
1267
-            'label_ok' => __( 'Ok', 'gravityview' ),
1268
-            'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ),
1269
-            'loading_text' => esc_html__( 'Loading&hellip;', 'gravityview' ),
1270
-            'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1271
-            'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1272
-            'remove_all_fields' => __( 'Would you like to remove all fields in this zone?', 'gravityview' ),
1273
-        ));
1249
+		wp_enqueue_script( 'jquery-ui-datepicker' );
1250
+		wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), \GV\Plugin::$version );
1251
+
1252
+		// Enqueue scripts
1253
+		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 );
1254
+
1255
+		wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1256
+			'cookiepath' => COOKIEPATH,
1257
+			'admin_cookiepath' => ADMIN_COOKIE_PATH,
1258
+			'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ),
1259
+			'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1260
+			'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1261
+			'label_reorder_search_fields' => __( 'Reorder Search Fields', 'gravityview' ),
1262
+			'label_add_search_field' => __( 'Add Search Field', 'gravityview' ),
1263
+			'label_remove_search_field' => __( 'Remove Search Field', 'gravityview' ),
1264
+			'label_close' => __( 'Close', 'gravityview' ),
1265
+			'label_cancel' => __( 'Cancel', 'gravityview' ),
1266
+			'label_continue' => __( 'Continue', 'gravityview' ),
1267
+			'label_ok' => __( 'Ok', 'gravityview' ),
1268
+			'label_publisherror' => __( 'Error while creating the View for you. Check the settings or contact GravityView support.', 'gravityview' ),
1269
+			'loading_text' => esc_html__( 'Loading&hellip;', 'gravityview' ),
1270
+			'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1271
+			'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1272
+			'remove_all_fields' => __( 'Would you like to remove all fields in this zone?', 'gravityview' ),
1273
+		));
1274 1274
 
1275 1275
 		wp_enqueue_style( 'gform_admin_icons', GFCommon::get_base_url() . "/css/admin-icons.min.css", array( 'gform_admin_ie11' ) );
1276 1276
 
1277 1277
 		wp_enqueue_style( 'gravityview_views_styles' );
1278 1278
 
1279
-        // Enqueue scripts needed for merge tags
1280
-        self::enqueue_gravity_forms_scripts();
1279
+		// Enqueue scripts needed for merge tags
1280
+		self::enqueue_gravity_forms_scripts();
1281 1281
 
1282 1282
 		// 2.5 changed how Merge Tags are enqueued
1283 1283
 		if ( is_callable( array( 'GFCommon', 'output_hooks_javascript') ) ) {
@@ -1287,24 +1287,24 @@  discard block
 block discarded – undo
1287 1287
 
1288 1288
 	/**
1289 1289
 	 * Enqueue Gravity Forms scripts, needed for Merge Tags
1290
-     *
1291
-     * @since 1.0.5-beta
1292
-     *
1293
-     * @return void
1290
+	 *
1291
+	 * @since 1.0.5-beta
1292
+	 *
1293
+	 * @return void
1294 1294
 	 */
1295 1295
 	static function enqueue_gravity_forms_scripts() {
1296 1296
 		GFForms::register_scripts();
1297 1297
 
1298 1298
 		$scripts = array(
1299
-		    'sack',
1300
-		    'gform_gravityforms',
1301
-		    'gform_forms',
1302
-		    'gform_form_admin',
1303
-		    'jquery-ui-autocomplete'
1299
+			'sack',
1300
+			'gform_gravityforms',
1301
+			'gform_forms',
1302
+			'gform_form_admin',
1303
+			'jquery-ui-autocomplete'
1304 1304
 		);
1305 1305
 
1306 1306
 		if ( wp_is_mobile() ) {
1307
-		    $scripts[] = 'jquery-touch-punch';
1307
+			$scripts[] = 'jquery-touch-punch';
1308 1308
 		}
1309 1309
 
1310 1310
 		wp_enqueue_script( $scripts );
Please login to merge, or discard this patch.
includes/admin/class-gravityview-admin-no-conflict.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
 		// Dequeue other jQuery styles even if no-conflict is off.
118 118
 		// Terrible-looking tabs help no one.
119
-		if( !empty( $wp_styles->registered ) )  {
119
+		if( !empty( $wp_styles->registered ) ) {
120 120
 			foreach ($wp_styles->registered as $key => $style) {
121 121
 				if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) {
122 122
 					wp_dequeue_style( $key );
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
 
190 190
 		//unregistering scripts
191 191
 		$registered = array();
192
-		foreach( $wp_objects->registered as $handle => $script_registration ){
193
-			if( in_array( $handle, $required_objects ) ){
192
+		foreach( $wp_objects->registered as $handle => $script_registration ) {
193
+			if( in_array( $handle, $required_objects ) ) {
194 194
 				$registered[ $handle ] = $script_registration;
195 195
 			}
196 196
 		}
Please login to merge, or discard this patch.