@@ -134,28 +134,28 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function add_network_menu() { |
136 | 136 | |
137 | - if ( ! gravityview()->plugin->is_network_activated() ) { |
|
137 | + if ( ! gravityview()->plugin->is_network_activated() ) { |
|
138 | 138 | return; |
139 | 139 | } |
140 | 140 | |
141 | - add_menu_page( __( 'Settings', 'gravityview' ), __( 'GravityView', 'gravityview' ), $this->_capabilities_app_settings, "{$this->_slug}_settings", array( $this, 'app_tab_page' ), 'none' ); |
|
141 | + add_menu_page( __( 'Settings', 'gravityview' ), __( 'GravityView', 'gravityview' ), $this->_capabilities_app_settings, "{$this->_slug}_settings", array( $this, 'app_tab_page' ), 'none' ); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
145 | - * Uninstall all traces of GravityView |
|
146 | - * |
|
147 | - * Note: method is public because parent method is public |
|
148 | - * |
|
145 | + * Uninstall all traces of GravityView |
|
146 | + * |
|
147 | + * Note: method is public because parent method is public |
|
148 | + * |
|
149 | 149 | * @return bool |
150 | 150 | */ |
151 | 151 | public function uninstall() { |
152 | 152 | gravityview()->plugin->uninstall(); |
153 | 153 | |
154 | 154 | /** |
155 | - * Set the path so that Gravity Forms can de-activate GravityView |
|
156 | - * @see GFAddOn::uninstall_addon |
|
157 | - * @uses deactivate_plugins() |
|
158 | - */ |
|
155 | + * Set the path so that Gravity Forms can de-activate GravityView |
|
156 | + * @see GFAddOn::uninstall_addon |
|
157 | + * @uses deactivate_plugins() |
|
158 | + */ |
|
159 | 159 | $this->_path = GRAVITYVIEW_FILE; |
160 | 160 | |
161 | 161 | return true; |
@@ -185,42 +185,42 @@ discard block |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
188 | - * Get an array of reasons why the plugin might be uninstalled |
|
189 | - * |
|
190 | - * @since 1.17.5 |
|
191 | - * |
|
188 | + * Get an array of reasons why the plugin might be uninstalled |
|
189 | + * |
|
190 | + * @since 1.17.5 |
|
191 | + * |
|
192 | 192 | * @return array Array of reasons with the label and followup questions for each uninstall reason |
193 | 193 | */ |
194 | 194 | private function get_uninstall_reasons() { |
195 | 195 | $reasons = array( |
196 | 196 | 'will-continue' => array( |
197 | - 'label' => esc_html__( 'I am going to continue using GravityView', 'gravityview' ), |
|
198 | - ), |
|
197 | + 'label' => esc_html__( 'I am going to continue using GravityView', 'gravityview' ), |
|
198 | + ), |
|
199 | 199 | 'no-longer-need' => array( |
200 | - 'label' => esc_html__( 'I no longer need GravityView', 'gravityview' ), |
|
201 | - ), |
|
200 | + 'label' => esc_html__( 'I no longer need GravityView', 'gravityview' ), |
|
201 | + ), |
|
202 | 202 | 'doesnt-work' => array( |
203 | - 'label' => esc_html__( 'The plugin doesn\'t work', 'gravityview' ), |
|
204 | - ), |
|
203 | + 'label' => esc_html__( 'The plugin doesn\'t work', 'gravityview' ), |
|
204 | + ), |
|
205 | 205 | 'found-other' => array( |
206 | - 'label' => esc_html__( 'I found a better plugin', 'gravityview' ), |
|
207 | - 'followup' => esc_attr__( 'What plugin you are using, and why?', 'gravityview' ), |
|
208 | - ), |
|
206 | + 'label' => esc_html__( 'I found a better plugin', 'gravityview' ), |
|
207 | + 'followup' => esc_attr__( 'What plugin you are using, and why?', 'gravityview' ), |
|
208 | + ), |
|
209 | 209 | 'other' => array( |
210 | - 'label' => esc_html__( 'Other', 'gravityview' ), |
|
211 | - ), |
|
210 | + 'label' => esc_html__( 'Other', 'gravityview' ), |
|
211 | + ), |
|
212 | 212 | ); |
213 | 213 | |
214 | 214 | shuffle( $reasons ); |
215 | 215 | |
216 | 216 | return $reasons; |
217 | - } |
|
217 | + } |
|
218 | 218 | |
219 | 219 | /** |
220 | - * Display a feedback form when the plugin is uninstalled |
|
221 | - * |
|
222 | - * @since 1.17.5 |
|
223 | - * |
|
220 | + * Display a feedback form when the plugin is uninstalled |
|
221 | + * |
|
222 | + * @since 1.17.5 |
|
223 | + * |
|
224 | 224 | * @return string HTML of the uninstallation form |
225 | 225 | */ |
226 | 226 | public function uninstall_form() { |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | <h2><?php esc_html_e( 'Why did you uninstall GravityView?', 'gravityview' ); ?></h2> |
301 | 301 | <ul> |
302 | 302 | <?php |
303 | - $reasons = $this->get_uninstall_reasons(); |
|
303 | + $reasons = $this->get_uninstall_reasons(); |
|
304 | 304 | foreach ( $reasons as $reason ) { |
305 | 305 | printf( '<li><label><input name="reason" type="radio" value="other" data-followup="%s"> %s</label></li>', Utils::get( $reason, 'followup' ), Utils::get( $reason, 'label' ) ); |
306 | 306 | } |
@@ -394,12 +394,12 @@ discard block |
||
394 | 394 | } |
395 | 395 | |
396 | 396 | public function app_settings_tab() { |
397 | - parent::app_settings_tab(); |
|
397 | + parent::app_settings_tab(); |
|
398 | 398 | |
399 | 399 | if ( $this->maybe_uninstall() ) { |
400 | - echo $this->uninstall_form(); |
|
400 | + echo $this->uninstall_form(); |
|
401 | 401 | } |
402 | - } |
|
402 | + } |
|
403 | 403 | |
404 | 404 | /** |
405 | 405 | * The Settings title |
@@ -557,8 +557,8 @@ discard block |
||
557 | 557 | type="' . $field['type'] . '" |
558 | 558 | name="' . esc_attr( $name ) . '" |
559 | 559 | value="' . $value . '" ' . |
560 | - implode( ' ', $attributes ) . |
|
561 | - ' />'; |
|
560 | + implode( ' ', $attributes ) . |
|
561 | + ' />'; |
|
562 | 562 | |
563 | 563 | if ( $echo ) { |
564 | 564 | echo $html; |
@@ -576,12 +576,12 @@ discard block |
||
576 | 576 | } |
577 | 577 | |
578 | 578 | /** |
579 | - * Check whether GravityView is being saved |
|
580 | - * |
|
581 | - * The generic is_save_postback() is true for all addons |
|
582 | - * |
|
583 | - * @since 2.0.8 |
|
584 | - * |
|
579 | + * Check whether GravityView is being saved |
|
580 | + * |
|
581 | + * The generic is_save_postback() is true for all addons |
|
582 | + * |
|
583 | + * @since 2.0.8 |
|
584 | + * |
|
585 | 585 | * @return bool |
586 | 586 | */ |
587 | 587 | public function is_save_postback() { |
@@ -595,16 +595,16 @@ discard block |
||
595 | 595 | */ |
596 | 596 | public function license_key_notice() { |
597 | 597 | |
598 | - if( $this->is_save_postback() ) { |
|
599 | - $settings = $this->get_posted_settings(); |
|
600 | - $license_key = \GV\Utils::get( $settings, 'license_key' ); |
|
601 | - $license_status = \GV\Utils::get( $settings, 'license_key_status', 'inactive' ); |
|
602 | - } else { |
|
603 | - $license_status = $this->get( 'license_key_status', 'inactive' ); |
|
604 | - $license_key = $this->get( 'license_key' ); |
|
605 | - } |
|
598 | + if( $this->is_save_postback() ) { |
|
599 | + $settings = $this->get_posted_settings(); |
|
600 | + $license_key = \GV\Utils::get( $settings, 'license_key' ); |
|
601 | + $license_status = \GV\Utils::get( $settings, 'license_key_status', 'inactive' ); |
|
602 | + } else { |
|
603 | + $license_status = $this->get( 'license_key_status', 'inactive' ); |
|
604 | + $license_key = $this->get( 'license_key' ); |
|
605 | + } |
|
606 | 606 | |
607 | - $license_id = empty( $license_key ) ? 'license' : $license_key; |
|
607 | + $license_id = empty( $license_key ) ? 'license' : $license_key; |
|
608 | 608 | |
609 | 609 | $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' ); |
610 | 610 | |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | $update_below = false; |
622 | 622 | $primary_button_link = admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ); |
623 | 623 | |
624 | - switch ( $license_status ) { |
|
624 | + switch ( $license_status ) { |
|
625 | 625 | /** @since 1.17 */ |
626 | 626 | case 'expired': |
627 | 627 | $title = __( 'Expired License', 'gravityview' ); |
@@ -659,13 +659,13 @@ discard block |
||
659 | 659 | return; |
660 | 660 | } |
661 | 661 | |
662 | - \GravityView_Admin_Notices::add_notice( array( |
|
663 | - 'message' => $message, |
|
664 | - 'class' => 'notice notice-warning', |
|
665 | - 'title' => $title, |
|
666 | - 'cap' => 'gravityview_edit_settings', |
|
667 | - 'dismiss' => sha1( $license_status . '_' . $license_id . '_' . date( 'z' ) ), // Show every day, instead of every 8 weeks (which is the default) |
|
668 | - ) ); |
|
662 | + \GravityView_Admin_Notices::add_notice( array( |
|
663 | + 'message' => $message, |
|
664 | + 'class' => 'notice notice-warning', |
|
665 | + 'title' => $title, |
|
666 | + 'cap' => 'gravityview_edit_settings', |
|
667 | + 'dismiss' => sha1( $license_status . '_' . $license_id . '_' . date( 'z' ) ), // Show every day, instead of every 8 weeks (which is the default) |
|
668 | + ) ); |
|
669 | 669 | } |
670 | 670 | |
671 | 671 | /** |
@@ -679,12 +679,12 @@ discard block |
||
679 | 679 | } |
680 | 680 | |
681 | 681 | /** |
682 | - * Add tooltip script to app settings page. Not enqueued by Gravity Forms for some reason. |
|
683 | - * |
|
684 | - * @since 1.21.5 |
|
685 | - * |
|
686 | - * @see GFAddOn::scripts() |
|
687 | - * |
|
682 | + * Add tooltip script to app settings page. Not enqueued by Gravity Forms for some reason. |
|
683 | + * |
|
684 | + * @since 1.21.5 |
|
685 | + * |
|
686 | + * @see GFAddOn::scripts() |
|
687 | + * |
|
688 | 688 | * @return array Array of scripts |
689 | 689 | */ |
690 | 690 | public function scripts() { |
@@ -693,10 +693,10 @@ discard block |
||
693 | 693 | $scripts[] = array( |
694 | 694 | 'handle' => 'gform_tooltip_init', |
695 | 695 | 'enqueue' => array( |
696 | - array( |
|
697 | - 'admin_page' => array( 'app_settings' ) |
|
698 | - ) |
|
699 | - ) |
|
696 | + array( |
|
697 | + 'admin_page' => array( 'app_settings' ) |
|
698 | + ) |
|
699 | + ) |
|
700 | 700 | ); |
701 | 701 | |
702 | 702 | return $scripts; |
@@ -714,10 +714,10 @@ discard block |
||
714 | 714 | 'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
715 | 715 | 'version' => Plugin::$version, |
716 | 716 | 'deps' => array( |
717 | - 'gform_admin', |
|
717 | + 'gform_admin', |
|
718 | 718 | 'gaddon_form_settings_css', |
719 | - 'gform_tooltip', |
|
720 | - 'gform_font_awesome', |
|
719 | + 'gform_tooltip', |
|
720 | + 'gform_font_awesome', |
|
721 | 721 | ), |
722 | 722 | 'enqueue' => array( |
723 | 723 | array( 'admin_page' => array( |
@@ -885,7 +885,7 @@ discard block |
||
885 | 885 | array( |
886 | 886 | 'label' => _x( 'Show me beta versions if they are available.', 'gravityview' ), |
887 | 887 | 'value' => '1', |
888 | - 'name' => 'beta', |
|
888 | + 'name' => 'beta', |
|
889 | 889 | ), |
890 | 890 | ), |
891 | 891 | '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' ), |
@@ -923,38 +923,38 @@ discard block |
||
923 | 923 | |
924 | 924 | if ( empty( $field['disabled'] ) ) { |
925 | 925 | unset( $field['disabled'] ); |
926 | - } |
|
926 | + } |
|
927 | 927 | } |
928 | 928 | |
929 | - $sections = array( |
|
930 | - array( |
|
931 | - 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __( 'You are running GravityView version %s', 'gravityview' ), Plugin::$version ) ), |
|
932 | - 'fields' => $fields, |
|
933 | - ) |
|
934 | - ); |
|
929 | + $sections = array( |
|
930 | + array( |
|
931 | + 'description' => sprintf( '<span class="version-info description">%s</span>', sprintf( __( 'You are running GravityView version %s', 'gravityview' ), Plugin::$version ) ), |
|
932 | + 'fields' => $fields, |
|
933 | + ) |
|
934 | + ); |
|
935 | 935 | |
936 | - // custom 'update settings' button |
|
937 | - $button = array( |
|
938 | - 'class' => 'button button-primary button-hero', |
|
939 | - 'type' => 'save', |
|
940 | - ); |
|
936 | + // custom 'update settings' button |
|
937 | + $button = array( |
|
938 | + 'class' => 'button button-primary button-hero', |
|
939 | + 'type' => 'save', |
|
940 | + ); |
|
941 | 941 | |
942 | 942 | if ( $disabled_attribute ) { |
943 | 943 | $button['disabled'] = $disabled_attribute; |
944 | 944 | } |
945 | 945 | |
946 | - /** |
|
947 | - * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page |
|
948 | - * Extensions can tap in here to insert their own section and settings. |
|
949 | - * <code> |
|
950 | - * $sections[] = array( |
|
951 | - * 'title' => __( 'GravityView My Extension Settings', 'gravityview' ), |
|
952 | - * 'fields' => $settings, |
|
953 | - * ); |
|
954 | - * </code> |
|
955 | - * @param array $extension_settings Empty array, ready for extension settings! |
|
956 | - */ |
|
957 | - $extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() ); |
|
946 | + /** |
|
947 | + * @filter `gravityview/settings/extension/sections` Modify the GravityView settings page |
|
948 | + * Extensions can tap in here to insert their own section and settings. |
|
949 | + * <code> |
|
950 | + * $sections[] = array( |
|
951 | + * 'title' => __( 'GravityView My Extension Settings', 'gravityview' ), |
|
952 | + * 'fields' => $settings, |
|
953 | + * ); |
|
954 | + * </code> |
|
955 | + * @param array $extension_settings Empty array, ready for extension settings! |
|
956 | + */ |
|
957 | + $extension_sections = apply_filters( 'gravityview/settings/extension/sections', array() ); |
|
958 | 958 | |
959 | 959 | // If there are extensions, add a section for them |
960 | 960 | if ( ! empty( $extension_sections ) ) { |
@@ -967,13 +967,13 @@ discard block |
||
967 | 967 | } |
968 | 968 | } |
969 | 969 | |
970 | - $k = count( $extension_sections ) - 1 ; |
|
971 | - $extension_sections[ $k ]['fields'][] = $button; |
|
970 | + $k = count( $extension_sections ) - 1 ; |
|
971 | + $extension_sections[ $k ]['fields'][] = $button; |
|
972 | 972 | $sections = array_merge( $sections, $extension_sections ); |
973 | 973 | } else { |
974 | - // add the 'update settings' button to the general section |
|
975 | - $sections[0]['fields'][] = $button; |
|
976 | - } |
|
974 | + // add the 'update settings' button to the general section |
|
975 | + $sections[0]['fields'][] = $button; |
|
976 | + } |
|
977 | 977 | |
978 | 978 | return $sections; |
979 | 979 | } |
@@ -1027,9 +1027,9 @@ discard block |
||
1027 | 1027 | */ |
1028 | 1028 | protected function settings_edd_license( $field, $echo = true ) { |
1029 | 1029 | |
1030 | - if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
|
1031 | - $field['input_type'] = 'password'; |
|
1032 | - } |
|
1030 | + if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
|
1031 | + $field['input_type'] = 'password'; |
|
1032 | + } |
|
1033 | 1033 | |
1034 | 1034 | $text = $this->settings_text( $field, false ); |
1035 | 1035 | |
@@ -1046,9 +1046,9 @@ discard block |
||
1046 | 1046 | |
1047 | 1047 | /** |
1048 | 1048 | * Allow pure HTML settings row |
1049 | - * |
|
1050 | - * @since 2.0.6 |
|
1051 | - * |
|
1049 | + * |
|
1050 | + * @since 2.0.6 |
|
1051 | + * |
|
1052 | 1052 | * @param array $field |
1053 | 1053 | * @param bool $echo Whether to echo the |
1054 | 1054 | * |
@@ -1114,19 +1114,19 @@ discard block |
||
1114 | 1114 | } |
1115 | 1115 | |
1116 | 1116 | /** |
1117 | - * Keep GravityView styling for `$field['description']`, even though Gravity Forms added support for it |
|
1118 | - * |
|
1119 | - * Converts `$field['description']` to `$field['gv_description']` |
|
1120 | - * Converts `$field['subtitle']` to `$field['description']` |
|
1121 | - * |
|
1122 | - * @see \GV\Addon_Settings::single_setting_label Converts `gv_description` back to `description` |
|
1123 | - * @see http://share.gravityview.co/P28uGp/2OIRKxog for image that shows subtitle vs description |
|
1124 | - * |
|
1125 | - * @since 1.21.5.2 |
|
1126 | - * |
|
1117 | + * Keep GravityView styling for `$field['description']`, even though Gravity Forms added support for it |
|
1118 | + * |
|
1119 | + * Converts `$field['description']` to `$field['gv_description']` |
|
1120 | + * Converts `$field['subtitle']` to `$field['description']` |
|
1121 | + * |
|
1122 | + * @see \GV\Addon_Settings::single_setting_label Converts `gv_description` back to `description` |
|
1123 | + * @see http://share.gravityview.co/P28uGp/2OIRKxog for image that shows subtitle vs description |
|
1124 | + * |
|
1125 | + * @since 1.21.5.2 |
|
1126 | + * |
|
1127 | 1127 | * @param array $field |
1128 | - * |
|
1129 | - * @return void |
|
1128 | + * |
|
1129 | + * @return void |
|
1130 | 1130 | */ |
1131 | 1131 | public function single_setting_row( $field ) { |
1132 | 1132 | $field['gv_description'] = Utils::get( $field, 'description' ); |