|
@@ -101,7 +101,7 @@ discard block |
|
|
block discarded – undo |
|
101
|
101
|
* @return array |
|
102
|
102
|
*/ |
|
103
|
103
|
public function modify_app_settings_menu_title( $setting_tabs ) { |
|
104
|
|
- $setting_tabs[0]['label'] = __( 'GravityView Settings', 'gravityview' ); |
|
|
104
|
+ $setting_tabs[ 0 ][ 'label' ] = __( 'GravityView Settings', 'gravityview' ); |
|
105
|
105
|
return $setting_tabs; |
|
106
|
106
|
} |
|
107
|
107
|
|
|
@@ -304,15 +304,15 @@ discard block |
|
|
block discarded – undo |
|
304
|
304
|
</ul> |
|
305
|
305
|
<div class="gv-followup widefat"> |
|
306
|
306
|
<p><strong><label for="gv-reason-details"><?php esc_html_e( 'Comments', 'gravityview' ); ?></label></strong></p> |
|
307
|
|
- <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview') ?>" placeholder="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview'); ?>" class="large-text"></textarea> |
|
|
307
|
+ <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ) ?>" placeholder="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ); ?>" class="large-text"></textarea> |
|
308
|
308
|
</div> |
|
309
|
309
|
<div class="scale-description"> |
|
310
|
310
|
<p><strong><?php esc_html_e( 'How likely are you to recommend GravityView?', 'gravityview' ); ?></strong></p> |
|
311
|
311
|
<ul class="inline"> |
|
312
|
312
|
<?php |
|
313
|
313
|
$i = 0; |
|
314
|
|
- while( $i < 11 ) { |
|
315
|
|
- echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_'.$i.'" value="'.$i.'" type="radio"> '.$i.'</label></li>'; |
|
|
314
|
+ while ( $i < 11 ) { |
|
|
315
|
+ echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_' . $i . '" value="' . $i . '" type="radio"> ' . $i . '</label></li>'; |
|
316
|
316
|
$i++; |
|
317
|
317
|
} |
|
318
|
318
|
?> |
|
@@ -529,15 +529,15 @@ discard block |
|
|
block discarded – undo |
|
529
|
529
|
* @return string The HTML |
|
530
|
530
|
*/ |
|
531
|
531
|
public function as_html( $field, $echo = true ) { |
|
532
|
|
- $field['type'] = ( isset( $field['type'] ) && in_array( $field['type'], array( 'submit','reset','button' ) ) ) ? $field['type'] : 'submit'; |
|
|
532
|
+ $field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit'; |
|
533
|
533
|
|
|
534
|
534
|
$attributes = $this->get_field_attributes( $field ); |
|
535
|
535
|
$default_value = Utils::get( $field, 'value', Utils::get( $field, 'default_value' ) ); |
|
536
|
|
- $value = $this->get( $field['name'], $default_value ); |
|
|
536
|
+ $value = $this->get( $field[ 'name' ], $default_value ); |
|
537
|
537
|
|
|
538
|
538
|
|
|
539
|
|
- $attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary gfbutton'; |
|
540
|
|
- $name = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_' . $field['name']; |
|
|
539
|
+ $attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary gfbutton'; |
|
|
540
|
+ $name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ]; |
|
541
|
541
|
|
|
542
|
542
|
if ( empty( $value ) ) { |
|
543
|
543
|
$value = __( 'Update Settings', 'gravityview' ); |
|
@@ -546,7 +546,7 @@ discard block |
|
|
block discarded – undo |
|
546
|
546
|
$attributes = $this->get_field_attributes( $field ); |
|
547
|
547
|
|
|
548
|
548
|
$html = '<input |
|
549
|
|
- type="' . $field['type'] . '" |
|
|
549
|
+ type="' . $field[ 'type' ] . '" |
|
550
|
550
|
name="' . esc_attr( $name ) . '" |
|
551
|
551
|
value="' . $value . '" ' . |
|
552
|
552
|
implode( ' ', $attributes ) . |
|
@@ -575,7 +575,7 @@ discard block |
|
|
block discarded – undo |
|
575
|
575
|
public function license_key_notice() { |
|
576
|
576
|
$license_status = $this->get( 'license_key_status' ); |
|
577
|
577
|
$license_key = $this->get( 'license_key' ); |
|
578
|
|
- if( '' === $license_key ) { |
|
|
578
|
+ if ( '' === $license_key ) { |
|
579
|
579
|
$license_status = 'inactive'; |
|
580
|
580
|
} |
|
581
|
581
|
$license_id = empty( $license_key ) ? 'license' : $license_key; |
|
@@ -587,7 +587,7 @@ discard block |
|
|
block discarded – undo |
|
587
|
587
|
* but didn't want to mess up the translation strings for the translators. |
|
588
|
588
|
*/ |
|
589
|
589
|
$message = mb_substr( $message, 0, mb_strlen( $message ) - 1 ); |
|
590
|
|
- $title = __ ( 'Inactive License', 'gravityview'); |
|
|
590
|
+ $title = __( 'Inactive License', 'gravityview' ); |
|
591
|
591
|
$status = ''; |
|
592
|
592
|
$update_below = false; |
|
593
|
593
|
$primary_button_link = admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ); |
|
@@ -617,7 +617,7 @@ discard block |
|
|
block discarded – undo |
|
617
|
617
|
$update_below = __( 'Activate your license key below.', 'gravityview' ); |
|
618
|
618
|
break; |
|
619
|
619
|
} |
|
620
|
|
- $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content='.$license_status.'&utm_campaign=Admin%20Notice'; |
|
|
620
|
+ $url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content=' . $license_status . '&utm_campaign=Admin%20Notice'; |
|
621
|
621
|
|
|
622
|
622
|
// Show a different notice on settings page for inactive licenses (hide the buttons) |
|
623
|
623
|
if ( $update_below && gravityview_is_admin_page( '', 'settings' ) ) { |
|
@@ -659,7 +659,7 @@ discard block |
|
|
block discarded – undo |
|
659
|
659
|
public function scripts() { |
|
660
|
660
|
$scripts = parent::scripts(); |
|
661
|
661
|
|
|
662
|
|
- $scripts[] = array( |
|
|
662
|
+ $scripts[ ] = array( |
|
663
|
663
|
'handle' => 'gform_tooltip_init', |
|
664
|
664
|
'enqueue' => array( |
|
665
|
665
|
array( |
|
@@ -678,7 +678,7 @@ discard block |
|
|
block discarded – undo |
|
678
|
678
|
public function styles() { |
|
679
|
679
|
$styles = parent::styles(); |
|
680
|
680
|
|
|
681
|
|
- $styles[] = array( |
|
|
681
|
+ $styles[ ] = array( |
|
682
|
682
|
'handle' => 'gravityview_settings', |
|
683
|
683
|
'src' => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ), |
|
684
|
684
|
'version' => Plugin::$version, |
|
@@ -709,7 +709,7 @@ discard block |
|
|
block discarded – undo |
|
709
|
709
|
* If multisite and not network admin, we don't want the settings to show. |
|
710
|
710
|
* @since 1.7.6 |
|
711
|
711
|
*/ |
|
712
|
|
- $show_submenu = ( ! is_multisite() ) || is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() ); |
|
|
712
|
+ $show_submenu = ( ! is_multisite() ) || is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() ); |
|
713
|
713
|
|
|
714
|
714
|
/** |
|
715
|
715
|
* Override whether to show the Settings menu on a per-blog basis. |
|
@@ -752,26 +752,26 @@ discard block |
|
|
block discarded – undo |
|
752
|
752
|
'label' => __( 'License Key', 'gravityview' ), |
|
753
|
753
|
'description' => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates & support.', 'gravityview' ) . $this->get_license_handler()->license_details( $this->get_app_setting( 'license_key_response' ) ), |
|
754
|
754
|
'type' => 'edd_license', |
|
755
|
|
- 'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ), |
|
|
755
|
+ 'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ), |
|
756
|
756
|
'data-pending-text' => __( 'Verifying license…', 'gravityview' ), |
|
757
|
|
- 'default_value' => $default_settings['license_key'], |
|
|
757
|
+ 'default_value' => $default_settings[ 'license_key' ], |
|
758
|
758
|
'class' => ( '' == $this->get( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key', |
|
759
|
759
|
), |
|
760
|
760
|
array( |
|
761
|
761
|
'name' => 'license_key_response', |
|
762
|
|
- 'default_value' => $default_settings['license_key_response'], |
|
|
762
|
+ 'default_value' => $default_settings[ 'license_key_response' ], |
|
763
|
763
|
'type' => 'hidden', |
|
764
|
764
|
), |
|
765
|
765
|
array( |
|
766
|
766
|
'name' => 'license_key_status', |
|
767
|
|
- 'default_value' => $default_settings['license_key_status'], |
|
|
767
|
+ 'default_value' => $default_settings[ 'license_key_status' ], |
|
768
|
768
|
'type' => 'hidden', |
|
769
|
769
|
), |
|
770
|
770
|
array( |
|
771
|
771
|
'name' => 'support-email', |
|
772
|
772
|
'type' => 'text', |
|
773
|
773
|
'validate' => 'email', |
|
774
|
|
- 'default_value' => $default_settings['support-email'], |
|
|
774
|
+ 'default_value' => $default_settings[ 'support-email' ], |
|
775
|
775
|
'label' => __( 'Support Email', 'gravityview' ), |
|
776
|
776
|
'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ), |
|
777
|
777
|
'class' => 'code regular-text', |
|
@@ -783,7 +783,7 @@ discard block |
|
|
block discarded – undo |
|
783
|
783
|
'name' => 'support_port', |
|
784
|
784
|
'type' => 'radio', |
|
785
|
785
|
'label' => __( 'Show Support Port?', 'gravityview' ), |
|
786
|
|
- 'default_value' => $default_settings['support_port'], |
|
|
786
|
+ 'default_value' => $default_settings[ 'support_port' ], |
|
787
|
787
|
'horizontal' => 1, |
|
788
|
788
|
'choices' => array( |
|
789
|
789
|
array( |
|
@@ -802,7 +802,7 @@ discard block |
|
|
block discarded – undo |
|
802
|
802
|
'name' => 'no-conflict-mode', |
|
803
|
803
|
'type' => 'radio', |
|
804
|
804
|
'label' => __( 'No-Conflict Mode', 'gravityview' ), |
|
805
|
|
- 'default_value' => $default_settings['no-conflict-mode'], |
|
|
805
|
+ 'default_value' => $default_settings[ 'no-conflict-mode' ], |
|
806
|
806
|
'horizontal' => 1, |
|
807
|
807
|
'choices' => array( |
|
808
|
808
|
array( |
|
@@ -824,7 +824,7 @@ discard block |
|
|
block discarded – undo |
|
824
|
824
|
'name' => 'rest_api', |
|
825
|
825
|
'type' => 'radio', |
|
826
|
826
|
'label' => __( 'REST API', 'gravityview' ), |
|
827
|
|
- 'default_value' => $default_settings['rest_api'], |
|
|
827
|
+ 'default_value' => $default_settings[ 'rest_api' ], |
|
828
|
828
|
'horizontal' => 1, |
|
829
|
829
|
'choices' => array( |
|
830
|
830
|
array( |
|
@@ -843,7 +843,7 @@ discard block |
|
|
block discarded – undo |
|
843
|
843
|
'name' => 'beta', |
|
844
|
844
|
'type' => 'checkbox', |
|
845
|
845
|
'label' => __( 'Become a Beta Tester', 'gravityview' ), |
|
846
|
|
- 'default_value' => $default_settings['beta'], |
|
|
846
|
+ 'default_value' => $default_settings[ 'beta' ], |
|
847
|
847
|
'horizontal' => 1, |
|
848
|
848
|
'choices' => array( |
|
849
|
849
|
array( |
|
@@ -876,17 +876,17 @@ discard block |
|
|
block discarded – undo |
|
876
|
876
|
* @since 1.7.4 |
|
877
|
877
|
*/ |
|
878
|
878
|
foreach ( $fields as &$field ) { |
|
879
|
|
- $field['name'] = isset( $field['name'] ) ? $field['name'] : Utils::get( $field, 'id' ); |
|
880
|
|
- $field['label'] = isset( $field['label'] ) ? $field['label'] : Utils::get( $field, 'title' ); |
|
881
|
|
- $field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : Utils::get( $field, 'default' ); |
|
882
|
|
- $field['description'] = isset( $field['description'] ) ? $field['description'] : Utils::get( $field, 'subtitle' ); |
|
|
879
|
+ $field[ 'name' ] = isset( $field[ 'name' ] ) ? $field[ 'name' ] : Utils::get( $field, 'id' ); |
|
|
880
|
+ $field[ 'label' ] = isset( $field[ 'label' ] ) ? $field[ 'label' ] : Utils::get( $field, 'title' ); |
|
|
881
|
+ $field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : Utils::get( $field, 'default' ); |
|
|
882
|
+ $field[ 'description' ] = isset( $field[ 'description' ] ) ? $field[ 'description' ] : Utils::get( $field, 'subtitle' ); |
|
883
|
883
|
|
|
884
|
884
|
if ( $disabled_attribute ) { |
|
885
|
|
- $field['disabled'] = $disabled_attribute; |
|
|
885
|
+ $field[ 'disabled' ] = $disabled_attribute; |
|
886
|
886
|
} |
|
887
|
887
|
|
|
888
|
|
- if ( empty( $field['disabled'] ) ) { |
|
889
|
|
- unset( $field['disabled'] ); |
|
|
888
|
+ if ( empty( $field[ 'disabled' ] ) ) { |
|
|
889
|
+ unset( $field[ 'disabled' ] ); |
|
890
|
890
|
} |
|
891
|
891
|
} |
|
892
|
892
|
|
|
@@ -904,7 +904,7 @@ discard block |
|
|
block discarded – undo |
|
904
|
904
|
); |
|
905
|
905
|
|
|
906
|
906
|
if ( $disabled_attribute ) { |
|
907
|
|
- $button['disabled'] = $disabled_attribute; |
|
|
907
|
+ $button[ 'disabled' ] = $disabled_attribute; |
|
908
|
908
|
} |
|
909
|
909
|
|
|
910
|
910
|
/** |
|
@@ -923,20 +923,20 @@ discard block |
|
|
block discarded – undo |
|
923
|
923
|
// If there are extensions, add a section for them |
|
924
|
924
|
if ( ! empty( $extension_sections ) ) { |
|
925
|
925
|
|
|
926
|
|
- if( $disabled_attribute ) { |
|
|
926
|
+ if ( $disabled_attribute ) { |
|
927
|
927
|
foreach ( $extension_sections as &$section ) { |
|
928
|
|
- foreach ( $section['fields'] as &$field ) { |
|
929
|
|
- $field['disabled'] = $disabled_attribute; |
|
|
928
|
+ foreach ( $section[ 'fields' ] as &$field ) { |
|
|
929
|
+ $field[ 'disabled' ] = $disabled_attribute; |
|
930
|
930
|
} |
|
931
|
931
|
} |
|
932
|
932
|
} |
|
933
|
933
|
|
|
934
|
|
- $k = count( $extension_sections ) - 1 ; |
|
935
|
|
- $extension_sections[ $k ]['fields'][] = $button; |
|
|
934
|
+ $k = count( $extension_sections ) - 1; |
|
|
935
|
+ $extension_sections[ $k ][ 'fields' ][ ] = $button; |
|
936
|
936
|
$sections = array_merge( $sections, $extension_sections ); |
|
937
|
937
|
} else { |
|
938
|
938
|
// add the 'update settings' button to the general section |
|
939
|
|
- $sections[0]['fields'][] = $button; |
|
|
939
|
+ $sections[ 0 ][ 'fields' ][ ] = $button; |
|
940
|
940
|
} |
|
941
|
941
|
|
|
942
|
942
|
return $sections; |
|
@@ -992,7 +992,7 @@ discard block |
|
|
block discarded – undo |
|
992
|
992
|
protected function settings_edd_license( $field, $echo = true ) { |
|
993
|
993
|
|
|
994
|
994
|
if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) { |
|
995
|
|
- $field['input_type'] = 'password'; |
|
|
995
|
+ $field[ 'input_type' ] = 'password'; |
|
996
|
996
|
} |
|
997
|
997
|
|
|
998
|
998
|
$text = $this->settings_text( $field, false ); |
|
@@ -1017,10 +1017,10 @@ discard block |
|
|
block discarded – undo |
|
1017
|
1017
|
* @return string |
|
1018
|
1018
|
*/ |
|
1019
|
1019
|
public function settings_save( $field, $echo = true ) { |
|
1020
|
|
- $field['type'] = 'submit'; |
|
1021
|
|
- $field['name'] = 'gform-settings-save'; |
|
1022
|
|
- $field['class'] = isset( $field['class'] ) ? $field['class'] : 'button-primary gfbutton'; |
|
1023
|
|
- $field['value'] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
|
1020
|
+ $field[ 'type' ] = 'submit'; |
|
|
1021
|
+ $field[ 'name' ] = 'gform-settings-save'; |
|
|
1022
|
+ $field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] : 'button-primary gfbutton'; |
|
|
1023
|
+ $field[ 'value' ] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) ); |
|
1024
|
1024
|
|
|
1025
|
1025
|
$output = $this->settings_submit( $field, false ); |
|
1026
|
1026
|
|
|
@@ -1051,8 +1051,8 @@ discard block |
|
|
block discarded – undo |
|
1051
|
1051
|
* @return void |
|
1052
|
1052
|
*/ |
|
1053
|
1053
|
public function single_setting_row( $field ) { |
|
1054
|
|
- $field['gv_description'] = Utils::get( $field, 'description' ); |
|
1055
|
|
- $field['description'] = Utils::get( $field, 'subtitle' ); |
|
|
1054
|
+ $field[ 'gv_description' ] = Utils::get( $field, 'description' ); |
|
|
1055
|
+ $field[ 'description' ] = Utils::get( $field, 'subtitle' ); |
|
1056
|
1056
|
parent::single_setting_row( $field ); |
|
1057
|
1057
|
} |
|
1058
|
1058
|
|
|
@@ -1064,7 +1064,7 @@ discard block |
|
|
block discarded – undo |
|
1064
|
1064
|
public function single_setting_label( $field ) { |
|
1065
|
1065
|
parent::single_setting_label( $field ); |
|
1066
|
1066
|
if ( $description = Utils::get( $field, 'gv_description' ) ) { |
|
1067
|
|
- echo '<span class="description">'. $description .'</span>'; |
|
|
1067
|
+ echo '<span class="description">' . $description . '</span>'; |
|
1068
|
1068
|
} |
|
1069
|
1069
|
} |
|
1070
|
1070
|
|
|
@@ -1101,9 +1101,9 @@ discard block |
|
|
block discarded – undo |
|
1101
|
1101
|
// If the posted key doesn't match the activated/deactivated key (set using the Activate License button, AJAX response), |
|
1102
|
1102
|
// then we assume it's changed. If it's changed, unset the status and the previous response. |
|
1103
|
1103
|
if ( $local_key !== $response_key ) { |
|
1104
|
|
- unset( $posted_settings['license_key_response'] ); |
|
1105
|
|
- unset( $posted_settings['license_key_status'] ); |
|
1106
|
|
- \GFCommon::add_error_message( __('The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
|
1104
|
+ unset( $posted_settings[ 'license_key_response' ] ); |
|
|
1105
|
+ unset( $posted_settings[ 'license_key_status' ] ); |
|
|
1106
|
+ \GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) ); |
|
1107
|
1107
|
} |
|
1108
|
1108
|
return $posted_settings; |
|
1109
|
1109
|
} |