Completed
Pull Request — develop (#1577)
by Zack
15:52
created
includes/class-admin-approve-entries.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -361,14 +361,14 @@  discard block
 block discarded – undo
361 361
 	/**
362 362
 	 * update_approved function.
363 363
 	 *
364
-     * @since 1.18 Moved to GravityView_Entry_Approval::update_approved
364
+	 * @since 1.18 Moved to GravityView_Entry_Approval::update_approved
365 365
 	 * @see GravityView_Entry_Approval::update_approved
366
-     *
366
+	 *
367 367
 	 * @param int $entry_id (default: 0)
368 368
 	 * @param int $approved (default: 0)
369 369
 	 * @param int $form_id (default: 0)
370 370
 	 * @param int $approvedcolumn (default: 0)
371
-     *
371
+	 *
372 372
 	 * @return boolean True: It worked; False: it failed
373 373
 	 */
374 374
 	public static function update_approved( $entry_id = 0, $approved = 0, $form_id = 0, $approvedcolumn = 0) {
@@ -378,9 +378,9 @@  discard block
 block discarded – undo
378 378
 	/**
379 379
 	 * Calculate the approve field.input id
380 380
 	 *
381
-     * @since 1.18 Moved to GravityView_Entry_Approval::get_approved_column
382
-     * @see GravityView_Entry_Approval::get_approved_column
383
-     *
381
+	 * @since 1.18 Moved to GravityView_Entry_Approval::get_approved_column
382
+	 * @see GravityView_Entry_Approval::get_approved_column
383
+	 *
384 384
 	 * @param mixed $form GF Form or Form ID
385 385
 	 * @return false|null|string Returns the input ID of the approved field. Returns NULL if no approved fields were found. Returns false if $form_id wasn't set.
386 386
 	 */
@@ -505,37 +505,37 @@  discard block
 block discarded – undo
505 505
 			'bulk_actions' => $this->get_bulk_actions( $form_id ),
506 506
 			'bulk_message' => $this->bulk_update_message,
507 507
 			'unapprove_title' => GravityView_Entry_Approval_Status::get_title_attr('unapproved'),
508
-            'approve_title' => GravityView_Entry_Approval_Status::get_title_attr('disapproved'),
508
+			'approve_title' => GravityView_Entry_Approval_Status::get_title_attr('disapproved'),
509 509
 			'disapprove_title' => GravityView_Entry_Approval_Status::get_title_attr('approved'),
510 510
 			'column_title' => __( 'Show entry in directory view?', 'gravityview'),
511 511
 			'column_link' => esc_url( $this->get_sort_link() ),
512
-            'status_popover_template' => GravityView_Entry_Approval::get_popover_template(),
512
+			'status_popover_template' => GravityView_Entry_Approval::get_popover_template(),
513 513
 			'status_popover_placement' => GravityView_Entry_Approval::get_popover_placement(),
514 514
 		) );
515 515
 
516 516
 	}
517 517
 
518 518
 	/**
519
-     * Generate a link to sort by approval status
520
-     *
521
-     * Note: Sorting by approval will never be great because it's not possible currently to declare the sorting as
522
-     * numeric, but it does group the approved entries together.
523
-     *
524
-     * @since 2.0.14 Remove need for approval field for sorting by approval status
525
-     *
519
+	 * Generate a link to sort by approval status
520
+	 *
521
+	 * Note: Sorting by approval will never be great because it's not possible currently to declare the sorting as
522
+	 * numeric, but it does group the approved entries together.
523
+	 *
524
+	 * @since 2.0.14 Remove need for approval field for sorting by approval status
525
+	 *
526 526
 	 * @param int $form_id [NO LONGER USED]
527 527
 	 *
528 528
 	 * @return string Sorting link
529 529
 	 */
530 530
 	private function get_sort_link( $form_id = 0 ) {
531 531
 
532
-	    $args = array(
533
-		    'orderby' => 'is_approved',
534
-            'order' => ( 'desc' === \GV\Utils::_GET( 'order' ) ) ? 'asc' : 'desc',
535
-        );
532
+		$args = array(
533
+			'orderby' => 'is_approved',
534
+			'order' => ( 'desc' === \GV\Utils::_GET( 'order' ) ) ? 'asc' : 'desc',
535
+		);
536 536
 
537 537
 		return add_query_arg( $args );
538
-    }
538
+	}
539 539
 
540 540
 	/**
541 541
 	 * Get an array of options to be added to the Gravity Forms "Bulk action" dropdown in a "GravityView" option group
@@ -577,9 +577,9 @@  discard block
 block discarded – undo
577 577
 		// Sanitize the values, just to be sure.
578 578
 		foreach ( $bulk_actions as $key => $group ) {
579 579
 
580
-		    if( empty( $group ) ) {
581
-		        continue;
582
-		    }
580
+			if( empty( $group ) ) {
581
+				continue;
582
+			}
583 583
 
584 584
 			foreach ( $group as $i => $action ) {
585 585
 				$bulk_actions[ $key ][ $i ]['label'] = esc_html( $bulk_actions[ $key ][ $i ]['label'] );
Please login to merge, or discard this patch.
includes/class-ajax.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
 		// template areas
140 140
 		$template_areas_directory = apply_filters( 'gravityview_template_active_areas', array(), $template_id, 'directory' );
141
-        $template_areas_single = apply_filters( 'gravityview_template_active_areas', array(), $template_id, 'single' );
141
+		$template_areas_single = apply_filters( 'gravityview_template_active_areas', array(), $template_id, 'single' );
142 142
 
143 143
 		// widget areas
144 144
 		$default_widget_areas = \GV\Widget::get_default_widget_areas();
@@ -331,40 +331,40 @@  discard block
 block discarded – undo
331 331
 		// load file
332 332
 		$xmlstr = file_get_contents( $form_file );
333 333
 
334
-        $options = array(
335
-            "page" => array("unserialize_as_array" => true),
336
-            "form"=> array("unserialize_as_array" => true),
337
-            "field"=> array("unserialize_as_array" => true),
338
-            "rule"=> array("unserialize_as_array" => true),
339
-            "choice"=> array("unserialize_as_array" => true),
340
-            "input"=> array("unserialize_as_array" => true),
341
-            "routing_item"=> array("unserialize_as_array" => true),
342
-            "creditCard"=> array("unserialize_as_array" => true),
343
-            "routin"=> array("unserialize_as_array" => true),
344
-            "confirmation" => array("unserialize_as_array" => true),
345
-            "notification" => array("unserialize_as_array" => true)
346
-        );
334
+		$options = array(
335
+			"page" => array("unserialize_as_array" => true),
336
+			"form"=> array("unserialize_as_array" => true),
337
+			"field"=> array("unserialize_as_array" => true),
338
+			"rule"=> array("unserialize_as_array" => true),
339
+			"choice"=> array("unserialize_as_array" => true),
340
+			"input"=> array("unserialize_as_array" => true),
341
+			"routing_item"=> array("unserialize_as_array" => true),
342
+			"creditCard"=> array("unserialize_as_array" => true),
343
+			"routin"=> array("unserialize_as_array" => true),
344
+			"confirmation" => array("unserialize_as_array" => true),
345
+			"notification" => array("unserialize_as_array" => true)
346
+		);
347 347
 
348 348
 		$xml = new RGXML($options);
349
-        $forms = $xml->unserialize($xmlstr);
349
+		$forms = $xml->unserialize($xmlstr);
350 350
 
351
-        if( !$forms ) {
352
-        	gravityview()->log->error( 'Importing Form Fields for preset [{template_id}]. Error importing file. (File) {path}', array( 'template_id' => $template_id, 'path' => $form_file ) );
353
-        	return false;
354
-        }
351
+		if( !$forms ) {
352
+			gravityview()->log->error( 'Importing Form Fields for preset [{template_id}]. Error importing file. (File) {path}', array( 'template_id' => $template_id, 'path' => $form_file ) );
353
+			return false;
354
+		}
355 355
 
356
-        if( !empty( $forms[0] ) && is_array( $forms[0] ) ) {
357
-        	$form = $forms[0];
358
-        }
356
+		if( !empty( $forms[0] ) && is_array( $forms[0] ) ) {
357
+			$form = $forms[0];
358
+		}
359 359
 
360
-        if( empty( $form ) ) {
361
-        	gravityview()->log->error( '$form not set.', array( 'data' => $forms ) );
362
-        	return false;
363
-        }
360
+		if( empty( $form ) ) {
361
+			gravityview()->log->error( '$form not set.', array( 'data' => $forms ) );
362
+			return false;
363
+		}
364 364
 
365
-        gravityview()->log->debug( '[pre_get_available_fields] Importing Form Fields for preset [{template_id}]. (Form)', array( 'template_id' => $template_id, 'data' => $form ) );
365
+		gravityview()->log->debug( '[pre_get_available_fields] Importing Form Fields for preset [{template_id}]. (Form)', array( 'template_id' => $template_id, 'data' => $form ) );
366 366
 
367
-        return $form;
367
+		return $form;
368 368
 
369 369
 	}
370 370
 
Please login to merge, or discard this patch.
future/includes/class-gv-extension.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -305,13 +305,13 @@
 block discarded – undo
305 305
 			$this->_remote_update_url,
306 306
 			$this->_path,
307 307
 			array(
308
-            	'version'	=> $this->_version, // current version number
309
-            	'license'	=> \GV\Utils::get( $license, 'license_key', \GV\Utils::get( $license, 'license', null ) ),
310
-	            'item_id'   => $this->_item_id, // The ID of the download on _remote_update_url
311
-            	'item_name' => $this->_title,  // name of this plugin
312
-            	'author' 	=> strip_tags( $this->_author )  // author of this plugin
313
-          	)
314
-        );
308
+				'version'	=> $this->_version, // current version number
309
+				'license'	=> \GV\Utils::get( $license, 'license_key', \GV\Utils::get( $license, 'license', null ) ),
310
+				'item_id'   => $this->_item_id, // The ID of the download on _remote_update_url
311
+				'item_name' => $this->_title,  // name of this plugin
312
+				'author' 	=> strip_tags( $this->_author )  // author of this plugin
313
+		  	)
314
+		);
315 315
 	}
316 316
 
317 317
 	/**
Please login to merge, or discard this patch.
includes/class-admin.php 1 patch
Indentation   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	 * @return void
93 93
 	 */
94 94
 	public static function connected_form_warning( $form_id = 0 ) {
95
-        global $pagenow;
95
+		global $pagenow;
96 96
 
97 97
 		if ( empty( $form_id ) || $pagenow === 'post-new.php' ) {
98 98
 			return;
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 			<?php
120 120
 		}
121 121
 
122
-        remove_action( 'gravityview/metaboxes/data-source/before', array( 'GravityView_Admin', 'connected_form_warning' ) );
122
+		remove_action( 'gravityview/metaboxes/data-source/before', array( 'GravityView_Admin', 'connected_form_warning' ) );
123 123
 	}
124 124
 
125 125
 	/**
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 			7  => sprintf(__( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
242 242
 			8  => __( 'View submitted.', 'gravityview' ),
243 243
 			9  => sprintf(
244
-		        /* translators: Date and time the View is scheduled to be published */
244
+				/* translators: Date and time the View is scheduled to be published */
245 245
 				__( 'View scheduled for: %1$s.', 'gravityview' ),
246 246
 				// translators: Publish box date format, see http://php.net/date
247 247
 				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL )  ) )
@@ -298,7 +298,6 @@  discard block
 block discarded – undo
298 298
 	 *
299 299
 	 * @deprecated since 1.12
300 300
 	 * @see GravityView_Compatibility::get_plugin_status()
301
-
302 301
 	 * @return boolean|string True: plugin is active; False: plugin file doesn't exist at path; 'inactive' it's inactive
303 302
 	 */
304 303
 	static function get_plugin_status( $location = '' ) {
Please login to merge, or discard this patch.
includes/class-common.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -310,12 +310,12 @@  discard block
 block discarded – undo
310 310
 						}
311 311
 
312 312
 						/**
313
-                         * @hack
314
-                         * In case of email/email confirmation, the input for email has the same id as the parent field
315
-                         */
313
+						 * @hack
314
+						 * In case of email/email confirmation, the input for email has the same id as the parent field
315
+						 */
316 316
 						if( 'email' === $field['type'] && false === strpos( $input['id'], '.' ) ) {
317
-                            continue;
318
-                        }
317
+							continue;
318
+						}
319 319
 						$fields["{$input['id']}"] = array(
320 320
 							'label' => \GV\Utils::get( $input, 'label' ),
321 321
 							'customLabel' => \GV\Utils::get( $input, 'customLabel' ),
@@ -1488,7 +1488,7 @@  discard block
 block discarded – undo
1488 1488
 			),
1489 1489
 		);
1490 1490
 
1491
-        $fields = $date_created + $fields;
1491
+		$fields = $date_created + $fields;
1492 1492
 
1493 1493
 		$blacklist_field_types = apply_filters( 'gravityview_blacklist_field_types', $blacklist, NULL );
1494 1494
 
@@ -1516,13 +1516,13 @@  discard block
 block discarded – undo
1516 1516
 
1517 1517
 		}
1518 1518
 
1519
-        /**
1520
-         * @filter `gravityview/common/sortable_fields` Filter the sortable fields
1521
-         * @since 1.12
1522
-         * @param array $fields Sub-set of GF form fields that are sortable
1523
-         * @param int $formid The Gravity Forms form ID that the fields are from
1524
-         */
1525
-        $fields = apply_filters( 'gravityview/common/sortable_fields', $fields, $formid );
1519
+		/**
1520
+		 * @filter `gravityview/common/sortable_fields` Filter the sortable fields
1521
+		 * @since 1.12
1522
+		 * @param array $fields Sub-set of GF form fields that are sortable
1523
+		 * @param int $formid The Gravity Forms form ID that the fields are from
1524
+		 */
1525
+		$fields = apply_filters( 'gravityview/common/sortable_fields', $fields, $formid );
1526 1526
 
1527 1527
 		return $fields;
1528 1528
 	}
@@ -1814,26 +1814,26 @@  discard block
 block discarded – undo
1814 1814
 	}
1815 1815
 
1816 1816
 
1817
-    /**
1818
-     * Display updated/error notice
1819
-     *
1820
-     * @since 1.19.2 Added $cap and $object_id parameters
1821
-     *
1822
-     * @param string $notice text/HTML of notice
1823
-     * @param string $class CSS class for notice (`updated` or `error`)
1824
-     * @param string $cap [Optional] Define a capability required to show a notice. If not set, displays to all caps.
1825
-     *
1826
-     * @return string
1827
-     */
1828
-    public static function generate_notice( $notice, $class = '', $cap = '', $object_id = null ) {
1829
-
1830
-    	// If $cap is defined, only show notice if user has capability
1831
-    	if( $cap && ! GVCommon::has_cap( $cap, $object_id ) ) {
1832
-    		return '';
1833
-	    }
1834
-
1835
-        return '<div class="gv-notice '.gravityview_sanitize_html_class( $class ) .'">'. $notice .'</div>';
1836
-    }
1817
+	/**
1818
+	 * Display updated/error notice
1819
+	 *
1820
+	 * @since 1.19.2 Added $cap and $object_id parameters
1821
+	 *
1822
+	 * @param string $notice text/HTML of notice
1823
+	 * @param string $class CSS class for notice (`updated` or `error`)
1824
+	 * @param string $cap [Optional] Define a capability required to show a notice. If not set, displays to all caps.
1825
+	 *
1826
+	 * @return string
1827
+	 */
1828
+	public static function generate_notice( $notice, $class = '', $cap = '', $object_id = null ) {
1829
+
1830
+		// If $cap is defined, only show notice if user has capability
1831
+		if( $cap && ! GVCommon::has_cap( $cap, $object_id ) ) {
1832
+			return '';
1833
+		}
1834
+
1835
+		return '<div class="gv-notice '.gravityview_sanitize_html_class( $class ) .'">'. $notice .'</div>';
1836
+	}
1837 1837
 
1838 1838
 	/**
1839 1839
 	 * Inspired on \GFCommon::encode_shortcodes, reverse the encoding by replacing the ascii characters by the shortcode brackets
Please login to merge, or discard this patch.
includes/widgets/class-gravityview-widget-page-size.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
 	/**
78 78
 	 * Render the page size widget
79
-     *
79
+	 *
80 80
 	 * @param array $widget_args The Widget shortcode args.
81 81
 	 * @param string $content The content.
82 82
 	 * @param string|\GV\Template_Context $context The context, if available.
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
 						<?php } ?>
118 118
                     </select>
119 119
                     <input type="submit" value="Submit" style="visibility: hidden; position: absolute;" /><?php
120
-                    if( ! empty( $_GET ) ) {
121
-                        $get = $_GET;
122
-                        unset( $get['page_size'] );
123
-	                    foreach ( $get as $key => $value ) {
120
+					if( ! empty( $_GET ) ) {
121
+						$get = $_GET;
122
+						unset( $get['page_size'] );
123
+						foreach ( $get as $key => $value ) {
124 124
 							if ( is_array( $value ) ) {
125 125
 								foreach ( $value as $_key => $_value ) {
126 126
 									printf( '<input type="hidden" name="%s[%s]" value="%s" />', esc_attr( $key ), esc_attr( $_key ), esc_attr( $_value ) );
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
 							} else {
129 129
 								printf( '<input type="hidden" name="%s" value="%s" />', esc_attr( $key ), esc_attr( $value ) );
130 130
 							}
131
-	                    }
132
-                    }
133
-                    ?>
131
+						}
132
+					}
133
+					?>
134 134
                 </div>
135 135
             </form>
136 136
         </div>
Please login to merge, or discard this patch.
includes/extensions/duplicate-entry/class-duplicate-entry.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	 */
247 247
 	public static function get_duplicate_link( $entry, $view_id, $post_id = null ) {
248 248
 
249
-        $base = GravityView_API::directory_link( $post_id ? : $view_id, true );
249
+		$base = GravityView_API::directory_link( $post_id ? : $view_id, true );
250 250
 
251 251
 		if ( empty( $base ) ) {
252 252
 			gravityview()->log->error( 'Post ID does not exist: {post_id}', array( 'post_id' => $post_id ) );
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 			'action'	=> 'duplicate',
258 258
 			'entry_id'	=> $entry['id'],
259 259
 			'gvid' => $view_id,
260
-            'view_id' => $view_id,
260
+			'view_id' => $view_id,
261 261
 		), $base );
262 262
 
263 263
 		return add_query_arg( 'duplicate', wp_create_nonce( self::get_nonce_key( $entry['id'] ) ), $actionurl );
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 		 * @since 2.5
461 461
 		 * @param  array $duplicated_entry The duplicated entry
462 462
 		 * @param  array $entry The original entry
463
-		*/
463
+		 */
464 464
 		do_action( 'gravityview/duplicate-entry/duplicated', $duplicated_entry, $entry );
465 465
 
466 466
 		gravityview()->log->debug( 'Duplicate response: {duplicate_response}', array( 'duplicate_response' => $duplicate_response ) );
Please login to merge, or discard this patch.
includes/admin/metaboxes/views/view-configuration.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
 
32 32
 			<?php
33 33
 
34
-                do_action('gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID );
34
+				do_action('gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID );
35 35
 
36
-    			do_action('gravityview_render_field_pickers', 'directory' );
36
+				do_action('gravityview_render_field_pickers', 'directory' );
37 37
 
38
-            ?>
38
+			?>
39 39
 
40 40
 			<?php // list of available widgets to be shown in the popup ?>
41 41
             <div id="directory-available-widgets" class="hide-if-js gv-tooltip">
@@ -60,13 +60,13 @@  discard block
 block discarded – undo
60 60
 
61 61
 			<div id="single-active-fields" class="gv-grid">
62 62
 				<?php
63
-                if(!empty( $curr_template ) ) {
64
-				    do_action('gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true );
65
-                }
66
-			    ?>
63
+				if(!empty( $curr_template ) ) {
64
+					do_action('gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true );
65
+				}
66
+				?>
67 67
 			</div>
68 68
             <?php
69
-                do_action('gravityview_render_field_pickers', 'single' );
69
+				do_action('gravityview_render_field_pickers', 'single' );
70 70
 			?>
71 71
 		</div>
72 72
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			</div>
86 86
 
87 87
 			<?php
88
-			    do_action('gravityview_render_field_pickers', 'edit' );
88
+				do_action('gravityview_render_field_pickers', 'edit' );
89 89
 			?>
90 90
 
91 91
 		</div>
Please login to merge, or discard this patch.
includes/class-gravityview-powered-by.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
 
70 70
 		$url = add_query_arg( array(
71 71
 			'utm_source' => 'powered_by',
72
-            'utm_term' => get_bloginfo('name' ),
72
+			'utm_term' => get_bloginfo('name' ),
73 73
 		), $url );
74 74
 
75 75
 		/**
Please login to merge, or discard this patch.