Completed
Push — develop ( 1d02d7...3ab570 )
by Zack
10:35
created
includes/class-gravityview-settings.php 1 patch
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
 	}
123 123
 
124 124
 	/**
125
-     * Uninstall all traces of GravityView
126
-     *
127
-     * Note: method is public because parent method is public
128
-     *
125
+	 * Uninstall all traces of GravityView
126
+	 *
127
+	 * Note: method is public because parent method is public
128
+	 *
129 129
 	 * @return bool
130 130
 	 */
131 131
 	public function uninstall() {
@@ -137,53 +137,53 @@  discard block
 block discarded – undo
137 137
 		$uninstaller->fire_everything();
138 138
 
139 139
 		/**
140
-         * Set the path so that Gravity Forms can de-activate GravityView
141
-         * @see GFAddOn::uninstall_addon
142
-         * @uses deactivate_plugins()
143
-         */
140
+		 * Set the path so that Gravity Forms can de-activate GravityView
141
+		 * @see GFAddOn::uninstall_addon
142
+		 * @uses deactivate_plugins()
143
+		 */
144 144
 		$this->_path = GRAVITYVIEW_FILE;
145 145
 
146 146
 		return true;
147 147
 	}
148 148
 
149 149
 	/**
150
-     * Get an array of reasons why the plugin might be uninstalled
151
-     *
152
-     * @since 1.17.5
153
-     *
150
+	 * Get an array of reasons why the plugin might be uninstalled
151
+	 *
152
+	 * @since 1.17.5
153
+	 *
154 154
 	 * @return array Array of reasons with the label and followup questions for each uninstall reason
155 155
 	 */
156 156
 	private function get_uninstall_reasons() {
157 157
 
158 158
 		$reasons = array(
159 159
 			'will-continue' => array(
160
-                'label' => esc_html__( 'I am going to continue using GravityView', 'gravityview' ),
161
-            ),
160
+				'label' => esc_html__( 'I am going to continue using GravityView', 'gravityview' ),
161
+			),
162 162
 			'no-longer-need' => array(
163
-                'label' => esc_html__( 'I no longer need GravityView', 'gravityview' ),
164
-            ),
163
+				'label' => esc_html__( 'I no longer need GravityView', 'gravityview' ),
164
+			),
165 165
 			'doesnt-work' => array(
166
-                'label' => esc_html__( 'The plugin doesn\'t work', 'gravityview' ),
167
-            ),
166
+				'label' => esc_html__( 'The plugin doesn\'t work', 'gravityview' ),
167
+			),
168 168
 			'found-other' => array(
169
-                'label' => esc_html__( 'I found a better plugin', 'gravityview' ),
170
-                'followup' => esc_attr__('What plugin you are using, and why?', 'gravityview'),
171
-            ),
169
+				'label' => esc_html__( 'I found a better plugin', 'gravityview' ),
170
+				'followup' => esc_attr__('What plugin you are using, and why?', 'gravityview'),
171
+			),
172 172
 			'other' => array(
173
-                'label' => esc_html__( 'Other', 'gravityview' ),
174
-            ),
173
+				'label' => esc_html__( 'Other', 'gravityview' ),
174
+			),
175 175
 		);
176 176
 
177 177
 		shuffle( $reasons );
178 178
 
179 179
 		return $reasons;
180
-    }
180
+	}
181 181
 
182 182
 	/**
183
-     * Display a feedback form when the plugin is uninstalled
184
-     *
185
-     * @since 1.17.5
186
-     *
183
+	 * Display a feedback form when the plugin is uninstalled
184
+	 *
185
+	 * @since 1.17.5
186
+	 *
187 187
 	 * @return string HTML of the uninstallation form
188 188
 	 */
189 189
 	public function uninstall_form() {
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
             <h2><?php esc_html_e( 'Why did you uninstall GravityView?', 'gravityview' ); ?></h2>
264 264
             <ul>
265 265
 				<?php
266
-                $reasons = $this->get_uninstall_reasons();
266
+				$reasons = $this->get_uninstall_reasons();
267 267
 				foreach ( $reasons as $reason ) {
268 268
 					printf( '<li><label><input name="reason" type="radio" value="other" data-followup="%s"> %s</label></li>', rgar( $reason, 'followup' ), rgar( $reason, 'label' ) );
269 269
 				}
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 		$license_key = self::getSetting('license_key');
432 432
 		if( '' === $license_key ) {
433 433
 			$license_status = 'inactive';
434
-        }
434
+		}
435 435
 		$license_id = empty( $license_key ) ? 'license' : $license_key;
436 436
 
437 437
 		$message = esc_html__('Your GravityView license %s. This means you&rsquo;re missing out on updates and support! %sActivate your license%s or %sget a license here%s.', 'gravityview');
@@ -491,12 +491,12 @@  discard block
 block discarded – undo
491 491
 	}
492 492
 
493 493
 	/**
494
-     * Add tooltip script to app settings page. Not enqueued by Gravity Forms for some reason.
495
-     *
496
-     * @since 1.21.5
497
-     *
498
-     * @see GFAddOn::scripts()
499
-     *
494
+	 * Add tooltip script to app settings page. Not enqueued by Gravity Forms for some reason.
495
+	 *
496
+	 * @since 1.21.5
497
+	 *
498
+	 * @see GFAddOn::scripts()
499
+	 *
500 500
 	 * @return array Array of scripts
501 501
 	 */
502 502
 	public function scripts() {
@@ -505,10 +505,10 @@  discard block
 block discarded – undo
505 505
 		$scripts[] = array(
506 506
 			'handle'  => 'gform_tooltip_init',
507 507
 			'enqueue' => array(
508
-                array(
509
-			        'admin_page' => array( 'app_settings' )
510
-                )
511
-            )
508
+				array(
509
+					'admin_page' => array( 'app_settings' )
510
+				)
511
+			)
512 512
 		);
513 513
 
514 514
 		return $scripts;
@@ -527,10 +527,10 @@  discard block
 block discarded – undo
527 527
 			'src'     => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ),
528 528
 			'version' => GravityView_Plugin::version,
529 529
 			"deps" => array(
530
-                'gform_admin',
530
+				'gform_admin',
531 531
 				'gaddon_form_settings_css',
532
-                'gform_tooltip',
533
-                'gform_font_awesome',
532
+				'gform_tooltip',
533
+				'gform_font_awesome',
534 534
 			),
535 535
 			'enqueue' => array(
536 536
 				array( 'admin_page' => array(
@@ -596,12 +596,12 @@  discard block
 block discarded – undo
596 596
 	}
597 597
 
598 598
 	public function app_settings_tab() {
599
-	    parent::app_settings_tab();
599
+		parent::app_settings_tab();
600 600
 
601 601
 		if ( $this->maybe_uninstall() ) {
602
-            echo $this->uninstall_form();
602
+			echo $this->uninstall_form();
603 603
 		}
604
-    }
604
+	}
605 605
 
606 606
 	/**
607 607
 	 * Make protected public
@@ -724,8 +724,8 @@  discard block
 block discarded – undo
724 724
                     type="' . $field['type'] . '"
725 725
                     name="' . esc_attr( $name ) . '"
726 726
                     value="' . $value . '" ' .
727
-		        implode( ' ', $attributes ) .
728
-		        ' />';
727
+				implode( ' ', $attributes ) .
728
+				' />';
729 729
 
730 730
 		if ( $echo ) {
731 731
 			echo $html;
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 					array(
952 952
 						'label' => _x('Show me beta versions if they are available.', 'gravityview'),
953 953
 						'value' => '1',
954
-                        'name'  => 'beta',
954
+						'name'  => 'beta',
955 955
 					),
956 956
 				),
957 957
 				'description'   => __( 'You will have early access to the latest GravityView features and improvements. There may be bugs! If you encounter an issue, help make GravityView better by reporting it!', 'gravityview'),
@@ -976,36 +976,36 @@  discard block
 block discarded – undo
976 976
 		}
977 977
 
978 978
 
979
-        $sections = array(
980
-            array(
981
-                'description' =>      sprintf( '<span class="version-info description">%s</span>', sprintf( __('You are running GravityView version %s', 'gravityview'), GravityView_Plugin::version ) ),
982
-                'fields'      => $fields,
983
-            )
984
-        );
979
+		$sections = array(
980
+			array(
981
+				'description' =>      sprintf( '<span class="version-info description">%s</span>', sprintf( __('You are running GravityView version %s', 'gravityview'), GravityView_Plugin::version ) ),
982
+				'fields'      => $fields,
983
+			)
984
+		);
985 985
 
986
-        // custom 'update settings' button
987
-        $button = array(
988
-            'class' => 'button button-primary button-hero',
989
-            'type'     => 'save',
990
-        );
986
+		// custom 'update settings' button
987
+		$button = array(
988
+			'class' => 'button button-primary button-hero',
989
+			'type'     => 'save',
990
+		);
991 991
 
992 992
 		if( $disabled_attribute ) {
993 993
 			$button['disabled'] = $disabled_attribute;
994 994
 		}
995 995
 
996 996
 
997
-        /**
998
-         * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page
999
-         * Extensions can tap in here to insert their own section and settings.
1000
-         * <code>
1001
-         *   $sections[] = array(
1002
-         *      'title' => __( 'GravityView My Extension Settings', 'gravityview' ),
1003
-         *      'fields' => $settings,
1004
-         *   );
1005
-         * </code>
1006
-         * @param array $extension_settings Empty array, ready for extension settings!
1007
-         */
1008
-        $extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() );
997
+		/**
998
+		 * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page
999
+		 * Extensions can tap in here to insert their own section and settings.
1000
+		 * <code>
1001
+		 *   $sections[] = array(
1002
+		 *      'title' => __( 'GravityView My Extension Settings', 'gravityview' ),
1003
+		 *      'fields' => $settings,
1004
+		 *   );
1005
+		 * </code>
1006
+		 * @param array $extension_settings Empty array, ready for extension settings!
1007
+		 */
1008
+		$extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() );
1009 1009
 
1010 1010
 		// If there are extensions, add a section for them
1011 1011
 		if ( ! empty( $extension_sections ) ) {
@@ -1018,13 +1018,13 @@  discard block
 block discarded – undo
1018 1018
 				}
1019 1019
 			}
1020 1020
 
1021
-            $k = count( $extension_sections ) - 1 ;
1022
-            $extension_sections[ $k ]['fields'][] = $button;
1021
+			$k = count( $extension_sections ) - 1 ;
1022
+			$extension_sections[ $k ]['fields'][] = $button;
1023 1023
 			$sections = array_merge( $sections, $extension_sections );
1024 1024
 		} else {
1025
-            // add the 'update settings' button to the general section
1026
-            $sections[0]['fields'][] = $button;
1027
-        }
1025
+			// add the 'update settings' button to the general section
1026
+			$sections[0]['fields'][] = $button;
1027
+		}
1028 1028
 
1029 1029
 		return $sections;
1030 1030
 	}
Please login to merge, or discard this patch.