Completed
Push — master ( 8927a4...2ddace )
by Zack
69:27 queued 64:46
created
includes/class-admin.php 2 patches
Indentation   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 			7  => sprintf(__( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
176 176
 			8  => __( 'View submitted.', 'gravityview' ),
177 177
 			9  => sprintf(
178
-		        /* translators: Date and time the View is scheduled to be published */
178
+				/* translators: Date and time the View is scheduled to be published */
179 179
 				__( 'View scheduled for: %1$s.', 'gravityview' ),
180 180
 				// translators: Publish box date format, see http://php.net/date
181 181
 				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL )  ) )
@@ -232,7 +232,6 @@  discard block
 block discarded – undo
232 232
 	 *
233 233
 	 * @deprecated since 1.12
234 234
 	 * @see GravityView_Compatibility::get_plugin_status()
235
-
236 235
 	 * @return boolean|string True: plugin is active; False: plugin file doesn't exist at path; 'inactive' it's inactive
237 236
 	 */
238 237
 	static function get_plugin_status( $location = '' ) {
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@  discard block
 block discarded – undo
4 4
 
5 5
 	function __construct() {
6 6
 
7
-		if( ! is_admin() ) { return; }
7
+		if ( ! is_admin() ) { return; }
8 8
 
9 9
 		// If Gravity Forms isn't active or compatibile, stop loading
10
-		if( false === GravityView_Compatibility::is_valid() ) {
10
+		if ( false === GravityView_Compatibility::is_valid() ) {
11 11
 			return;
12 12
 		}
13 13
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 		require_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-migrate.php' );
26 26
 
27 27
 		// Don't load tooltips if on Gravity Forms, otherwise it overrides translations
28
-		if( class_exists( 'GFCommon' ) && class_exists( 'GFForms' ) && !GFForms::is_gravity_page() ) {
28
+		if ( class_exists( 'GFCommon' ) && class_exists( 'GFForms' ) && ! GFForms::is_gravity_page() ) {
29 29
 			require_once( GFCommon::get_base_path() . '/tooltips.php' );
30 30
 		}
31 31
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
54 54
 		add_filter( 'bulk_post_updated_messages', array( $this, 'post_updated_messages' ) );
55 55
 
56
-		add_filter( 'plugin_action_links_'. plugin_basename( GRAVITYVIEW_FILE ) , array( $this, 'plugin_action_links' ) );
56
+		add_filter( 'plugin_action_links_' . plugin_basename( GRAVITYVIEW_FILE ), array( $this, 'plugin_action_links' ) );
57 57
 
58 58
 		add_action( 'plugins_loaded', array( $this, 'backend_actions' ), 100 );
59 59
 
@@ -68,22 +68,22 @@  discard block
 block discarded – undo
68 68
 	public function backend_actions() {
69 69
 
70 70
 		/** @define "GRAVITYVIEW_DIR" "../" */
71
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class.field.type.php' );
72
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class.render.settings.php' );
73
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-item.php' );
74
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-field.php' );
75
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-widget.php' );
76
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-views.php' );
77
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-welcome.php' );
78
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-add-shortcode.php' );
79
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-approve-entries.php' );
71
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class.field.type.php' );
72
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class.render.settings.php' );
73
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-item.php' );
74
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-field.php' );
75
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-widget.php' );
76
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-views.php' );
77
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-welcome.php' );
78
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-add-shortcode.php' );
79
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-approve-entries.php' );
80 80
 
81 81
 		/**
82 82
 		 * @action `gravityview_include_backend_actions` Triggered after all GravityView admin files are loaded
83 83
 		 *
84 84
 		 * Nice place to insert extensions' backend stuff
85 85
 		 */
86
-		do_action('gravityview_include_backend_actions');
86
+		do_action( 'gravityview_include_backend_actions' );
87 87
 	}
88 88
 
89 89
 	/**
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
 
100 100
 		$actions = array();
101 101
 
102
-		if( GVCommon::has_cap( 'gravityview_view_settings' ) ) {
103
-			$actions[] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) );
102
+		if ( GVCommon::has_cap( 'gravityview_view_settings' ) ) {
103
+			$actions[ ] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) );
104 104
 		}
105 105
 
106
-		if( GVCommon::has_cap( 'gravityview_support_port' ) ) {
107
-			$actions[] = '<a href="http://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>';
106
+		if ( GVCommon::has_cap( 'gravityview_support_port' ) ) {
107
+			$actions[ ] = '<a href="http://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>';
108 108
 		}
109 109
 
110 110
 		return array_merge( $actions, $links );
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 		// By default, there will only be one item being modified.
133 133
 		// When in the `bulk_post_updated_messages` filter, there will be passed a number
134 134
 		// of modified items that will override this array.
135
-		$bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1 , 'locked' => 1 , 'deleted' => 1 , 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts;
135
+		$bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1, 'locked' => 1, 'deleted' => 1, 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts;
136 136
 
137 137
 		// If we're starting fresh, a new form was created.
138 138
 		// We should let the user know this is the case.
@@ -140,60 +140,60 @@  discard block
 block discarded – undo
140 140
 
141 141
 		$new_form_text = '';
142 142
 
143
-		if( !empty( $start_fresh ) ) {
143
+		if ( ! empty( $start_fresh ) ) {
144 144
 
145 145
 			// Get the form that was created
146 146
 			$connected_form = gravityview_get_form_id( $post_id );
147 147
 
148
-			if( !empty( $connected_form ) ) {
148
+			if ( ! empty( $connected_form ) ) {
149 149
 				$form = gravityview_get_form( $connected_form );
150
-				$form_name = esc_attr( $form['title'] );
150
+				$form_name = esc_attr( $form[ 'title' ] );
151 151
 				$image = self::get_floaty();
152
-				$new_form_text .= '<h3>'.$image.sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ).'</h3>';
153
-				$new_form_text .=  sprintf( __( '%sThere are no entries for the new form, so the View will also be empty.%s To start collecting entries, you can add submissions through %sthe preview form%s and also embed the form on a post or page using this code: %s
152
+				$new_form_text .= '<h3>' . $image . sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ) . '</h3>';
153
+				$new_form_text .= sprintf( __( '%sThere are no entries for the new form, so the View will also be empty.%s To start collecting entries, you can add submissions through %sthe preview form%s and also embed the form on a post or page using this code: %s
154 154
 
155 155
 					You can %sedit the form%s in Gravity Forms and the updated fields will be available here. Don&rsquo;t forget to %scustomize the form settings%s.
156
-					', 'gravityview' ), '<strong>', '</strong>', '<a href="'.site_url( '?gf_page=preview&amp;id='.$connected_form ).'">', '</a>', '<code>[gravityform id="'.$connected_form.'" name="'.$form_name.'"]</code>', '<a href="'.admin_url( 'admin.php?page=gf_edit_forms&amp;id='.$connected_form ).'">', '</a>', '<a href="'.admin_url( 'admin.php?page=gf_edit_forms&amp;view=settings&amp;id='.$connected_form ).'">', '</a>');
156
+					', 'gravityview' ), '<strong>', '</strong>', '<a href="' . site_url( '?gf_page=preview&amp;id=' . $connected_form ) . '">', '</a>', '<code>[gravityform id="' . $connected_form . '" name="' . $form_name . '"]</code>', '<a href="' . admin_url( 'admin.php?page=gf_edit_forms&amp;id=' . $connected_form ) . '">', '</a>', '<a href="' . admin_url( 'admin.php?page=gf_edit_forms&amp;view=settings&amp;id=' . $connected_form ) . '">', '</a>' );
157 157
 				$new_form_text = wpautop( $new_form_text );
158 158
 
159 159
 				delete_post_meta( $post_id, '_gravityview_start_fresh' );
160 160
 			}
161 161
 		}
162 162
 
163
-		$messages['gravityview'] = array(
163
+		$messages[ 'gravityview' ] = array(
164 164
 			0  => '', // Unused. Messages start at index 1.
165 165
 			/* translators: %s and %s are HTML tags linking to the View on the website */
166
-			1  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
166
+			1  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
167 167
 			/* translators: %s and %s are HTML tags linking to the View on the website */
168
-			2  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
168
+			2  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
169 169
 			3  => __( 'View deleted.', 'gravityview' ),
170 170
 			/* translators: %s and %s are HTML tags linking to the View on the website */
171
-			4  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
171
+			4  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
172 172
 			/* translators: %s: date and time of the revision */
173
-			5  => isset( $_GET['revision'] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
173
+			5  => isset( $_GET[ 'revision' ] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int)$_GET[ 'revision' ], false ) ) : false,
174 174
 			/* translators: %s and %s are HTML tags linking to the View on the website */
175
-			6  => sprintf(__( 'View published. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
175
+			6  => sprintf( __( 'View published. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
176 176
 			/* translators: %s and %s are HTML tags linking to the View on the website */
177
-			7  => sprintf(__( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
177
+			7  => sprintf( __( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
178 178
 			8  => __( 'View submitted.', 'gravityview' ),
179 179
 			9  => sprintf(
180 180
 		        /* translators: Date and time the View is scheduled to be published */
181 181
 				__( 'View scheduled for: %1$s.', 'gravityview' ),
182 182
 				// translators: Publish box date format, see http://php.net/date
183
-				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL )  ) )
183
+				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL ) ) )
184 184
 			) . $new_form_text,
185 185
 			/* translators: %s and %s are HTML tags linking to the View on the website */
186
-			10  => sprintf(__( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
186
+			10  => sprintf( __( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
187 187
 
188 188
 			/**
189 189
 			 * These apply to `bulk_post_updated_messages`
190 190
 			 * @file wp-admin/edit.php
191 191
 			 */
192
-			'updated'   => _n( '%s View updated.', '%s Views updated.', $bulk_counts['updated'], 'gravityview' ),
193
-			'locked'    => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts['locked'], 'gravityview' ),
194
-			'deleted'   => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts['deleted'], 'gravityview' ),
195
-			'trashed'   => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts['trashed'], 'gravityview' ),
196
-			'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts['untrashed'], 'gravityview' ),
192
+			'updated'   => _n( '%s View updated.', '%s Views updated.', $bulk_counts[ 'updated' ], 'gravityview' ),
193
+			'locked'    => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts[ 'locked' ], 'gravityview' ),
194
+			'deleted'   => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts[ 'deleted' ], 'gravityview' ),
195
+			'trashed'   => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts[ 'trashed' ], 'gravityview' ),
196
+			'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts[ 'untrashed' ], 'gravityview' ),
197 197
 		);
198 198
 
199 199
 		return $messages;
@@ -253,29 +253,29 @@  discard block
 block discarded – undo
253 253
 	static function is_admin_page( $hook = '', $page = NULL ) {
254 254
 		global $current_screen, $plugin_page, $pagenow, $post;
255 255
 
256
-		if( ! is_admin() ) { return false; }
256
+		if ( ! is_admin() ) { return false; }
257 257
 
258 258
 		$is_page = false;
259 259
 
260
-		$is_gv_screen = (!empty($current_screen) && isset($current_screen->post_type) && $current_screen->post_type === 'gravityview');
260
+		$is_gv_screen = ( ! empty( $current_screen ) && isset( $current_screen->post_type ) && $current_screen->post_type === 'gravityview' );
261 261
 
262
-		$is_gv_post_type_get = (isset($_GET['post_type']) && $_GET['post_type'] === 'gravityview');
262
+		$is_gv_post_type_get = ( isset( $_GET[ 'post_type' ] ) && $_GET[ 'post_type' ] === 'gravityview' );
263 263
 
264
-		$is_gv_settings_get = isset( $_GET['page'] ) && $_GET['page'] === 'gravityview_settings';
264
+		$is_gv_settings_get = isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] === 'gravityview_settings';
265 265
 
266
-		if( empty( $post ) && $pagenow === 'post.php' && !empty( $_GET['post'] ) ) {
267
-			$gv_post = get_post( intval( $_GET['post'] ) );
268
-			$is_gv_post_type = (!empty($gv_post) && !empty($gv_post->post_type) && $gv_post->post_type === 'gravityview');
266
+		if ( empty( $post ) && $pagenow === 'post.php' && ! empty( $_GET[ 'post' ] ) ) {
267
+			$gv_post = get_post( intval( $_GET[ 'post' ] ) );
268
+			$is_gv_post_type = ( ! empty( $gv_post ) && ! empty( $gv_post->post_type ) && $gv_post->post_type === 'gravityview' );
269 269
 		} else {
270
-			$is_gv_post_type = (!empty($post) && !empty($post->post_type) && $post->post_type === 'gravityview');
270
+			$is_gv_post_type = ( ! empty( $post ) && ! empty( $post->post_type ) && $post->post_type === 'gravityview' );
271 271
 		}
272 272
 
273
-		if( $is_gv_screen || $is_gv_post_type || $is_gv_post_type || $is_gv_post_type_get || $is_gv_settings_get ) {
273
+		if ( $is_gv_screen || $is_gv_post_type || $is_gv_post_type || $is_gv_post_type_get || $is_gv_settings_get ) {
274 274
 
275 275
 			// $_GET `post_type` variable
276
-			if(in_array($pagenow, array( 'post.php' , 'post-new.php' )) ) {
276
+			if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) {
277 277
 				$is_page = 'single';
278
-			} else if ( in_array( $plugin_page, array( 'gravityview_settings', 'gravityview_page_gravityview_settings' ) ) || ( !empty( $_GET['page'] ) && $_GET['page'] === 'gravityview_settings' ) ) {
278
+			} else if ( in_array( $plugin_page, array( 'gravityview_settings', 'gravityview_page_gravityview_settings' ) ) || ( ! empty( $_GET[ 'page' ] ) && $_GET[ 'page' ] === 'gravityview_settings' ) ) {
279 279
 				$is_page = 'settings';
280 280
 			} else {
281 281
 				$is_page = 'views';
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 		$is_page = apply_filters( 'gravityview_is_admin_page', $is_page, $hook );
291 291
 
292 292
 		// If the current page is the same as the compared page
293
-		if( !empty( $page ) ) {
293
+		if ( ! empty( $page ) ) {
294 294
 			return $is_page === $page;
295 295
 		}
296 296
 
@@ -311,6 +311,6 @@  discard block
 block discarded – undo
311 311
  *
312 312
  * @return bool|string|void If `false`, not a GravityView page. `true` if $page is passed and is the same as current page. Otherwise, the name of the page (`single`, `settings`, or `views`)
313 313
  */
314
-function gravityview_is_admin_page($hook = '', $page = NULL) {
314
+function gravityview_is_admin_page( $hook = '', $page = NULL ) {
315 315
 	return GravityView_Admin::is_admin_page( $hook, $page );
316 316
 }
Please login to merge, or discard this patch.
includes/admin/class-gravityview-admin-no-conflict.php 2 patches
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		if( ! is_admin() ) { return; }
21
+		if ( ! is_admin() ) { return; }
22 22
 		
23 23
 		$this->add_hooks();
24 24
 	}
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
 	 */
33 33
 	private function add_hooks() {
34 34
 		//Hooks for no-conflict functionality
35
-		add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000);
36
-		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9);
35
+		add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000 );
36
+		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9 );
37 37
 
38
-		add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000);
39
-		add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11);
40
-		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1);
41
-		add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1);
38
+		add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000 );
39
+		add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11 );
40
+		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1 );
41
+		add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1 );
42 42
 	}
43 43
 
44 44
 	/**
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
 	function no_conflict_scripts() {
52 52
 		global $wp_scripts;
53 53
 
54
-		if( ! gravityview_is_admin_page() ) {
54
+		if ( ! gravityview_is_admin_page() ) {
55 55
 			return;
56 56
 		}
57 57
 
58
-		$no_conflict_mode = GravityView_Settings::getSetting('no-conflict-mode');
58
+		$no_conflict_mode = GravityView_Settings::getSetting( 'no-conflict-mode' );
59 59
 
60
-		if( empty( $no_conflict_mode ) ) {
60
+		if ( empty( $no_conflict_mode ) ) {
61 61
 			return;
62 62
 		}
63 63
 
@@ -110,24 +110,24 @@  discard block
 block discarded – undo
110 110
 	function no_conflict_styles() {
111 111
 		global $wp_styles;
112 112
 
113
-		if( ! gravityview_is_admin_page() ) {
113
+		if ( ! gravityview_is_admin_page() ) {
114 114
 			return;
115 115
 		}
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 ) )  {
120
-			foreach ($wp_styles->registered as $key => $style) {
121
-				if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) {
119
+		if ( ! empty( $wp_styles->registered ) ) {
120
+			foreach ( $wp_styles->registered as $key => $style ) {
121
+				if ( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) {
122 122
 					wp_dequeue_style( $key );
123 123
 				}
124 124
 			}
125 125
 		}
126 126
 
127
-		$no_conflict_mode = GravityView_Settings::getSetting('no-conflict-mode');
127
+		$no_conflict_mode = GravityView_Settings::getSetting( 'no-conflict-mode' );
128 128
 
129 129
 		// If no conflict is off, jQuery will suffice.
130
-		if( empty( $no_conflict_mode ) ) {
130
+		if ( empty( $no_conflict_mode ) ) {
131 131
 			return;
132 132
 		}
133 133
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 		/**
155 155
 		 * @action `gravityview_remove_conflicts_after` Runs after no-conflict styles are removed. You can re-add styles here.
156 156
 		 */
157
-		do_action('gravityview_remove_conflicts_after');
157
+		do_action( 'gravityview_remove_conflicts_after' );
158 158
 	}
159 159
 
160 160
 	/**
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
 
179 179
 		//reset queue
180 180
 		$queue = array();
181
-		foreach( $wp_objects->queue as $object ) {
182
-			if( in_array( $object, $required_objects ) || preg_match('/gravityview|gf_|gravityforms/ism', $object ) ) {
183
-				$queue[] = $object;
181
+		foreach ( $wp_objects->queue as $object ) {
182
+			if ( in_array( $object, $required_objects ) || preg_match( '/gravityview|gf_|gravityforms/ism', $object ) ) {
183
+				$queue[ ] = $object;
184 184
 			}
185 185
 		}
186 186
 		$wp_objects->queue = $queue;
@@ -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
 		}
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	 * @param array $registered [description]
206 206
 	 * @param array $scripts    [description]
207 207
 	 */
208
-	private function add_script_dependencies($registered, $scripts) {
208
+	private function add_script_dependencies( $registered, $scripts ) {
209 209
 
210 210
 		//gets all dependent scripts linked to the $scripts array passed
211 211
 		do {
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 				$deps = isset( $registered[ $script ] ) && is_array( $registered[ $script ]->deps ) ? $registered[ $script ]->deps : array();
215 215
 				foreach ( $deps as $dep ) {
216 216
 					if ( ! in_array( $dep, $scripts ) && ! in_array( $dep, $dependents ) ) {
217
-						$dependents[] = $dep;
217
+						$dependents[ ] = $dep;
218 218
 					}
219 219
 				}
220 220
 			}
Please login to merge, or discard this 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.
includes/admin/field-types/type_radio.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@
 block discarded – undo
19 19
 	}
20 20
 
21 21
 	function render_input( $override_input = null ) {
22
-		if( isset( $override_input ) ) {
22
+		if ( isset( $override_input ) ) {
23 23
 			echo $override_input;
24 24
 			return;
25 25
 		}
26 26
 
27
-		foreach( $this->field['options'] as $value => $label ) : ?>
27
+		foreach ( $this->field[ 'options' ] as $value => $label ) : ?>
28 28
 		<label class="<?php echo $this->get_label_class(); ?>">
29 29
 			<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>-<?php echo esc_attr( $value ); ?>" type="radio" value="<?php echo esc_attr( $value ); ?>" <?php checked( $value, $this->value, true ); ?> />&nbsp;<?php echo esc_html( $label ); ?>
30 30
 		</label>
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-radio.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 	var $name = 'radio';
11 11
 
12
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
12
+	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' );
13 13
 
14 14
 	var $_gf_field_class_name = 'GF_Field_Radio';
15 15
 
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 		// Set the $_field_id var
39 39
 		$field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type );
40 40
 		
41
-		if( $this->is_choice_value_enabled() ) {
42
-			$field_options['choice_display'] = array(
41
+		if ( $this->is_choice_value_enabled() ) {
42
+			$field_options[ 'choice_display' ] = array(
43 43
 				'type'    => 'radio',
44 44
 				'value'   => 'value',
45 45
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-select.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@
 block discarded – undo
38 38
 		// Set the $_field_id var
39 39
 		$field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type );
40 40
 
41
-		if( $this->is_choice_value_enabled() ) {
42
-			$field_options['choice_display'] = array(
41
+		if ( $this->is_choice_value_enabled() ) {
42
+			$field_options[ 'choice_display' ] = array(
43 43
 				'type'    => 'radio',
44 44
 				'value'   => 'value',
45 45
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
Please login to merge, or discard this patch.
plugin-and-theme-hooks/class-gravityview-plugin-hooks-gravityformsquiz.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,25 +48,25 @@
 block discarded – undo
48 48
 		
49 49
 		$quiz_fields = GFAPI::get_fields_by_type( $form, 'quiz' );
50 50
 		
51
-		if( ! empty( $quiz_fields ) ) {
51
+		if ( ! empty( $quiz_fields ) ) {
52 52
 			
53
-			$fields['gquiz_score']   = array(
53
+			$fields[ 'gquiz_score' ] = array(
54 54
 				'label' => __( 'Quiz Score Total', 'gravityview' ),
55 55
 				'type'  => 'quiz_score',
56 56
 				'desc'  => __( 'Displays the number of correct Quiz answers the user submitted.', 'gravityview' ),
57 57
 			);
58
-			$fields['gquiz_percent'] = array(
58
+			$fields[ 'gquiz_percent' ] = array(
59 59
 				'label' => __( 'Quiz Percentage Grade', 'gravityview' ),
60 60
 				'type'  => 'quiz_percent',
61 61
 				'desc'  => __( 'Displays the percentage of correct Quiz answers the user submitted.', 'gravityview' ),
62 62
 			);
63
-			$fields['gquiz_grade']   = array(
63
+			$fields[ 'gquiz_grade' ] = array(
64 64
 				/* translators: This is a field type used by the Gravity Forms Quiz Addon. "A" is 100-90, "B" is 89-80, "C" is 79-70, etc.  */
65 65
 				'label' => __( 'Quiz Letter Grade', 'gravityview' ),
66 66
 				'type'  => 'quiz_grade',
67 67
 				'desc'  => __( 'Displays the Grade the user achieved based on Letter Grading configured in the Quiz Settings.', 'gravityview' ),
68 68
 			);
69
-			$fields['gquiz_is_pass'] = array(
69
+			$fields[ 'gquiz_is_pass' ] = array(
70 70
 				'label' => __( 'Quiz Pass/Fail', 'gravityview' ),
71 71
 				'type'  => 'quiz_is_pass',
72 72
 				'desc'  => __( 'Displays either Passed or Failed based on the Pass/Fail settings configured in the Quiz Settings.', 'gravityview' ),
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-password.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 	 *
50 50
 	 * @return string If a custom field label isn't set, return the field label for the password field
51 51
 	 */
52
-	function field_label( $label = '', $field = array(), $form = array(), $entry = array() ){
52
+	function field_label( $label = '', $field = array(), $form = array(), $entry = array() ) {
53 53
 
54 54
 		// If using a custom label, no need to fetch the parent label
55 55
 		if( ! is_numeric( $field['id'] ) || ! empty( $field['custom_label'] ) ) {
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -49,17 +49,17 @@  discard block
 block discarded – undo
49 49
 	 *
50 50
 	 * @return string If a custom field label isn't set, return the field label for the password field
51 51
 	 */
52
-	function field_label( $label = '', $field = array(), $form = array(), $entry = array() ){
52
+	function field_label( $label = '', $field = array(), $form = array(), $entry = array() ) {
53 53
 
54 54
 		// If using a custom label, no need to fetch the parent label
55
-		if( ! is_numeric( $field['id'] ) || ! empty( $field['custom_label'] ) ) {
55
+		if ( ! is_numeric( $field[ 'id' ] ) || ! empty( $field[ 'custom_label' ] ) ) {
56 56
 			return $label;
57 57
 		}
58 58
 
59
-		$field_object = GFFormsModel::get_field( $form, $field['id'] );
59
+		$field_object = GFFormsModel::get_field( $form, $field[ 'id' ] );
60 60
 
61
-		if( $field_object && 'password' === $field_object->type ) {
62
-			$label = $field['label'];
61
+		if ( $field_object && 'password' === $field_object->type ) {
62
+			$label = $field[ 'label' ];
63 63
 		}
64 64
 
65 65
 		return $label;
@@ -79,17 +79,17 @@  discard block
 block discarded – undo
79 79
 	function add_form_fields( $fields = array(), $form = array(), $include_parent_field = true ) {
80 80
 
81 81
 		foreach ( $fields as $key => $field ) {
82
-			if( 'password' === $field['type'] ) {
82
+			if ( 'password' === $field[ 'type' ] ) {
83 83
 
84 84
 				// The Enter Password input
85
-				if( floor( $key ) === floatval( $key ) ) {
85
+				if ( floor( $key ) === floatval( $key ) ) {
86 86
 
87
-					if( ! empty( $field['parent'] ) ) {
88
-						$field['label']      = $field['parent']->label;
89
-						$field['adminOnly']  = $field['parent']->adminOnly;
90
-						$field['adminLabel'] = $field['parent']->adminLabel;
87
+					if ( ! empty( $field[ 'parent' ] ) ) {
88
+						$field[ 'label' ]      = $field[ 'parent' ]->label;
89
+						$field[ 'adminOnly' ]  = $field[ 'parent' ]->adminOnly;
90
+						$field[ 'adminLabel' ] = $field[ 'parent' ]->adminLabel;
91 91
 						// Don't show as a child input
92
-						unset( $field['parent'] );
92
+						unset( $field[ 'parent' ] );
93 93
 					}
94 94
 
95 95
 					$fields[ $key ] = $field;
Please login to merge, or discard this patch.
includes/presets/default-edit/class-gravityview-default-template-edit.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 			'slug' => 'edit',
25 25
 			'type' => 'internal',
26 26
 			'label' =>  __( 'Edit Table', 'gravityview' ),
27
-			'description' => __('Display items in a table view.', 'gravityview'),
28
-			'logo' => plugins_url('includes/presets/default-table/logo-default-table.png', GRAVITYVIEW_FILE),
27
+			'description' => __( 'Display items in a table view.', 'gravityview' ),
28
+			'logo' => plugins_url( 'includes/presets/default-table/logo-default-table.png', GRAVITYVIEW_FILE ),
29 29
 			'css_source' => gravityview_css_url( 'table-view.css', GRAVITYVIEW_DIR . 'templates/css/' ),
30 30
 		);
31 31
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 				'1-1' => array(
43 43
 					array(
44 44
 						'areaid' => 'edit-fields',
45
-						'title' => __('Visible Edit Fields', 'gravityview' )
45
+						'title' => __( 'Visible Edit Fields', 'gravityview' )
46 46
 					)
47 47
 				)
48 48
 			)
Please login to merge, or discard this patch.
class-gravityview-plugin-hooks-gravity-forms-survey.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,6 @@
 block discarded – undo
36 36
 	 * @since 1.16.4
37 37
 	 * @since 1.17 Moved to GravityView_Plugin_Hooks_Gravity_Forms_Survey class
38 38
 	 *
39
-	 * @param array $form
40 39
 	 *
41 40
 	 * @return array Form, with all fields set to `allowsPrepopulate => true`
42 41
 	 */
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 		$return = $input_type;
47 47
 
48
-		if( 'survey' === $field_type ) {
48
+		if ( 'survey' === $field_type ) {
49 49
 			$return = 'select';
50 50
 		}
51 51
 
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 	public function fix_survey_fields( $fields ) {
66 66
 
67 67
 		/** @var GF_Field $field */
68
-		foreach( $fields as &$field ) {
69
-			if( 'survey' === $field->type ) {
68
+		foreach ( $fields as &$field ) {
69
+			if ( 'survey' === $field->type ) {
70 70
 				$field->allowsPrepopulate = true;
71 71
 			}
72 72
 		}
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @return void
83 83
 	 */
84 84
 	function add_render_hooks() {
85
-		add_filter( 'gform_field_value', array( $this, 'fix_survey_field_value'), 10, 3 );
85
+		add_filter( 'gform_field_value', array( $this, 'fix_survey_field_value' ), 10, 3 );
86 86
 	}
87 87
 
88 88
 	/**
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 * @return void
96 96
 	 */
97 97
 	function remove_render_hooks() {
98
-		remove_filter( 'gform_field_value', array( $this, 'fix_survey_field_value'), 10 );
98
+		remove_filter( 'gform_field_value', array( $this, 'fix_survey_field_value' ), 10 );
99 99
 	}
100 100
 
101 101
 	/**
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 	 */
114 114
 	public function fix_survey_field_value( $value, $field, $name ) {
115 115
 
116
-		if( 'survey' === $field->type ) {
116
+		if ( 'survey' === $field->type ) {
117 117
 
118
-			$entry = GravityView_Edit_Entry::getInstance()->instances['render']->get_entry();
118
+			$entry = GravityView_Edit_Entry::getInstance()->instances[ 'render' ]->get_entry();
119 119
 
120 120
 			// We need to run through each survey row until we find a match for expected values
121 121
 			foreach ( $entry as $field_id => $field_value ) {
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
 					continue;
125 125
 				}
126 126
 
127
-				if( rgar( $field, 'gsurveyLikertEnableMultipleRows' ) ) {
127
+				if ( rgar( $field, 'gsurveyLikertEnableMultipleRows' ) ) {
128 128
 					list( $row_val, $col_val ) = explode( ':', $field_value, 2 );
129 129
 
130 130
 					// If the $name matches the $row_val, we are processing the correct row
131
-					if( $row_val === $name ) {
131
+					if ( $row_val === $name ) {
132 132
 						$value = $field_value;
133 133
 						break;
134 134
 					}
Please login to merge, or discard this patch.