@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | add_action( 'gravityview_log_debug', array( $this, 'log_debug'), 10, 2 ); |
13 | 13 | |
14 | 14 | // Enable debug with Gravity Forms Logging Add-on |
15 | - add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) ); |
|
15 | + add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) ); |
|
16 | 16 | |
17 | - // Load Debug Bar integration |
|
18 | - add_filter( 'debug_bar_panels', array( $this, 'add_debug_bar' ) ); |
|
17 | + // Load Debug Bar integration |
|
18 | + add_filter( 'debug_bar_panels', array( $this, 'add_debug_bar' ) ); |
|
19 | 19 | |
20 | 20 | } |
21 | 21 | |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | * @param array $supported_plugins List of plugins |
45 | 45 | */ |
46 | 46 | public function enable_gform_logging( $supported_plugins ) { |
47 | - $supported_plugins['gravityview'] = 'GravityView'; |
|
48 | - return $supported_plugins; |
|
47 | + $supported_plugins['gravityview'] = 'GravityView'; |
|
48 | + return $supported_plugins; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | |
97 | 97 | if ( class_exists("GFLogging") ) { |
98 | 98 | GFLogging::include_logger(); |
99 | - GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG ); |
|
100 | - } |
|
99 | + GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG ); |
|
100 | + } |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | static function log_error( $message = '', $data = null ) { |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | } |
116 | 116 | |
117 | 117 | if ( class_exists("GFLogging") ) { |
118 | - GFLogging::include_logger(); |
|
119 | - GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR ); |
|
118 | + GFLogging::include_logger(); |
|
119 | + GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR ); |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 |
@@ -122,10 +122,10 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | $license_key = self::getSetting('license_key'); |
427 | 427 | if( '' === $license_key ) { |
428 | 428 | $license_status = 'inactive'; |
429 | - } |
|
429 | + } |
|
430 | 430 | $license_id = empty( $license_key ) ? 'license' : $license_key; |
431 | 431 | |
432 | 432 | $message = esc_html__('Your GravityView license %s. This means you’re missing out on updates and support! %sActivate your license%s or %sget a license here%s.', 'gravityview'); |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | $update_below = false; |
442 | 442 | $primary_button_link = admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ); |
443 | 443 | |
444 | - switch ( $license_status ) { |
|
444 | + switch ( $license_status ) { |
|
445 | 445 | /** @since 1.17 */ |
446 | 446 | case 'expired': |
447 | 447 | $title = __('Expired License', 'gravityview'); |
@@ -487,12 +487,12 @@ discard block |
||
487 | 487 | } |
488 | 488 | |
489 | 489 | /** |
490 | - * Add tooltip script to app settings page. Not enqueued by Gravity Forms for some reason. |
|
491 | - * |
|
492 | - * @since 1.21.5 |
|
493 | - * |
|
494 | - * @see GFAddOn::scripts() |
|
495 | - * |
|
490 | + * Add tooltip script to app settings page. Not enqueued by Gravity Forms for some reason. |
|
491 | + * |
|
492 | + * @since 1.21.5 |
|
493 | + * |
|
494 | + * @see GFAddOn::scripts() |
|
495 | + * |
|
496 | 496 | * @return array Array of scripts |
497 | 497 | */ |
498 | 498 | public function scripts() { |
@@ -501,10 +501,10 @@ discard block |
||
501 | 501 | $scripts[] = array( |
502 | 502 | 'handle' => 'gform_tooltip_init', |
503 | 503 | 'enqueue' => array( |
504 | - array( |
|
505 | - 'admin_page' => array( 'app_settings' ) |
|
506 | - ) |
|
507 | - ) |
|
504 | + array( |
|
505 | + 'admin_page' => array( 'app_settings' ) |
|
506 | + ) |
|
507 | + ) |
|
508 | 508 | ); |
509 | 509 | |
510 | 510 | return $scripts; |
@@ -523,10 +523,10 @@ discard block |
||
523 | 523 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
524 | 524 | 'version' => GravityView_Plugin::version, |
525 | 525 | "deps" => array( |
526 | - 'gform_admin', |
|
526 | + 'gform_admin', |
|
527 | 527 | 'gaddon_form_settings_css', |
528 | - 'gform_tooltip', |
|
529 | - 'gform_font_awesome', |
|
528 | + 'gform_tooltip', |
|
529 | + 'gform_font_awesome', |
|
530 | 530 | ), |
531 | 531 | 'enqueue' => array( |
532 | 532 | array( 'admin_page' => array( |
@@ -592,12 +592,12 @@ discard block |
||
592 | 592 | } |
593 | 593 | |
594 | 594 | public function app_settings_tab() { |
595 | - parent::app_settings_tab(); |
|
595 | + parent::app_settings_tab(); |
|
596 | 596 | |
597 | 597 | if ( $this->maybe_uninstall() ) { |
598 | - echo $this->uninstall_form(); |
|
598 | + echo $this->uninstall_form(); |
|
599 | 599 | } |
600 | - } |
|
600 | + } |
|
601 | 601 | |
602 | 602 | /** |
603 | 603 | * Make protected public |
@@ -720,8 +720,8 @@ discard block |
||
720 | 720 | type="' . $field['type'] . '" |
721 | 721 | name="' . esc_attr( $name ) . '" |
722 | 722 | value="' . $value . '" ' . |
723 | - implode( ' ', $attributes ) . |
|
724 | - ' />'; |
|
723 | + implode( ' ', $attributes ) . |
|
724 | + ' />'; |
|
725 | 725 | |
726 | 726 | if ( $echo ) { |
727 | 727 | echo $html; |
@@ -762,19 +762,19 @@ discard block |
||
762 | 762 | |
763 | 763 | |
764 | 764 | /** |
765 | - * Keep GravityView styling for `$field['description']`, even though Gravity Forms added support for it |
|
766 | - * |
|
767 | - * Converts `$field['description']` to `$field['gv_description']` |
|
768 | - * Converts `$field['subtitle']` to `$field['description']` |
|
769 | - * |
|
770 | - * @see GravityView_Settings::single_setting_label Converts `gv_description` back to `description` |
|
771 | - * @see http://share.gravityview.co/P28uGp/2OIRKxog for image that shows subtitle vs description |
|
772 | - * |
|
773 | - * @since 1.21.5.2 |
|
774 | - * |
|
765 | + * Keep GravityView styling for `$field['description']`, even though Gravity Forms added support for it |
|
766 | + * |
|
767 | + * Converts `$field['description']` to `$field['gv_description']` |
|
768 | + * Converts `$field['subtitle']` to `$field['description']` |
|
769 | + * |
|
770 | + * @see GravityView_Settings::single_setting_label Converts `gv_description` back to `description` |
|
771 | + * @see http://share.gravityview.co/P28uGp/2OIRKxog for image that shows subtitle vs description |
|
772 | + * |
|
773 | + * @since 1.21.5.2 |
|
774 | + * |
|
775 | 775 | * @param array $field |
776 | - * |
|
777 | - * @return void |
|
776 | + * |
|
777 | + * @return void |
|
778 | 778 | */ |
779 | 779 | public function single_setting_row( $field ) { |
780 | 780 | |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | array( |
969 | 969 | 'label' => _x('Show me beta versions if they are available.', 'gravityview'), |
970 | 970 | 'value' => '1', |
971 | - 'name' => 'beta', |
|
971 | + 'name' => 'beta', |
|
972 | 972 | ), |
973 | 973 | ), |
974 | 974 | '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'), |
@@ -993,36 +993,36 @@ discard block |
||
993 | 993 | } |
994 | 994 | |
995 | 995 | |
996 | - $sections = array( |
|
997 | - array( |
|
998 | - 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __('You are running GravityView version %s', 'gravityview'), GravityView_Plugin::version ) ), |
|
999 | - 'fields' => $fields, |
|
1000 | - ) |
|
1001 | - ); |
|
996 | + $sections = array( |
|
997 | + array( |
|
998 | + 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __('You are running GravityView version %s', 'gravityview'), GravityView_Plugin::version ) ), |
|
999 | + 'fields' => $fields, |
|
1000 | + ) |
|
1001 | + ); |
|
1002 | 1002 | |
1003 | - // custom 'update settings' button |
|
1004 | - $button = array( |
|
1005 | - 'class' => 'button button-primary button-hero', |
|
1006 | - 'type' => 'save', |
|
1007 | - ); |
|
1003 | + // custom 'update settings' button |
|
1004 | + $button = array( |
|
1005 | + 'class' => 'button button-primary button-hero', |
|
1006 | + 'type' => 'save', |
|
1007 | + ); |
|
1008 | 1008 | |
1009 | 1009 | if( $disabled_attribute ) { |
1010 | 1010 | $button['disabled'] = $disabled_attribute; |
1011 | 1011 | } |
1012 | 1012 | |
1013 | 1013 | |
1014 | - /** |
|
1015 | - * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page |
|
1016 | - * Extensions can tap in here to insert their own section and settings. |
|
1017 | - * <code> |
|
1018 | - * $sections[] = array( |
|
1019 | - * 'title' => __( 'GravityView My Extension Settings', 'gravityview' ), |
|
1020 | - * 'fields' => $settings, |
|
1021 | - * ); |
|
1022 | - * </code> |
|
1023 | - * @param array $extension_settings Empty array, ready for extension settings! |
|
1024 | - */ |
|
1025 | - $extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() ); |
|
1014 | + /** |
|
1015 | + * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page |
|
1016 | + * Extensions can tap in here to insert their own section and settings. |
|
1017 | + * <code> |
|
1018 | + * $sections[] = array( |
|
1019 | + * 'title' => __( 'GravityView My Extension Settings', 'gravityview' ), |
|
1020 | + * 'fields' => $settings, |
|
1021 | + * ); |
|
1022 | + * </code> |
|
1023 | + * @param array $extension_settings Empty array, ready for extension settings! |
|
1024 | + */ |
|
1025 | + $extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() ); |
|
1026 | 1026 | |
1027 | 1027 | // If there are extensions, add a section for them |
1028 | 1028 | if ( ! empty( $extension_sections ) ) { |
@@ -1035,13 +1035,13 @@ discard block |
||
1035 | 1035 | } |
1036 | 1036 | } |
1037 | 1037 | |
1038 | - $k = count( $extension_sections ) - 1 ; |
|
1039 | - $extension_sections[ $k ]['fields'][] = $button; |
|
1038 | + $k = count( $extension_sections ) - 1 ; |
|
1039 | + $extension_sections[ $k ]['fields'][] = $button; |
|
1040 | 1040 | $sections = array_merge( $sections, $extension_sections ); |
1041 | 1041 | } else { |
1042 | - // add the 'update settings' button to the general section |
|
1043 | - $sections[0]['fields'][] = $button; |
|
1044 | - } |
|
1042 | + // add the 'update settings' button to the general section |
|
1043 | + $sections[0]['fields'][] = $button; |
|
1044 | + } |
|
1045 | 1045 | |
1046 | 1046 | return $sections; |
1047 | 1047 | } |