Completed
Push — develop ( 4ae616...7e153f )
by Zack
17:12
created
includes/admin/entry-list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 		add_action( 'gform_entries_first_column_actions', array( $this, 'add_edit_link' ), 10, 5 );
12 12
 
13 13
 		// Add script to enable edit link
14
-		add_action( 'admin_head', array( $this, 'add_edit_script') );
14
+		add_action( 'admin_head', array( $this, 'add_edit_script' ) );
15 15
 	}
16 16
 
17 17
 	/**
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
 			'page' => 'gf_entries',
61 61
 			'view' => 'entry',
62 62
 			'id'	=> (int)$form_id,
63
-			'lid'	=>	(int)$lead["id"],
63
+			'lid'	=>	(int)$lead[ "id" ],
64 64
 			'screen_mode'	=> 'edit',
65 65
 		);
66 66
 		?>
67 67
 
68 68
 		<span class="edit edit_entry">
69 69
 			|
70
-		    <a title="<?php esc_attr_e( 'Edit this entry', 'gravityview'); ?>" href="<?php echo esc_url( add_query_arg( $params, admin_url( 'admin.php?page='.$query_string ) ) ); ?>"><?php esc_html_e( 'Edit', 'gravityview' ); ?></a>
70
+		    <a title="<?php esc_attr_e( 'Edit this entry', 'gravityview' ); ?>" href="<?php echo esc_url( add_query_arg( $params, admin_url( 'admin.php?page=' . $query_string ) ) ); ?>"><?php esc_html_e( 'Edit', 'gravityview' ); ?></a>
71 71
 		</span>
72 72
 		<?php
73 73
 	}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-fileupload.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -26,21 +26,21 @@  discard block
 block discarded – undo
26 26
 
27 27
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
28 28
 
29
-		unset( $field_options['search_filter'] );
29
+		unset( $field_options[ 'search_filter' ] );
30 30
 
31
-		if( 'edit' === $context ) {
31
+		if ( 'edit' === $context ) {
32 32
 			return $field_options;
33 33
 		}
34 34
 
35
-		$add_options['link_to_file'] = array(
35
+		$add_options[ 'link_to_file' ] = array(
36 36
 			'type' => 'checkbox',
37 37
 			'label' => __( 'Display as a Link:', 'gravityview' ),
38
-			'desc' => __('Display the uploaded files as links, rather than embedded content.', 'gravityview'),
38
+			'desc' => __( 'Display the uploaded files as links, rather than embedded content.', 'gravityview' ),
39 39
 			'value' => false,
40 40
 			'merge_tags' => false,
41 41
 		);
42 42
 
43
-		$add_options['image_width'] = array(
43
+		$add_options[ 'image_width' ] = array(
44 44
 			'type' => 'text',
45 45
 			'label' => __( 'Custom Width:', 'gravityview' ),
46 46
 			'desc' => __( 'Override the default image width (250).', 'gravityview' ),
@@ -129,14 +129,14 @@  discard block
 block discarded – undo
129 129
 			$base_id = null;
130 130
 
131 131
 			$is_single = gravityview_get_context() === 'single';
132
-			$lightbox = ! empty( $gravityview_view->atts['lightbox'] );
132
+			$lightbox = ! empty( $gravityview_view->atts[ 'lightbox' ] );
133 133
 			$field_compat = $gravityview_view->getCurrentField();
134 134
 		}
135 135
 
136 136
 		$output_arr = array();
137 137
 
138 138
 		// Get an array of file paths for the field.
139
-		$file_paths = \GV\Utils::get( $field , 'multipleFiles' ) ? json_decode( $value ) : array( $value );
139
+		$file_paths = \GV\Utils::get( $field, 'multipleFiles' ) ? json_decode( $value ) : array( $value );
140 140
 
141 141
 		// The $value JSON was probably truncated; let's check lead_detail_long.
142 142
 		if ( ! is_array( $file_paths ) ) {
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 			$rendered = null;
157 157
 
158 158
 			// If the site is HTTPS, use HTTPS
159
-			if ( function_exists('set_url_scheme') ) {
159
+			if ( function_exists( 'set_url_scheme' ) ) {
160 160
 				$file_path = set_url_scheme( $file_path );
161 161
 			}
162 162
 
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 			$file_path_info = pathinfo( $file_path );
168 168
 
169 169
 			// If pathinfo() gave us the extension of the file, run the switch statement using that.
170
-			$extension = empty( $file_path_info['extension'] ) ? NULL : strtolower( $file_path_info['extension'] );
171
-			$basename = $file_path_info['basename'];
170
+			$extension = empty( $file_path_info[ 'extension' ] ) ? NULL : strtolower( $file_path_info[ 'extension' ] );
171
+			$basename = $file_path_info[ 'basename' ];
172 172
 
173 173
 			// Get the secure download URL
174 174
 			$is_secure = false;
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 					 */
209 209
 					$audio_settings = apply_filters( 'gravityview_audio_settings', array(
210 210
 						'src' => $insecure_file_path, // Needs to be insecure path so WP can parse extension
211
-						'class' => 'wp-audio-shortcode gv-audio gv-field-id-'.$field_settings['id']
211
+						'class' => 'wp-audio-shortcode gv-audio gv-field-id-' . $field_settings[ 'id' ]
212 212
 					), $context );
213 213
 
214 214
 					/**
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 					 */
245 245
 					$video_settings = apply_filters( 'gravityview_video_settings', array(
246 246
 						'src' => $insecure_file_path, // Needs to be insecure path so WP can parse extension
247
-						'class' => 'wp-video-shortcode gv-video gv-field-id-'.$field_settings['id']
247
+						'class' => 'wp-video-shortcode gv-video gv-field-id-' . $field_settings[ 'id' ]
248 248
 					), $context );
249 249
 
250 250
 					/**
@@ -275,20 +275,20 @@  discard block
 block discarded – undo
275 275
 					$file_path = add_query_arg( array( 'gv-iframe' => 'true' ), $file_path );
276 276
 				}
277 277
 
278
-				$field_settings['link_to_file'] = true;
278
+				$field_settings[ 'link_to_file' ] = true;
279 279
 
280 280
 			// Images
281 281
 			} else if ( in_array( $extension, array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' ) ) ) {
282 282
 				$width = \GV\Utils::get( $field_settings, 'image_width', 250 );
283 283
 				$image_atts = array(
284 284
 					'src'   => $file_path,
285
-					'class' => 'gv-image gv-field-id-' . $field_settings['id'],
286
-					'alt'   => $field_settings['label'],
287
-					'width' => ( $is_single ? null : ( $width ? $width: 250 ) )
285
+					'class' => 'gv-image gv-field-id-' . $field_settings[ 'id' ],
286
+					'alt'   => $field_settings[ 'label' ],
287
+					'width' => ( $is_single ? null : ( $width ? $width : 250 ) )
288 288
 				);
289 289
 
290 290
 				if ( $is_secure ) {
291
-					$image_atts['validate_src'] = false;
291
+					$image_atts[ 'validate_src' ] = false;
292 292
 				}
293 293
 
294 294
 				/**
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 
310 310
 				unset( $gv_entry );
311 311
 
312
-				if ( $lightbox && empty( $field_settings['show_as_link'] ) ) {
312
+				if ( $lightbox && empty( $field_settings[ 'show_as_link' ] ) ) {
313 313
 					$lightbox_link_atts = array(
314 314
 						'rel'   => sprintf( "%s-%s", $gv_class, $entry_slug ),
315 315
 						'class' => '',
@@ -323,13 +323,13 @@  discard block
 block discarded – undo
323 323
 				}
324 324
 
325 325
 				// Show as link should render the image regardless.
326
-				if ( ! empty( $field_settings['show_as_link'] ) ) {
326
+				if ( ! empty( $field_settings[ 'show_as_link' ] ) ) {
327 327
 					$text = $rendered;
328 328
 				}
329 329
 			}
330 330
 			// For all other non-media file types (ZIP, for example), always show as a link regardless of setting.
331 331
 			else {
332
-				$field_settings['link_to_file'] = true;
332
+				$field_settings[ 'link_to_file' ] = true;
333 333
 				$disable_lightbox = true;
334 334
 			}
335 335
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 			$disable_wrapped_link = apply_filters( 'gravityview/fields/fileupload/disable_link', false, $field_compat, $context );
346 346
 
347 347
 			// Output textualized content where
348
-			if ( ! $disable_wrapped_link && ( ! empty( $field_settings['link_to_file'] ) || ! empty( $field_settings['show_as_link'] ) ) ) {
348
+			if ( ! $disable_wrapped_link && ( ! empty( $field_settings[ 'link_to_file' ] ) || ! empty( $field_settings[ 'show_as_link' ] ) ) ) {
349 349
 				/**
350 350
 				 * Modify the link text (defaults to the file name)
351 351
 				 *
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 				 */
359 359
 				$content = apply_filters( 'gravityview/fields/fileupload/link_content', $text, $field_compat, $context );
360 360
 
361
-				if ( empty( $field_settings['show_as_link'] ) ) {
361
+				if ( empty( $field_settings[ 'show_as_link' ] ) ) {
362 362
 					/**
363 363
 					 * @filter `gravityview/fields/fileupload/link_atts` Modify the link attributes for a file upload field
364 364
 					 * @since 2.0 Added $context
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 				$content = empty( $rendered ) ? $text : $rendered;
380 380
 			}
381 381
 
382
-			$output_arr[] = array(
382
+			$output_arr[ ] = array(
383 383
 				'file_path' => $file_path,
384 384
 				'content' => $content
385 385
 			);
Please login to merge, or discard this patch.
includes/presets/register-default-templates.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
 		'GravityView_DataTables_Template' => array(
60 60
 			'slug' => 'dt_placeholder',
61 61
 			'label' =>  __( 'DataTables Table', 'gv-datatables', 'gravityview' ),
62
-			'description' => __('Display items in a dynamic table powered by DataTables.', 'gravityview'),
63
-			'logo' => plugins_url('assets/images/templates/logo-datatables.png', GRAVITYVIEW_FILE ),
62
+			'description' => __( 'Display items in a dynamic table powered by DataTables.', 'gravityview' ),
63
+			'logo' => plugins_url( 'assets/images/templates/logo-datatables.png', GRAVITYVIEW_FILE ),
64 64
 			'buy_source' => 'https://gravityview.co/pricing/?utm_source=plugin&utm_medium=buy_now&utm_campaign=view_type&utm_term=datatables',
65 65
 			'preview' => 'https://try.gravityview.co/demo/view/datatables/?utm_source=plugin&utm_medium=try_demo&utm_campaign=view_type&utm_term=datatables',
66 66
 			'license' => esc_html__( 'All Access', 'gravityview' ),
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
 				continue;
103 103
 			}
104 104
 
105
-			$license_price_id = (int) \GV\Utils::get( $license, 'price_id', 0 );
106
-			$placeholder_price_id = (int) \GV\Utils::get( $placeholder, 'price_id' );
105
+			$license_price_id = (int)\GV\Utils::get( $license, 'price_id', 0 );
106
+			$placeholder_price_id = (int)\GV\Utils::get( $placeholder, 'price_id' );
107 107
 
108
-			$placeholder['type']     = 'custom';
109
-			$placeholder['included'] = ( $license_price_id >= $placeholder_price_id );
108
+			$placeholder[ 'type' ]     = 'custom';
109
+			$placeholder[ 'included' ] = ( $license_price_id >= $placeholder_price_id );
110 110
 
111
-			new GravityView_Placeholder_Template( $placeholder['slug'], $placeholder );
111
+			new GravityView_Placeholder_Template( $placeholder[ 'slug' ], $placeholder );
112 112
 		}
113 113
 
114 114
 	} catch ( Exception $exception ) {
Please login to merge, or discard this patch.
includes/extensions/edit-entry/class-edit-entry-admin.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
     function load() {
26 26
 
27
-        if( !is_admin() ) {
27
+        if ( ! is_admin() ) {
28 28
             return;
29 29
         }
30 30
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         add_filter( 'gravityview_template_edit_link_options', array( $this, 'edit_link_field_options' ), 10, 5 );
39 39
 
40 40
         // add tooltips
41
-        add_filter( 'gravityview/metaboxes/tooltips', array( $this, 'tooltips') );
41
+        add_filter( 'gravityview/metaboxes/tooltips', array( $this, 'tooltips' ) );
42 42
 
43 43
         // custom fields' options for zone EDIT
44 44
         add_filter( 'gravityview_template_field_options', array( $this, 'field_options' ), 10, 6 );
@@ -77,12 +77,12 @@  discard block
 block discarded – undo
77 77
      */
78 78
     function add_default_field( $entry_default_fields, $form = array(), $zone = '' ) {
79 79
 
80
-        if( $zone !== 'edit' ) {
80
+        if ( $zone !== 'edit' ) {
81 81
 
82
-            $entry_default_fields['edit_link'] = array(
83
-                'label' => __('Link to Edit Entry', 'gravityview'),
82
+            $entry_default_fields[ 'edit_link' ] = array(
83
+                'label' => __( 'Link to Edit Entry', 'gravityview' ),
84 84
                 'type' => 'edit_link',
85
-                'desc'	=> __('A link to edit the entry. Visible based on View settings.', 'gravityview'),
85
+                'desc'	=> __( 'A link to edit the entry. Visible based on View settings.', 'gravityview' ),
86 86
                 'icon' => 'dashicons-welcome-write-blog',
87 87
             );
88 88
 
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
         $caps = $visibility_caps;
108 108
 
109 109
         // If we're configuring fields in the edit context, we want a limited selection
110
-        if( $context === 'edit' ) {
110
+        if ( $context === 'edit' ) {
111 111
 
112 112
             // Remove other built-in caps.
113
-            unset( $caps['publish_posts'], $caps['gravityforms_view_entries'], $caps['delete_others_posts'] );
113
+            unset( $caps[ 'publish_posts' ], $caps[ 'gravityforms_view_entries' ], $caps[ 'delete_others_posts' ] );
114 114
 
115
-            $caps['read'] = _x('Entry Creator','User capability', 'gravityview');
115
+            $caps[ 'read' ] = _x( 'Entry Creator', 'User capability', 'gravityview' );
116 116
         }
117 117
 
118 118
         return $caps;
@@ -132,20 +132,20 @@  discard block
 block discarded – undo
132 132
     function edit_link_field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
133 133
 
134 134
         // Always a link, never a filter
135
-        unset( $field_options['show_as_link'], $field_options['search_filter'] );
135
+        unset( $field_options[ 'show_as_link' ], $field_options[ 'search_filter' ] );
136 136
 
137 137
         // Edit Entry link should only appear to visitors capable of editing entries
138
-        unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] );
138
+        unset( $field_options[ 'only_loggedin' ], $field_options[ 'only_loggedin_cap' ] );
139 139
 
140
-        $add_option['edit_link'] = array(
140
+        $add_option[ 'edit_link' ] = array(
141 141
             'type' => 'text',
142 142
             'label' => __( 'Edit Link Text', 'gravityview' ),
143 143
             'desc' => NULL,
144
-            'value' => __('Edit Entry', 'gravityview'),
144
+            'value' => __( 'Edit Entry', 'gravityview' ),
145 145
             'merge_tags' => true,
146 146
         );
147 147
 
148
-	    $add_option['new_window'] = array(
148
+	    $add_option[ 'new_window' ] = array(
149 149
 		    'type' => 'checkbox',
150 150
 		    'label' => __( 'Open link in a new tab or window?', 'gravityview' ),
151 151
 		    'value' => false,
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
 
166 166
         $return = $tooltips;
167 167
 
168
-        $return['allow_edit_cap'] = array(
169
-            'title' => __('Limiting Edit Access', 'gravityview'),
170
-            'value' => __('Change this setting if you don\'t want the user who created the entry to be able to edit this field.', 'gravityview'),
168
+        $return[ 'allow_edit_cap' ] = array(
169
+            'title' => __( 'Limiting Edit Access', 'gravityview' ),
170
+            'value' => __( 'Change this setting if you don\'t want the user who created the entry to be able to edit this field.', 'gravityview' ),
171 171
         );
172 172
 
173 173
         return $return;
@@ -188,12 +188,12 @@  discard block
 block discarded – undo
188 188
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
189 189
 
190 190
         // We only want to modify the settings for the edit context
191
-        if( 'edit' !== $context ) {
191
+        if ( 'edit' !== $context ) {
192 192
             return $field_options;
193 193
         }
194 194
 
195 195
         //  Entry field is only for logged in users
196
-        unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] );
196
+        unset( $field_options[ 'only_loggedin' ], $field_options[ 'only_loggedin_cap' ] );
197 197
 
198 198
         $add_options = array(
199 199
             'allow_edit_cap' => array(
Please login to merge, or discard this patch.