Completed
Push — develop ( c38b5d...31c9ca )
by Zack
18:12
created
includes/fields/class-gravityview-field-entry-link.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,25 +32,25 @@
 block discarded – undo
32 32
 
33 33
 	public function __construct() {
34 34
 		$this->label = esc_html__( 'Link to Single Entry', 'gravityview' );
35
-		$this->description = esc_html__('A dedicated link to the single entry with customizable text.', 'gravityview');
35
+		$this->description = esc_html__( 'A dedicated link to the single entry with customizable text.', 'gravityview' );
36 36
 		parent::__construct();
37 37
 	}
38 38
 
39 39
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
40 40
 
41 41
 		// Always a link!
42
-		unset( $field_options['show_as_link'], $field_options['search_filter'] );
42
+		unset( $field_options[ 'show_as_link' ], $field_options[ 'search_filter' ] );
43 43
 
44
-		if( 'edit' === $context ) {
44
+		if ( 'edit' === $context ) {
45 45
 			return $field_options;
46 46
 		}
47 47
 
48 48
 		$add_options = array();
49
-		$add_options['entry_link_text'] = array(
49
+		$add_options[ 'entry_link_text' ] = array(
50 50
 			'type' => 'text',
51 51
 			'label' => __( 'Link Text:', 'gravityview' ),
52 52
 			'desc' => NULL,
53
-			'value' => __('View Details', 'gravityview'),
53
+			'value' => __( 'View Details', 'gravityview' ),
54 54
 			'merge_tags' => true,
55 55
 		);
56 56
 
Please login to merge, or discard this patch.
includes/class-gravityview-change-entry-creator.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -354,7 +354,7 @@
 block discarded – undo
354 354
 	 *
355 355
 	 * @param array $assets
356 356
 	 *
357
-	 * @return array
357
+	 * @return string[]
358 358
 	 */
359 359
 	function register_gform_noconflict( $assets ) {
360 360
 		$assets[] = 'gravityview_selectwoo';
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 			array(
82 82
 				'ajaxurl'  => admin_url( 'admin-ajax.php' ),
83 83
 				'action'   => 'entry_creator_get_users',
84
-				'gf25'    => (bool) gravityview()->plugin->is_GF_25(),
84
+				'gf25'    => (bool)gravityview()->plugin->is_GF_25(),
85 85
 				'language' => array(
86 86
 					'search_placeholder' => esc_html__( 'Search by ID, login, email, or name.', 'gravityview' ),
87 87
 				),
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
 			)
106 106
 		);
107 107
 
108
-		if ( ! wp_verify_nonce( $post_var['gv_nonce'], 'gv_entry_creator' ) ) {
108
+		if ( ! wp_verify_nonce( $post_var[ 'gv_nonce' ], 'gv_entry_creator' ) ) {
109 109
 			die();
110 110
 		}
111 111
 
112
-		$search_string = $post_var['q'];
112
+		$search_string = $post_var[ 'q' ];
113 113
 
114 114
 		if ( is_numeric( $search_string ) ) {
115 115
 			$user_args = array(
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 		}
157 157
 
158 158
 		// Update the entry. The `false` prevents checking Akismet; `true` disables the user updated hook from firing
159
-		$result = RGFormsModel::update_entry_property( (int) $entry['id'], 'created_by', (int) $user_id, false, true );
159
+		$result = RGFormsModel::update_entry_property( (int)$entry[ 'id' ], 'created_by', (int)$user_id, false, true );
160 160
 
161 161
 		if ( false === $result ) {
162 162
 			$status = __( 'Error', 'gravityview' );
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 			return;
179 179
 		}
180 180
 
181
-		GravityView_Entry_Notes::add_note( $entry['id'], - 1, 'GravityView', $note, 'gravityview' );
181
+		GravityView_Entry_Notes::add_note( $entry[ 'id' ], - 1, 'GravityView', $note, 'gravityview' );
182 182
 
183 183
 	}
184 184
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 		}
214 214
 
215 215
 		// If screen mode isn't set, then we're in the wrong place.
216
-		if ( empty( $_REQUEST['screen_mode'] ) ) {
216
+		if ( empty( $_REQUEST[ 'screen_mode' ] ) ) {
217 217
 			return;
218 218
 		}
219 219
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
 		// If $_GET['screen_mode'] is set to edit, set $_POST value
241 241
 		if ( \GV\Utils::_GET( 'screen_mode' ) === 'edit' ) {
242
-			$_POST["screen_mode"] = 'edit';
242
+			$_POST[ "screen_mode" ] = 'edit';
243 243
 		}
244 244
 
245 245
 	}
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 		$entry_creator_user_id = \GV\Utils::get( $entry, 'created_by' );
315 315
 
316 316
 		$entry_creator_user = GVCommon::get_users( 'change_entry_creator', array( 'include' => $entry_creator_user_id ) );
317
-		$entry_creator_user = isset( $entry_creator_user[0] ) ? $entry_creator_user[0] : array();
317
+		$entry_creator_user = isset( $entry_creator_user[ 0 ] ) ? $entry_creator_user[ 0 ] : array();
318 318
 
319 319
 		if ( empty( $entry_creator_user ) ) {
320 320
 			$output .= '<option value="0"> &mdash; ' . esc_attr_x( 'No User', 'No user assigned to the entry', 'gravityview' ) . ' &mdash; </option>';
@@ -332,18 +332,18 @@  discard block
 block discarded – undo
332 332
 		}
333 333
 
334 334
 		$user_count      = count_users();
335
-		$user_count      = $user_count['total_users'];
335
+		$user_count      = $user_count[ 'total_users' ];
336 336
 		$users_displayed = self::DEFAULT_NUMBER_OF_USERS + ( ! empty( $entry_creator_user ) ? 1 : 0 );
337 337
 		if ( $user_count > $users_displayed ) {
338 338
 			$remaining_users = $user_count - $users_displayed;
339
-			$user_users = _n( esc_html__('user', 'gravityview' ), esc_html__('users', 'gravityview' ), $remaining_users );
339
+			$user_users = _n( esc_html__( 'user', 'gravityview' ), esc_html__( 'users', 'gravityview' ), $remaining_users );
340 340
 			$message = esc_html_x( 'Use the input above to search the remaining %d %s.', '%d is replaced with user count %s is replaced with "user" or "users"', 'gravityview' );
341 341
 			$message = sprintf( $message, $remaining_users, $user_users );
342
-			$output  .= '<option value="_user_count" disabled="disabled">' . esc_html( $message ) . '</option>';
342
+			$output .= '<option value="_user_count" disabled="disabled">' . esc_html( $message ) . '</option>';
343 343
 		}
344 344
 
345 345
 		$output .= '</select>';
346
-		$output .= '<input name="originally_created_by" value="' . esc_attr( $entry['created_by'] ) . '" type="hidden" />';
346
+		$output .= '<input name="originally_created_by" value="' . esc_attr( $entry[ 'created_by' ] ) . '" type="hidden" />';
347 347
 		$output .= wp_nonce_field( 'gv_entry_creator', 'gv_entry_creator_nonce', false, false );
348 348
 
349 349
 		echo $output;
@@ -357,8 +357,8 @@  discard block
 block discarded – undo
357 357
 	 * @return array
358 358
 	 */
359 359
 	function register_gform_noconflict( $assets ) {
360
-		$assets[] = 'gravityview_selectwoo';
361
-		$assets[] = 'gravityview_entry_creator';
360
+		$assets[ ] = 'gravityview_selectwoo';
361
+		$assets[ ] = 'gravityview_entry_creator';
362 362
 
363 363
 		return $assets;
364 364
 	}
Please login to merge, or discard this patch.
future/includes/class-gv-collection-view.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 			 * @deprecated
115 115
 			 * @see The `gravityview/view_collection/from_post/meta_keys` filter.
116 116
 			 */
117
-			$meta_keys = (array) apply_filters_deprecated( 'gravityview/data/parse/meta_keys', array( $meta_keys, $post->ID ), '2.0.7', 'gravityview/view_collection/from_post/meta_keys' );
117
+			$meta_keys = (array)apply_filters_deprecated( 'gravityview/data/parse/meta_keys', array( $meta_keys, $post->ID ), '2.0.7', 'gravityview/view_collection/from_post/meta_keys' );
118 118
 
119 119
 			/** What about inside post meta values? */
120 120
 			foreach ( $meta_keys as $meta_key ) {
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
 
169 169
 		/** Let's find us some [gravityview] shortcodes perhaps. */
170 170
 		foreach ( Shortcode::parse( $content ) as $shortcode ) {
171
-			if ( $shortcode->name != 'gravityview' || empty( $shortcode->atts['id'] ) ) {
171
+			if ( $shortcode->name != 'gravityview' || empty( $shortcode->atts[ 'id' ] ) ) {
172 172
 				continue;
173 173
 			}
174 174
 
175
-			if ( is_numeric( $shortcode->atts['id'] ) ) {
176
-				$view = View::by_id( $shortcode->atts['id'] );
175
+			if ( is_numeric( $shortcode->atts[ 'id' ] ) ) {
176
+				$view = View::by_id( $shortcode->atts[ 'id' ] );
177 177
 				if ( ! $view ) {
178 178
 					continue;
179 179
 				}
Please login to merge, or discard this patch.
includes/class-gravityview-admin-notices.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -60,21 +60,21 @@  discard block
 block discarded – undo
60 60
 	public function dismiss_notice() {
61 61
 
62 62
 		// No dismiss sent
63
-		if( empty( $_GET['gv-dismiss'] ) || empty( $_GET['notice'] ) ) {
63
+		if ( empty( $_GET[ 'gv-dismiss' ] ) || empty( $_GET[ 'notice' ] ) ) {
64 64
 			return;
65 65
 		}
66 66
 
67 67
 		// Invalid nonce
68
-		if( !wp_verify_nonce( $_GET['gv-dismiss'], 'dismiss' ) ) {
68
+		if ( ! wp_verify_nonce( $_GET[ 'gv-dismiss' ], 'dismiss' ) ) {
69 69
 			return;
70 70
 		}
71 71
 
72
-		$notice_id = esc_attr( $_GET['notice'] );
72
+		$notice_id = esc_attr( $_GET[ 'notice' ] );
73 73
 
74 74
 		//don't display a message if use has dismissed the message for this version
75 75
 		$dismissed_notices = (array)get_transient( 'gravityview_dismissed_notices' );
76 76
 
77
-		$dismissed_notices[] = $notice_id;
77
+		$dismissed_notices[ ] = $notice_id;
78 78
 
79 79
 		$dismissed_notices = array_unique( $dismissed_notices );
80 80
 
@@ -97,12 +97,12 @@  discard block
 block discarded – undo
97 97
 	private function is_notice_dismissed( $notice ) {
98 98
 
99 99
 		// There are no dismissed notices.
100
-		if( empty( self::$dismissed_notices ) ) {
100
+		if ( empty( self::$dismissed_notices ) ) {
101 101
 			return false;
102 102
 		}
103 103
 
104 104
 		// Has the
105
-		$is_dismissed = !empty( $notice['dismiss'] ) && in_array( $notice['dismiss'], self::$dismissed_notices );
105
+		$is_dismissed = ! empty( $notice[ 'dismiss' ] ) && in_array( $notice[ 'dismiss' ], self::$dismissed_notices );
106 106
 
107 107
 		return $is_dismissed ? true : false;
108 108
 	}
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	private function check_show_multisite_notices() {
129 129
 
130
-		if( ! is_multisite() ) {
130
+		if ( ! is_multisite() ) {
131 131
 			return true;
132 132
 		}
133 133
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		}
138 138
 
139 139
 		// or they don't have admin capabilities
140
-		if( ! is_super_admin() ) {
140
+		if ( ! is_super_admin() ) {
141 141
 			return false;
142 142
 		}
143 143
 
@@ -160,48 +160,48 @@  discard block
 block discarded – undo
160 160
 		 */
161 161
 		$notices = apply_filters( 'gravityview/admin/notices', self::$admin_notices );
162 162
 
163
-		if( empty( $notices ) || ! $this->check_show_multisite_notices() ) {
163
+		if ( empty( $notices ) || ! $this->check_show_multisite_notices() ) {
164 164
 			return;
165 165
 		}
166 166
 
167 167
 		//don't display a message if use has dismissed the message for this version
168 168
 		// TODO: Use get_user_meta instead of get_transient
169
-		self::$dismissed_notices = isset( $_GET['show-dismissed-notices'] ) ? array() : (array)get_transient( 'gravityview_dismissed_notices' );
169
+		self::$dismissed_notices = isset( $_GET[ 'show-dismissed-notices' ] ) ? array() : (array)get_transient( 'gravityview_dismissed_notices' );
170 170
 
171 171
 		$output = '';
172 172
 
173
-		foreach( $notices as $notice ) {
173
+		foreach ( $notices as $notice ) {
174 174
 
175 175
 			// If the user doesn't have the capability to see the warning
176
-			if( isset( $notice['cap'] ) && false === GVCommon::has_cap( $notice['cap'] ) ) {
176
+			if ( isset( $notice[ 'cap' ] ) && false === GVCommon::has_cap( $notice[ 'cap' ] ) ) {
177 177
 				gravityview()->log->debug( 'Notice not shown because user does not have the capability to view it.', array( 'data' => $notice ) );
178 178
 				continue;
179 179
 			}
180 180
 
181
-			if( true === $this->is_notice_dismissed( $notice ) ) {
181
+			if ( true === $this->is_notice_dismissed( $notice ) ) {
182 182
 				gravityview()->log->debug( 'Notice not shown because the notice has already been dismissed.', array( 'data' => $notice ) );
183 183
 				continue;
184 184
 			}
185 185
 
186
-			$output .= '<div id="message" style="position:relative" class="notice '. gravityview_sanitize_html_class( $notice['class'] ).'">';
186
+			$output .= '<div id="message" style="position:relative" class="notice ' . gravityview_sanitize_html_class( $notice[ 'class' ] ) . '">';
187 187
 
188 188
 			// Too cute to leave out.
189 189
 			$output .= gravityview_get_floaty();
190 190
 
191
-			if( !empty( $notice['title'] ) ) {
192
-				$output .= '<h3>'.esc_html( $notice['title'] ) .'</h3>';
191
+			if ( ! empty( $notice[ 'title' ] ) ) {
192
+				$output .= '<h3>' . esc_html( $notice[ 'title' ] ) . '</h3>';
193 193
 			}
194 194
 
195
-			$message = isset( $notice['message'] ) ? $notice['message'] : '';
195
+			$message = isset( $notice[ 'message' ] ) ? $notice[ 'message' ] : '';
196 196
 
197
-			if( !empty( $notice['dismiss'] ) ) {
197
+			if ( ! empty( $notice[ 'dismiss' ] ) ) {
198 198
 
199
-				$dismiss = esc_attr($notice['dismiss']);
199
+				$dismiss = esc_attr( $notice[ 'dismiss' ] );
200 200
 
201 201
 				$url = esc_url( add_query_arg( array( 'gv-dismiss' => wp_create_nonce( 'dismiss' ), 'notice' => $dismiss ) ) );
202 202
 
203 203
 				$align = is_rtl() ? 'alignleft' : 'alignright';
204
-				$message .= '<a href="'.$url.'" data-notice="'.$dismiss.'" class="' . $align . ' button button-link">'.esc_html__('Dismiss', 'gravityview' ).'</a></p>';
204
+				$message .= '<a href="' . $url . '" data-notice="' . $dismiss . '" class="' . $align . ' button button-link">' . esc_html__( 'Dismiss', 'gravityview' ) . '</a></p>';
205 205
 			}
206 206
 
207 207
 			$output .= wpautop( $message );
@@ -233,14 +233,14 @@  discard block
 block discarded – undo
233 233
 	 */
234 234
 	public static function add_notice( $notice = array() ) {
235 235
 
236
-		if( !isset( $notice['message'] ) ) {
236
+		if ( ! isset( $notice[ 'message' ] ) ) {
237 237
 			gravityview()->log->error( 'Notice not set', array( 'data' => $notice ) );
238 238
 			return;
239 239
 		}
240 240
 
241
-		$notice['class'] = empty( $notice['class'] ) ? 'error' : $notice['class'];
241
+		$notice[ 'class' ] = empty( $notice[ 'class' ] ) ? 'error' : $notice[ 'class' ];
242 242
 
243
-		self::$admin_notices[] = $notice;
243
+		self::$admin_notices[ ] = $notice;
244 244
 	}
245 245
 }
246 246
 
Please login to merge, or discard this patch.
includes/extensions/edit-entry/class-edit-entry.php 3 patches
Doc Comments   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -64,6 +64,9 @@  discard block
 block discarded – undo
64 64
     }
65 65
 
66 66
 
67
+    /**
68
+     * @param string $component
69
+     */
67 70
     private function load_components( $component ) {
68 71
 
69 72
         $dir = trailingslashit( self::$file );
@@ -104,7 +107,7 @@  discard block
 block discarded – undo
104 107
 	 *
105 108
 	 * @param array $args Existing reserved args
106 109
 	 *
107
-	 * @return array
110
+	 * @return string[]
108 111
 	 */
109 112
 	public function add_reserved_arg( $args ) {
110 113
 
@@ -200,7 +203,7 @@  discard block
 block discarded – undo
200 203
      * "You can edit this post from the post page" fields, for example.
201 204
      *
202 205
      * @param $entry array Gravity Forms entry object
203
-     * @param $view_id int GravityView view id
206
+     * @param integer $view_id int GravityView view id
204 207
      * @param $post_id int GravityView Post ID where View may be embedded {@since 1.9.2}
205 208
      * @param string|array $field_values Parameters to pass in to the Edit Entry form to prefill data. Uses the same format as Gravity Forms "Allow field to be populated dynamically" {@since 1.9.2} {@see https://www.gravityhelp.com/documentation/article/allow-field-to-be-populated-dynamically/ }
206 209
      * @return string
@@ -303,7 +306,7 @@  discard block
 block discarded – undo
303 306
      * Needs to be used combined with GravityView_Edit_Entry::user_can_edit_entry for maximum security!!
304 307
      *
305 308
      * @param  array $entry Gravity Forms entry array
306
-     * @param \GV\View|int $view ID of the view you want to check visibility against {@since 1.9.2}. Required since 2.0
309
+     * @param integer $view ID of the view you want to check visibility against {@since 1.9.2}. Required since 2.0
307 310
      * @return bool
308 311
      */
309 312
     public static function check_user_cap_edit_entry( $entry, $view = 0 ) {
Please login to merge, or discard this patch.
Indentation   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -23,90 +23,90 @@  discard block
 block discarded – undo
23 23
 
24 24
 class GravityView_Edit_Entry {
25 25
 
26
-    /**
27
-     * @var string
28
-     */
26
+	/**
27
+	 * @var string
28
+	 */
29 29
 	static $file;
30 30
 
31 31
 	static $instance;
32 32
 
33
-    /**
34
-     * Component instances.
35
-     * @var array
36
-     */
37
-    public $instances = array();
33
+	/**
34
+	 * Component instances.
35
+	 * @var array
36
+	 */
37
+	public $instances = array();
38 38
 
39 39
 
40 40
 	function __construct() {
41 41
 
42
-        self::$file = plugin_dir_path( __FILE__ );
42
+		self::$file = plugin_dir_path( __FILE__ );
43 43
 
44
-        if( is_admin() ) {
45
-            $this->load_components( 'admin' );
46
-        }
44
+		if( is_admin() ) {
45
+			$this->load_components( 'admin' );
46
+		}
47 47
 
48 48
 		$this->load_components( 'locking' );
49 49
 
50
-        $this->load_components( 'render' );
50
+		$this->load_components( 'render' );
51 51
 
52
-        // If GF User Registration Add-on exists
53
-        $this->load_components( 'user-registration' );
52
+		// If GF User Registration Add-on exists
53
+		$this->load_components( 'user-registration' );
54 54
 
55
-        $this->add_hooks();
55
+		$this->add_hooks();
56 56
 
57 57
 		// Process hooks for addons that may or may not be present
58 58
 		$this->addon_specific_hooks();
59 59
 	}
60 60
 
61 61
 
62
-    static function getInstance() {
62
+	static function getInstance() {
63 63
 
64
-        if( empty( self::$instance ) ) {
65
-            self::$instance = new GravityView_Edit_Entry;
66
-        }
64
+		if( empty( self::$instance ) ) {
65
+			self::$instance = new GravityView_Edit_Entry;
66
+		}
67 67
 
68
-        return self::$instance;
69
-    }
68
+		return self::$instance;
69
+	}
70 70
 
71 71
 
72
-    private function load_components( $component ) {
72
+	private function load_components( $component ) {
73 73
 
74
-        $dir = trailingslashit( self::$file );
74
+		$dir = trailingslashit( self::$file );
75 75
 
76
-        $filename  = $dir . 'class-edit-entry-' . $component . '.php';
77
-        $classname = 'GravityView_Edit_Entry_' . str_replace( ' ', '_', ucwords( str_replace( '-', ' ', $component ) ) );
76
+		$filename  = $dir . 'class-edit-entry-' . $component . '.php';
77
+		$classname = 'GravityView_Edit_Entry_' . str_replace( ' ', '_', ucwords( str_replace( '-', ' ', $component ) ) );
78 78
 
79
-        // Loads component and pass extension's instance so that component can
80
-        // talk each other.
81
-        require_once $filename;
82
-        $this->instances[ $component ] = new $classname( $this );
83
-        $this->instances[ $component ]->load();
79
+		// Loads component and pass extension's instance so that component can
80
+		// talk each other.
81
+		require_once $filename;
82
+		$this->instances[ $component ] = new $classname( $this );
83
+		$this->instances[ $component ]->load();
84 84
 
85
-    }
85
+	}
86 86
 
87
-    private function add_hooks() {
87
+	private function add_hooks() {
88 88
 
89
-        // Add front-end access to Gravity Forms delete file action
90
-        add_action( 'wp_ajax_nopriv_rg_delete_file', array( 'GFForms', 'delete_file') );
89
+		// Add front-end access to Gravity Forms delete file action
90
+		add_action( 'wp_ajax_nopriv_rg_delete_file', array( 'GFForms', 'delete_file') );
91 91
 
92
-        // Make sure this hook is run for non-admins
93
-        add_action( 'wp_ajax_rg_delete_file', array( 'GFForms', 'delete_file') );
92
+		// Make sure this hook is run for non-admins
93
+		add_action( 'wp_ajax_rg_delete_file', array( 'GFForms', 'delete_file') );
94 94
 
95
-        add_filter( 'gravityview_blacklist_field_types', array( $this, 'modify_field_blacklist' ), 10, 2 );
95
+		add_filter( 'gravityview_blacklist_field_types', array( $this, 'modify_field_blacklist' ), 10, 2 );
96 96
 
97
-        // add template path to check for field
98
-        add_filter( 'gravityview_template_paths', array( $this, 'add_template_path' ) );
97
+		// add template path to check for field
98
+		add_filter( 'gravityview_template_paths', array( $this, 'add_template_path' ) );
99 99
 
100 100
 		add_filter( 'gravityview/field/is_visible', array( $this, 'maybe_not_visible' ), 10, 3 );
101 101
 
102 102
 		add_filter( 'gravityview/api/reserved_query_args', array( $this, 'add_reserved_arg' ) );
103 103
 
104
-	    add_action( 'template_redirect', function() {
105
-		    if ( ! isset( $_GET['gv-iframe'] ) ) {
106
-			    return;
107
-		    }
104
+		add_action( 'template_redirect', function() {
105
+			if ( ! isset( $_GET['gv-iframe'] ) ) {
106
+				return;
107
+			}
108 108
 
109
-		    // If user doesn't have appropriate permissions, die.
109
+			// If user doesn't have appropriate permissions, die.
110 110
 			if ( ! GFCommon::current_user_can_any( array( 'gravityforms_edit_forms', 'gravityforms_create_form', 'gravityforms_preview_forms' ) ) ) {
111 111
 				die( esc_html__( "You don't have adequate permission to preview forms.", 'gravityforms' ) );
112 112
 			}
@@ -231,9 +231,9 @@  discard block
 block discarded – undo
231 231
 </body>
232 232
 </html>
233 233
 <?php
234
-		    exit();
235
-	    } );
236
-    }
234
+			exit();
235
+		} );
236
+	}
237 237
 
238 238
 	/**
239 239
 	 * Adds "edit" to the list of internal reserved query args
@@ -304,74 +304,74 @@  discard block
 block discarded – undo
304 304
 		return false;
305 305
 	}
306 306
 
307
-    /**
308
-     * Include this extension templates path
309
-     * @param array $file_paths List of template paths ordered
310
-     */
311
-    public function add_template_path( $file_paths ) {
312
-
313
-        // Index 100 is the default GravityView template path.
314
-        $file_paths[ 110 ] = self::$file;
315
-
316
-        return $file_paths;
317
-    }
318
-
319
-    /**
320
-     *
321
-     * Return a well formatted nonce key according to GravityView Edit Entry protocol
322
-     *
323
-     * @param $view_id int GravityView view id
324
-     * @param $form_id int Gravity Forms form id
325
-     * @param $entry_id int Gravity Forms entry id
326
-     * @return string
327
-     */
328
-    public static function get_nonce_key( $view_id, $form_id, $entry_id ) {
329
-        return sprintf( 'edit_%d_%d_%d', $view_id, $form_id, $entry_id );
330
-    }
331
-
332
-
333
-    /**
334
-     * The edit entry link creates a secure link with a nonce
335
-     *
336
-     * It also mimics the URL structure Gravity Forms expects to have so that
337
-     * it formats the display of the edit form like it does in the backend, like
338
-     * "You can edit this post from the post page" fields, for example.
339
-     *
340
-     * @param $entry array Gravity Forms entry object
341
-     * @param $view_id int GravityView view id
342
-     * @param $post_id int GravityView Post ID where View may be embedded {@since 1.9.2}
343
-     * @param string|array $field_values Parameters to pass in to the Edit Entry form to prefill data. Uses the same format as Gravity Forms "Allow field to be populated dynamically" {@since 1.9.2} {@see https://www.gravityhelp.com/documentation/article/allow-field-to-be-populated-dynamically/ }
344
-     * @return string
345
-     */
346
-    public static function get_edit_link( $entry, $view_id, $post_id = null, $field_values = '' ) {
347
-
348
-        $nonce_key = self::get_nonce_key( $view_id, $entry['form_id'], $entry['id']  );
349
-
350
-        $base = gv_entry_link( $entry, $post_id ? : $view_id  );
351
-
352
-        $url = add_query_arg( array(
353
-            'edit' => wp_create_nonce( $nonce_key )
354
-        ), $base );
355
-
356
-        if( $post_id ) {
357
-	        $url = add_query_arg( array( 'gvid' => $view_id ), $url );
358
-        }
359
-
360
-	    /**
361
-	     * Allow passing params to dynamically populate entry with values
362
-	     * @since 1.9.2
363
-	     */
364
-	    if( !empty( $field_values ) ) {
365
-
366
-		    if( is_array( $field_values ) ) {
367
-			    // If already an array, no parse_str() needed
368
-			    $params = $field_values;
369
-		    } else {
370
-			    parse_str( $field_values, $params );
371
-		    }
372
-
373
-		    $url = add_query_arg( $params, $url );
374
-	    }
307
+	/**
308
+	 * Include this extension templates path
309
+	 * @param array $file_paths List of template paths ordered
310
+	 */
311
+	public function add_template_path( $file_paths ) {
312
+
313
+		// Index 100 is the default GravityView template path.
314
+		$file_paths[ 110 ] = self::$file;
315
+
316
+		return $file_paths;
317
+	}
318
+
319
+	/**
320
+	 *
321
+	 * Return a well formatted nonce key according to GravityView Edit Entry protocol
322
+	 *
323
+	 * @param $view_id int GravityView view id
324
+	 * @param $form_id int Gravity Forms form id
325
+	 * @param $entry_id int Gravity Forms entry id
326
+	 * @return string
327
+	 */
328
+	public static function get_nonce_key( $view_id, $form_id, $entry_id ) {
329
+		return sprintf( 'edit_%d_%d_%d', $view_id, $form_id, $entry_id );
330
+	}
331
+
332
+
333
+	/**
334
+	 * The edit entry link creates a secure link with a nonce
335
+	 *
336
+	 * It also mimics the URL structure Gravity Forms expects to have so that
337
+	 * it formats the display of the edit form like it does in the backend, like
338
+	 * "You can edit this post from the post page" fields, for example.
339
+	 *
340
+	 * @param $entry array Gravity Forms entry object
341
+	 * @param $view_id int GravityView view id
342
+	 * @param $post_id int GravityView Post ID where View may be embedded {@since 1.9.2}
343
+	 * @param string|array $field_values Parameters to pass in to the Edit Entry form to prefill data. Uses the same format as Gravity Forms "Allow field to be populated dynamically" {@since 1.9.2} {@see https://www.gravityhelp.com/documentation/article/allow-field-to-be-populated-dynamically/ }
344
+	 * @return string
345
+	 */
346
+	public static function get_edit_link( $entry, $view_id, $post_id = null, $field_values = '' ) {
347
+
348
+		$nonce_key = self::get_nonce_key( $view_id, $entry['form_id'], $entry['id']  );
349
+
350
+		$base = gv_entry_link( $entry, $post_id ? : $view_id  );
351
+
352
+		$url = add_query_arg( array(
353
+			'edit' => wp_create_nonce( $nonce_key )
354
+		), $base );
355
+
356
+		if( $post_id ) {
357
+			$url = add_query_arg( array( 'gvid' => $view_id ), $url );
358
+		}
359
+
360
+		/**
361
+		 * Allow passing params to dynamically populate entry with values
362
+		 * @since 1.9.2
363
+		 */
364
+		if( !empty( $field_values ) ) {
365
+
366
+			if( is_array( $field_values ) ) {
367
+				// If already an array, no parse_str() needed
368
+				$params = $field_values;
369
+			} else {
370
+				parse_str( $field_values, $params );
371
+			}
372
+
373
+			$url = add_query_arg( $params, $url );
374
+		}
375 375
 
376 376
 		/**
377 377
 		 * @filter `gravityview/edit/link` Filter the edit URL link.
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 		 * @param \GV\View $view The View.
381 381
 		 */
382 382
 		return apply_filters( 'gravityview/edit/link', $url, $entry, \GV\View::by_id( $view_id  ) );
383
-    }
383
+	}
384 384
 
385 385
 	/**
386 386
 	 * Edit mode doesn't allow certain field types.
@@ -435,19 +435,19 @@  discard block
 block discarded – undo
435 435
 	}
436 436
 
437 437
 
438
-    /**
439
-     * checks if user has permissions to edit a specific entry
440
-     *
441
-     * Needs to be used combined with GravityView_Edit_Entry::user_can_edit_entry for maximum security!!
442
-     *
443
-     * @param  array $entry Gravity Forms entry array
444
-     * @param \GV\View|int $view ID of the view you want to check visibility against {@since 1.9.2}. Required since 2.0
445
-     * @return bool
446
-     */
447
-    public static function check_user_cap_edit_entry( $entry, $view = 0 ) {
438
+	/**
439
+	 * checks if user has permissions to edit a specific entry
440
+	 *
441
+	 * Needs to be used combined with GravityView_Edit_Entry::user_can_edit_entry for maximum security!!
442
+	 *
443
+	 * @param  array $entry Gravity Forms entry array
444
+	 * @param \GV\View|int $view ID of the view you want to check visibility against {@since 1.9.2}. Required since 2.0
445
+	 * @return bool
446
+	 */
447
+	public static function check_user_cap_edit_entry( $entry, $view = 0 ) {
448 448
 
449
-        // No permission by default
450
-        $user_can_edit = false;
449
+		// No permission by default
450
+		$user_can_edit = false;
451 451
 
452 452
 		// get user_edit setting
453 453
 		if ( empty( $view ) ) {
@@ -465,60 +465,60 @@  discard block
 block discarded – undo
465 465
 			$user_edit = GVCommon::get_template_setting( $view_id, 'user_edit' );
466 466
 		}
467 467
 
468
-        // If they can edit any entries (as defined in Gravity Forms)
469
-        // Or if they can edit other people's entries
470
-        // Then we're good.
471
-        if( GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_others_entries' ), $entry['id'] ) ) {
468
+		// If they can edit any entries (as defined in Gravity Forms)
469
+		// Or if they can edit other people's entries
470
+		// Then we're good.
471
+		if( GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_others_entries' ), $entry['id'] ) ) {
472 472
 
473
-            gravityview()->log->debug( 'User has ability to edit all entries.' );
473
+			gravityview()->log->debug( 'User has ability to edit all entries.' );
474 474
 
475
-            $user_can_edit = true;
475
+			$user_can_edit = true;
476 476
 
477
-        } else if( !isset( $entry['created_by'] ) ) {
477
+		} else if( !isset( $entry['created_by'] ) ) {
478 478
 
479
-            gravityview()->log->error( 'Entry `created_by` doesn\'t exist.');
479
+			gravityview()->log->error( 'Entry `created_by` doesn\'t exist.');
480 480
 
481
-            $user_can_edit = false;
481
+			$user_can_edit = false;
482 482
 
483
-        } else {
483
+		} else {
484 484
 
485
-            $current_user = wp_get_current_user();
485
+			$current_user = wp_get_current_user();
486 486
 
487
-            // User edit is disabled
488
-            if( empty( $user_edit ) ) {
487
+			// User edit is disabled
488
+			if( empty( $user_edit ) ) {
489 489
 
490
-                gravityview()->log->debug( 'User Edit is disabled. Returning false.' );
490
+				gravityview()->log->debug( 'User Edit is disabled. Returning false.' );
491 491
 
492
-                $user_can_edit = false;
493
-            }
492
+				$user_can_edit = false;
493
+			}
494 494
 
495
-            // User edit is enabled and the logged-in user is the same as the user who created the entry. We're good.
496
-            else if( is_user_logged_in() && intval( $current_user->ID ) === intval( $entry['created_by'] ) ) {
495
+			// User edit is enabled and the logged-in user is the same as the user who created the entry. We're good.
496
+			else if( is_user_logged_in() && intval( $current_user->ID ) === intval( $entry['created_by'] ) ) {
497 497
 
498
-                gravityview()->log->debug( 'User {user_id} created the entry.', array( 'user_id', $current_user->ID ) );
498
+				gravityview()->log->debug( 'User {user_id} created the entry.', array( 'user_id', $current_user->ID ) );
499 499
 
500
-                $user_can_edit = true;
500
+				$user_can_edit = true;
501 501
 
502
-            } else if( ! is_user_logged_in() ) {
502
+			} else if( ! is_user_logged_in() ) {
503 503
 
504
-                gravityview()->log->debug( 'No user defined; edit entry requires logged in user' );
504
+				gravityview()->log->debug( 'No user defined; edit entry requires logged in user' );
505 505
 
506
-	            $user_can_edit = false; // Here just for clarity
507
-            }
506
+				$user_can_edit = false; // Here just for clarity
507
+			}
508 508
 
509
-        }
509
+		}
510 510
 
511
-        /**
512
-         * @filter `gravityview/edit_entry/user_can_edit_entry` Modify whether user can edit an entry.
513
-         * @since 1.15 Added `$entry` and `$view_id` parameters
514
-         * @param[in,out] boolean $user_can_edit Can the current user edit the current entry? (Default: false)
515
-         * @param[in] array $entry Gravity Forms entry array {@since 1.15}
516
-         * @param[in] int $view_id ID of the view you want to check visibility against {@since 1.15}
517
-         */
518
-        $user_can_edit = apply_filters( 'gravityview/edit_entry/user_can_edit_entry', $user_can_edit, $entry, $view_id );
511
+		/**
512
+		 * @filter `gravityview/edit_entry/user_can_edit_entry` Modify whether user can edit an entry.
513
+		 * @since 1.15 Added `$entry` and `$view_id` parameters
514
+		 * @param[in,out] boolean $user_can_edit Can the current user edit the current entry? (Default: false)
515
+		 * @param[in] array $entry Gravity Forms entry array {@since 1.15}
516
+		 * @param[in] int $view_id ID of the view you want to check visibility against {@since 1.15}
517
+		 */
518
+		$user_can_edit = apply_filters( 'gravityview/edit_entry/user_can_edit_entry', $user_can_edit, $entry, $view_id );
519 519
 
520
-        return (bool) $user_can_edit;
521
-    }
520
+		return (bool) $user_can_edit;
521
+	}
522 522
 
523 523
 
524 524
 
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 }
17 17
 
18 18
 // Needed to allow JS in the Close link because of esc_url()
19
-add_filter( 'kses_allowed_protocols', function($protocols) {
20
-	$protocols[] = 'javascript';
19
+add_filter( 'kses_allowed_protocols', function( $protocols ) {
20
+	$protocols[ ] = 'javascript';
21 21
 	return $protocols;
22 22
 });
23 23
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
         self::$file = plugin_dir_path( __FILE__ );
43 43
 
44
-        if( is_admin() ) {
44
+        if ( is_admin() ) {
45 45
             $this->load_components( 'admin' );
46 46
         }
47 47
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
     static function getInstance() {
63 63
 
64
-        if( empty( self::$instance ) ) {
64
+        if ( empty( self::$instance ) ) {
65 65
             self::$instance = new GravityView_Edit_Entry;
66 66
         }
67 67
 
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
     private function add_hooks() {
88 88
 
89 89
         // Add front-end access to Gravity Forms delete file action
90
-        add_action( 'wp_ajax_nopriv_rg_delete_file', array( 'GFForms', 'delete_file') );
90
+        add_action( 'wp_ajax_nopriv_rg_delete_file', array( 'GFForms', 'delete_file' ) );
91 91
 
92 92
         // Make sure this hook is run for non-admins
93
-        add_action( 'wp_ajax_rg_delete_file', array( 'GFForms', 'delete_file') );
93
+        add_action( 'wp_ajax_rg_delete_file', array( 'GFForms', 'delete_file' ) );
94 94
 
95 95
         add_filter( 'gravityview_blacklist_field_types', array( $this, 'modify_field_blacklist' ), 10, 2 );
96 96
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		add_filter( 'gravityview/api/reserved_query_args', array( $this, 'add_reserved_arg' ) );
103 103
 
104 104
 	    add_action( 'template_redirect', function() {
105
-		    if ( ! isset( $_GET['gv-iframe'] ) ) {
105
+		    if ( ! isset( $_GET[ 'gv-iframe' ] ) ) {
106 106
 			    return;
107 107
 		    }
108 108
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 $form_id = absint( rgget( 'id' ) );
128 128
 
129 129
 // Get form object.
130
-$form = RGFormsModel::get_form_meta( $_GET['id'] );
130
+$form = RGFormsModel::get_form_meta( $_GET[ 'id' ] );
131 131
 
132 132
 ?>
133 133
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 	return $original_url;
203 203
 }, 20, 3 );
204 204
 
205
-add_filter( 'gravityview/edit_entry/cancel_link', function ( $link ) {
205
+add_filter( 'gravityview/edit_entry/cancel_link', function( $link ) {
206 206
 	return '';
207 207
 } );
208 208
 
@@ -213,11 +213,11 @@  discard block
 block discarded – undo
213 213
 $gravityview_view->setCurrentEntry( $entry->as_entry() );
214 214
 $data = GravityView_View_Data::getInstance( $view );
215 215
 $loader = GravityView_Edit_Entry::getInstance();
216
-$render = $loader->instances['render'];
216
+$render = $loader->instances[ 'render' ];
217 217
 
218 218
 $render->init( $data, $entry, $view );
219 219
 
220
-remove_all_filters( 'clean_url');
220
+remove_all_filters( 'clean_url' );
221 221
 wp_print_footer_scripts();
222 222
 
223 223
 /**
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	 */
247 247
 	public function add_reserved_arg( $args ) {
248 248
 
249
-		$args[] = 'edit';
249
+		$args[ ] = 'edit';
250 250
 
251 251
 		return $args;
252 252
 	}
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
 	 */
258 258
 	private function addon_specific_hooks() {
259 259
 
260
-		if( class_exists( 'GFSignature' ) && is_callable( array( 'GFSignature', 'get_instance' ) ) ) {
261
-			add_filter('gform_admin_pre_render', array( GFSignature::get_instance(), 'edit_lead_script'));
260
+		if ( class_exists( 'GFSignature' ) && is_callable( array( 'GFSignature', 'get_instance' ) ) ) {
261
+			add_filter( 'gform_admin_pre_render', array( GFSignature::get_instance(), 'edit_lead_script' ) );
262 262
 		}
263 263
 
264 264
 	}
@@ -345,15 +345,15 @@  discard block
 block discarded – undo
345 345
      */
346 346
     public static function get_edit_link( $entry, $view_id, $post_id = null, $field_values = '' ) {
347 347
 
348
-        $nonce_key = self::get_nonce_key( $view_id, $entry['form_id'], $entry['id']  );
348
+        $nonce_key = self::get_nonce_key( $view_id, $entry[ 'form_id' ], $entry[ 'id' ] );
349 349
 
350
-        $base = gv_entry_link( $entry, $post_id ? : $view_id  );
350
+        $base = gv_entry_link( $entry, $post_id ?: $view_id );
351 351
 
352 352
         $url = add_query_arg( array(
353 353
             'edit' => wp_create_nonce( $nonce_key )
354 354
         ), $base );
355 355
 
356
-        if( $post_id ) {
356
+        if ( $post_id ) {
357 357
 	        $url = add_query_arg( array( 'gvid' => $view_id ), $url );
358 358
         }
359 359
 
@@ -361,9 +361,9 @@  discard block
 block discarded – undo
361 361
 	     * Allow passing params to dynamically populate entry with values
362 362
 	     * @since 1.9.2
363 363
 	     */
364
-	    if( !empty( $field_values ) ) {
364
+	    if ( ! empty( $field_values ) ) {
365 365
 
366
-		    if( is_array( $field_values ) ) {
366
+		    if ( is_array( $field_values ) ) {
367 367
 			    // If already an array, no parse_str() needed
368 368
 			    $params = $field_values;
369 369
 		    } else {
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 		 * @param array $entry The entry.
380 380
 		 * @param \GV\View $view The View.
381 381
 		 */
382
-		return apply_filters( 'gravityview/edit/link', $url, $entry, \GV\View::by_id( $view_id  ) );
382
+		return apply_filters( 'gravityview/edit/link', $url, $entry, \GV\View::by_id( $view_id ) );
383 383
     }
384 384
 
385 385
 	/**
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 	 */
391 391
 	public function modify_field_blacklist( $fields = array(), $context = NULL ) {
392 392
 
393
-		if( empty( $context ) || $context !== 'edit' ) {
393
+		if ( empty( $context ) || $context !== 'edit' ) {
394 394
 			return $fields;
395 395
 		}
396 396
 
@@ -468,15 +468,15 @@  discard block
 block discarded – undo
468 468
         // If they can edit any entries (as defined in Gravity Forms)
469 469
         // Or if they can edit other people's entries
470 470
         // Then we're good.
471
-        if( GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_others_entries' ), $entry['id'] ) ) {
471
+        if ( GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_others_entries' ), $entry[ 'id' ] ) ) {
472 472
 
473 473
             gravityview()->log->debug( 'User has ability to edit all entries.' );
474 474
 
475 475
             $user_can_edit = true;
476 476
 
477
-        } else if( !isset( $entry['created_by'] ) ) {
477
+        } else if ( ! isset( $entry[ 'created_by' ] ) ) {
478 478
 
479
-            gravityview()->log->error( 'Entry `created_by` doesn\'t exist.');
479
+            gravityview()->log->error( 'Entry `created_by` doesn\'t exist.' );
480 480
 
481 481
             $user_can_edit = false;
482 482
 
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
             $current_user = wp_get_current_user();
486 486
 
487 487
             // User edit is disabled
488
-            if( empty( $user_edit ) ) {
488
+            if ( empty( $user_edit ) ) {
489 489
 
490 490
                 gravityview()->log->debug( 'User Edit is disabled. Returning false.' );
491 491
 
@@ -493,13 +493,13 @@  discard block
 block discarded – undo
493 493
             }
494 494
 
495 495
             // User edit is enabled and the logged-in user is the same as the user who created the entry. We're good.
496
-            else if( is_user_logged_in() && intval( $current_user->ID ) === intval( $entry['created_by'] ) ) {
496
+            else if ( is_user_logged_in() && intval( $current_user->ID ) === intval( $entry[ 'created_by' ] ) ) {
497 497
 
498 498
                 gravityview()->log->debug( 'User {user_id} created the entry.', array( 'user_id', $current_user->ID ) );
499 499
 
500 500
                 $user_can_edit = true;
501 501
 
502
-            } else if( ! is_user_logged_in() ) {
502
+            } else if ( ! is_user_logged_in() ) {
503 503
 
504 504
                 gravityview()->log->debug( 'No user defined; edit entry requires logged in user' );
505 505
 
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
          */
518 518
         $user_can_edit = apply_filters( 'gravityview/edit_entry/user_can_edit_entry', $user_can_edit, $entry, $view_id );
519 519
 
520
-        return (bool) $user_can_edit;
520
+        return (bool)$user_can_edit;
521 521
     }
522 522
 
523 523
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-sequence.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		$this->label = esc_html__( 'Number Sequence', 'gravityview' );
42 42
 		$this->description = esc_html__( 'Display a sequential result number for each entry.', 'gravityview' );
43 43
 
44
-		add_filter( 'gravityview/metaboxes/tooltips', array( $this, 'field_tooltips') );
44
+		add_filter( 'gravityview/metaboxes/tooltips', array( $this, 'field_tooltips' ) );
45 45
 
46 46
 		add_filter( 'gravityview_entry_default_fields', array( $this, 'add_default_field' ), 10, 3 );
47 47
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 			return $entry_default_fields;
66 66
 		}
67 67
 
68
-		$entry_default_fields['sequence'] = array(
68
+		$entry_default_fields[ 'sequence' ] = array(
69 69
 			'label' => __( 'Result Number', 'gravityview' ),
70 70
 			'type'  => $this->name,
71 71
 			'desc'  => $this->description,
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
 
85 85
 		$return = $tooltips;
86 86
 
87
-		$return['reverse_sequence'] = array(
88
-			'title' => __('Reverse the order of the result numbers', 'gravityview'),
89
-			'value' => __('Output the number sequence in descending order. If enabled, numbers will count down from high to low.', 'gravityview'),
87
+		$return[ 'reverse_sequence' ] = array(
88
+			'title' => __( 'Reverse the order of the result numbers', 'gravityview' ),
89
+			'value' => __( 'Output the number sequence in descending order. If enabled, numbers will count down from high to low.', 'gravityview' ),
90 90
 		);
91 91
 
92 92
 		return $return;
@@ -94,13 +94,13 @@  discard block
 block discarded – undo
94 94
 
95 95
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
96 96
 
97
-		unset ( $field_options['search_filter'] );
97
+		unset ( $field_options[ 'search_filter' ] );
98 98
 
99 99
 		$new_fields = array(
100 100
 			'start' => array(
101 101
 				'type' => 'number',
102 102
 				'label' => __( 'First Number in the Sequence', 'gravityview' ),
103
-				'desc' => __('For each entry, the displayed number will increase by one. When displaying ten entries, the first entry will display "1", and the last entry will show "10".', 'gravityview'),
103
+				'desc' => __( 'For each entry, the displayed number will increase by one. When displaying ten entries, the first entry will display "1", and the last entry will show "10".', 'gravityview' ),
104 104
 				'value' => '1',
105 105
 				'merge_tags' => false,
106 106
 			),
@@ -156,17 +156,17 @@  discard block
 block discarded – undo
156 156
 		$return = $text;
157 157
 
158 158
 		$context = new \GV\Template_Context();
159
-		$context->view = \GV\View::by_id( $view_data['view_id'] );
159
+		$context->view = \GV\View::by_id( $view_data[ 'view_id' ] );
160 160
 		$context->entry = \GV\GF_Entry::from_entry( $entry );
161 161
 
162 162
 		$gv_field = \GV\Internal_Field::by_id( 'sequence' );
163 163
 		$merge_tag_context = \GV\Utils::get( $legacy_field, 'UID' );
164
-		$merge_tag_context = $entry['id'] . "/{$merge_tag_context}";
164
+		$merge_tag_context = $entry[ 'id' ] . "/{$merge_tag_context}";
165 165
 
166 166
 		foreach ( $matches as $match ) {
167 167
 
168
-			$full_tag = $match[0];
169
-			$property = $match[1];
168
+			$full_tag = $match[ 0 ];
169
+			$property = $match[ 1 ];
170 170
 
171 171
 			$gv_field->reverse = false;
172 172
 			$gv_field->start = 1;
@@ -185,12 +185,12 @@  discard block
 block discarded – undo
185 185
 
186 186
 				// If there is a field with the ID of the start number, the merge tag won't work.
187 187
 				// In that case, you can use "=" instead: `{sequence start=10}`
188
-				if( 1 === sizeof( $maybe_start ) ) {
188
+				if ( 1 === sizeof( $maybe_start ) ) {
189 189
 					$maybe_start = explode( '=', $modifier );
190 190
 				}
191 191
 
192 192
 				if ( 'start' === rgar( $maybe_start, 0 ) && is_numeric( rgar( $maybe_start, 1 ) ) ) {
193
-					$gv_field->start = (int) rgar( $maybe_start, 1 );
193
+					$gv_field->start = (int)rgar( $maybe_start, 1 );
194 194
 				}
195 195
 			}
196 196
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 			$merge_tag_context_modifiers = $merge_tag_context . '/' . var_export( $gv_field->reverse, true ) . '/' . $gv_field->start;
202 202
 
203 203
 			if ( ! isset( $merge_tag_sequences[ $merge_tag_context_modifiers ] ) ) {
204
-				$gv_field->UID = $legacy_field['UID'] . '/' . var_export( $gv_field->reverse, true ) . '/' . $gv_field->start;
204
+				$gv_field->UID = $legacy_field[ 'UID' ] . '/' . var_export( $gv_field->reverse, true ) . '/' . $gv_field->start;
205 205
 				$context->field = $gv_field;
206 206
 				$sequence = $merge_tag_sequences[ $merge_tag_context_modifiers ] = $this->get_sequence( $context );
207 207
 			} else {
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 			$total = $context->view->get_entries()->total();
247 247
 			remove_filter( 'gform_gf_query_sql', $callback );
248 248
 
249
-			unset( $sql_query['paginate'] );
249
+			unset( $sql_query[ 'paginate' ] );
250 250
 
251 251
 			global $wpdb;
252 252
 
Please login to merge, or discard this patch.
includes/admin/metaboxes/views/select-template.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -26,52 +26,52 @@
 block discarded – undo
26 26
 
27 27
 <?php // list all the available templates (type= fresh or custom ) ?>
28 28
 <div class="gv-grid">
29
-	<?php foreach( $templates as $id => $template ) {
29
+	<?php foreach ( $templates as $id => $template ) {
30 30
 		$selected     = ( $id == $current_template ) ? ' gv-selected' : '';
31
-		$placeholder  = ! empty( $template['buy_source'] );
32
-		$is_included  = ! empty( $template['included'] );
31
+		$placeholder  = ! empty( $template[ 'buy_source' ] );
32
+		$is_included  = ! empty( $template[ 'included' ] );
33 33
 		$plugin_data  = GravityView_Admin_Installer::get_wp_plugins_data( \GV\Utils::get( $template, 'textdomain', '' ) );
34 34
 		$button_text  = empty( $plugin_data ) ? esc_html__( 'Install Layout', 'gravityview' ) : esc_html__( 'Activate & Select Layout', 'gravityview' );
35 35
 		$button_class = 'gv-layout-' . ( empty( $plugin_data ) ? 'install' : 'activate' );
36
-		$template_path = isset($plugin_data['path']) ? $plugin_data['path'] : '';
36
+		$template_path = isset( $plugin_data[ 'path' ] ) ? $plugin_data[ 'path' ] : '';
37 37
 
38 38
 		?>
39 39
 		<div class="gv-grid-col-1-4">
40
-			<div class="gv-view-types-module<?php echo $selected; if( $placeholder ) { echo ' gv-view-template-placeholder'; } ?>" data-filter="<?php echo esc_attr( $template['type'] ); ?>">
40
+			<div class="gv-view-types-module<?php echo $selected; if ( $placeholder ) { echo ' gv-view-template-placeholder'; } ?>" data-filter="<?php echo esc_attr( $template[ 'type' ] ); ?>">
41 41
 				<div class="gv-view-types-normal">
42
-					<img src="<?php echo esc_url( $template['logo'] ); ?>" alt="<?php echo esc_attr( $template['label'] ); ?>">
43
-					<h5><?php echo esc_html( $template['label'] ); ?></h5>
44
-					<p class="description"><?php echo esc_html( $template['description'] ); ?></p>
42
+					<img src="<?php echo esc_url( $template[ 'logo' ] ); ?>" alt="<?php echo esc_attr( $template[ 'label' ] ); ?>">
43
+					<h5><?php echo esc_html( $template[ 'label' ] ); ?></h5>
44
+					<p class="description"><?php echo esc_html( $template[ 'description' ] ); ?></p>
45 45
 				</div>
46 46
 				<div class="gv-view-types-hover">
47 47
 					<div>
48 48
 						<?php
49
-						if( $is_included ) {
49
+						if ( $is_included ) {
50 50
 						?>
51 51
 							<p><a href="<?php echo esc_url( admin_url( 'edit.php?post_type=gravityview&page=gv-admin-installer' ) ); ?>" class="button button-secondary button-hero <?php echo $button_class; ?>" rel="internal" data-template-path="<?php echo $template_path; ?>"><?php echo $button_text; ?></a></p>
52
-							<?php if( !empty( $template['license'] ) ) { ?>
53
-								<p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gravityview' ), esc_html( str_replace( ' ', '&nbsp;', $template['license'] ) ) ); ?></p>
52
+							<?php if ( ! empty( $template[ 'license' ] ) ) { ?>
53
+								<p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gravityview' ), esc_html( str_replace( ' ', '&nbsp;', $template[ 'license' ] ) ) ); ?></p>
54 54
 							<?php } ?>
55 55
 						<?php
56
-						} elseif( $placeholder ) {
57
-							$utm_string = '?utm_source=plugin&utm_medium=buy_now&utm_campaign=view_type&utm_term=' . urlencode( $template['license'] ) . '&utm_content=' . urlencode( $template['slug'] );
56
+						} elseif ( $placeholder ) {
57
+							$utm_string = '?utm_source=plugin&utm_medium=buy_now&utm_campaign=view_type&utm_term=' . urlencode( $template[ 'license' ] ) . '&utm_content=' . urlencode( $template[ 'slug' ] );
58 58
 							?>
59
-							<p><a href="<?php echo esc_url( $template['buy_source'] ); ?>" class="button button-primary button-hero" rel="noreferrer noopener external"><?php esc_html_e( 'Buy Now', 'gravityview'); ?></a></p>
59
+							<p><a href="<?php echo esc_url( $template[ 'buy_source' ] ); ?>" class="button button-primary button-hero" rel="noreferrer noopener external"><?php esc_html_e( 'Buy Now', 'gravityview' ); ?></a></p>
60 60
 
61
-							<?php if( !empty( $template['preview'] ) ) { ?>
62
-								<p><a href="<?php echo esc_url( $template['preview'] ); ?>" rel="noreferrer noopener external" class="button button-secondary"><i class="dashicons dashicons-external" style="vertical-align: middle;" title="<?php esc_html_e( 'View a live demo of this layout', 'gravityview'); ?>"></i> <?php esc_html_e( 'Try a demo', 'gravityview' ); ?></a></p>
61
+							<?php if ( ! empty( $template[ 'preview' ] ) ) { ?>
62
+								<p><a href="<?php echo esc_url( $template[ 'preview' ] ); ?>" rel="noreferrer noopener external" class="button button-secondary"><i class="dashicons dashicons-external" style="vertical-align: middle;" title="<?php esc_html_e( 'View a live demo of this layout', 'gravityview' ); ?>"></i> <?php esc_html_e( 'Try a demo', 'gravityview' ); ?></a></p>
63 63
 							<?php } ?>
64 64
 
65
-							<?php if( ! empty( $template['license'] ) ) { ?>
66
-								<p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gravityview' ), '<a href="https://gravityview.co/pricing/' . esc_attr( $utm_string ) . '" rel="noreferrer noopener external">' . esc_html( str_replace( ' ', '&nbsp;', $template['license'] ) ) . '</a>' ); ?></p>
65
+							<?php if ( ! empty( $template[ 'license' ] ) ) { ?>
66
+								<p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gravityview' ), '<a href="https://gravityview.co/pricing/' . esc_attr( $utm_string ) . '" rel="noreferrer noopener external">' . esc_html( str_replace( ' ', '&nbsp;', $template[ 'license' ] ) ) . '</a>' ); ?></p>
67 67
 							<?php } ?>
68 68
 						<?php }
69 69
 
70
-						if ($placeholder || $is_included) { ?> </div><div class="hidden"> <?php } ?>
70
+						if ( $placeholder || $is_included ) { ?> </div><div class="hidden"> <?php } ?>
71 71
 
72
-                        <p><a href="#gv_select_template" role="button" class="gv_select_template button button-hero button-primary" data-templateid="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Select', 'gravityview'); ?></a></p>
73
-                        <?php if( !empty( $template['preview'] ) ) { ?>
74
-                            <a href="<?php echo esc_url( $template['preview'] ); ?>" rel="external" class="gv-site-preview"><i class="dashicons dashicons-admin-links" title="<?php esc_html_e( 'View a live demo of this preset', 'gravityview'); ?>"></i></a>
72
+                        <p><a href="#gv_select_template" role="button" class="gv_select_template button button-hero button-primary" data-templateid="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Select', 'gravityview' ); ?></a></p>
73
+                        <?php if ( ! empty( $template[ 'preview' ] ) ) { ?>
74
+                            <a href="<?php echo esc_url( $template[ 'preview' ] ); ?>" rel="external" class="gv-site-preview"><i class="dashicons dashicons-admin-links" title="<?php esc_html_e( 'View a live demo of this preset', 'gravityview' ); ?>"></i></a>
75 75
                         <?php } ?>
76 76
 					</div>
77 77
 				</div>
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-consent.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,13 +97,13 @@
 block discarded – undo
97 97
 		// Set the $_field_id var
98 98
 		$field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id );
99 99
 
100
-		if( floor( $field_id ) !== floatval( $field_id ) ) {
100
+		if ( floor( $field_id ) !== floatval( $field_id ) ) {
101 101
 			$default = 'tick';
102 102
 		} else {
103 103
 			$default = 'both';
104 104
 		}
105 105
 
106
-		$field_options['choice_display'] = array(
106
+		$field_options[ 'choice_display' ] = array(
107 107
 			'type'    => 'radio',
108 108
 			'class'   => 'vertical',
109 109
 			'label'   => __( 'What should be displayed:', 'gravityview' ),
Please login to merge, or discard this patch.
includes/admin/class-gravityview-admin-view-field.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -14,42 +14,42 @@
 block discarded – undo
14 14
 
15 15
 		$field_info_items = array();
16 16
 
17
-		if( !empty( $this->item['adminLabel'] ) ) {
18
-			$field_info_items[] = array(
19
-				'value' => sprintf( __('Admin Label: %s', 'gravityview' ), $this->item['adminLabel'] ),
17
+		if ( ! empty( $this->item[ 'adminLabel' ] ) ) {
18
+			$field_info_items[ ] = array(
19
+				'value' => sprintf( __( 'Admin Label: %s', 'gravityview' ), $this->item[ 'adminLabel' ] ),
20 20
 				'class'	=> 'gv-sublabel'
21 21
 			);
22 22
 		}
23 23
 
24 24
 		// Fields with IDs, not like Source URL or Entry ID
25
-		if( is_numeric( $this->id ) ) {
25
+		if ( is_numeric( $this->id ) ) {
26 26
 
27
-			$field_type_title = GFCommon::get_field_type_title( $this->item['input_type'] );
27
+			$field_type_title = GFCommon::get_field_type_title( $this->item[ 'input_type' ] );
28 28
 
29
-			if ( ! empty( $this->item['parent'] ) ) {
30
-				$field_info_items[] = array(
31
-					'value' => sprintf( esc_html__( 'Parent: %s', 'gravityview' ), esc_attr( $this->item['parent']['label'] ) ),
29
+			if ( ! empty( $this->item[ 'parent' ] ) ) {
30
+				$field_info_items[ ] = array(
31
+					'value' => sprintf( esc_html__( 'Parent: %s', 'gravityview' ), esc_attr( $this->item[ 'parent' ][ 'label' ] ) ),
32 32
 				);
33 33
 			}
34 34
 
35
-			$field_info_items[] = array(
36
-				'value' => sprintf( __('Type: %s', 'gravityview'), $field_type_title ),
37
-				'hide_in_picker' => ! empty( $this->item['parent'] ),
35
+			$field_info_items[ ] = array(
36
+				'value' => sprintf( __( 'Type: %s', 'gravityview' ), $field_type_title ),
37
+				'hide_in_picker' => ! empty( $this->item[ 'parent' ] ),
38 38
 			);
39 39
 
40
-			$field_info_items[] = array(
41
-				'value' => sprintf( __('Field ID: %s', 'gravityview'), $this->id ),
40
+			$field_info_items[ ] = array(
41
+				'value' => sprintf( __( 'Field ID: %s', 'gravityview' ), $this->id ),
42 42
 			);
43 43
 		}
44 44
 
45
-		if( !empty( $this->item['desc'] ) ) {
46
-			$field_info_items[] = array(
47
-				'value' => $this->item['desc']
45
+		if ( ! empty( $this->item[ 'desc' ] ) ) {
46
+			$field_info_items[ ] = array(
47
+				'value' => $this->item[ 'desc' ]
48 48
 			);
49 49
 		}
50 50
 
51
-		$field_info_items[] = array(
52
-			'value'          => sprintf( __('Form ID: %s', 'gravityview' ), $this->form_id ),
51
+		$field_info_items[ ] = array(
52
+			'value'          => sprintf( __( 'Form ID: %s', 'gravityview' ), $this->form_id ),
53 53
 			'hide_in_picker' => true,
54 54
 		);
55 55
 
Please login to merge, or discard this patch.