From a8554cdf30d685626e0ddd1855199b84021e8ae6 Mon Sep 17 00:00:00 2001 From: Zack Katz Date: Fri, 1 Sep 2017 16:20:07 -0600 Subject: [PATCH 1/3] Add additional CSS classes to container
s This will help styling single entry pages, as well as fix issues with the Inline Edit and Featured Entries plugins. Fixes gravityview/GravityView-Inline-Edit#81 Closes #885 Fixes #741 --- readme.txt | 7 +++++++ templates/list-header.php | 2 +- templates/list-single.php | 2 +- templates/table-header.php | 2 +- templates/table-single.php | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/readme.txt b/readme.txt index a3d8756e7f..0c7b17aae1 100644 --- a/readme.txt +++ b/readme.txt @@ -20,6 +20,13 @@ Beautifully display your Gravity Forms entries. Learn more on [gravityview.co](h == Changelog == += 1.22 = + +* Changed: +* Fixed: Inline Edit plugin not working when displaying a single entry +* Fixed: Featured Entries plugin not adding `gv-featured-entry` CSS selector to a single entry container +* Fixed: List View and Table View templates have more standardized CSS selectors for single & multiple contexts ([Learn more](http://docs.gravityview.co/article/63-css-guide)) + = 1.21.5.3 on July 24, 2017 = * Fixed: For some field types, the value "No" would be interpreted as `false` diff --git a/templates/list-header.php b/templates/list-header.php index 7743103162..109196cd52 100644 --- a/templates/list-header.php +++ b/templates/list-header.php @@ -9,5 +9,5 @@ */ ?> -
+
diff --git a/templates/list-single.php b/templates/list-single.php index a8c17cfd93..2cff13dbb8 100644 --- a/templates/list-single.php +++ b/templates/list-single.php @@ -10,7 +10,7 @@ ?> -
+
getContextFields() ) { diff --git a/templates/table-header.php b/templates/table-header.php index 88a2c96bb6..4ebbd9234c 100644 --- a/templates/table-header.php +++ b/templates/table-header.php @@ -9,7 +9,7 @@ */ ?> -
+
diff --git a/templates/table-single.php b/templates/table-single.php index 31d875afcd..47ca17b133 100644 --- a/templates/table-single.php +++ b/templates/table-single.php @@ -12,7 +12,7 @@ -
+
getFields('single_table-columns') ) { ?> From a1e7b882b3f30031726ca36ba6c0e42184c1d2cf Mon Sep 17 00:00:00 2001 From: Zack Katz Date: Fri, 1 Sep 2017 16:38:57 -0600 Subject: [PATCH 2/3] Improve GRAVITYVIEW_LICENSE_KEY experience - Always use the license when defined in `GRAVITYVIEW_LICENSE_KEY ` - When defined, set the input type to "password" instead of "text" - Disable updating the license key setting when it's defined in the code - And if `$field['disabled']` is false, unset the key so Gravity Forms knows what to do with it. Fixes #917 --- includes/class-gravityview-settings.php | 21 ++++++++++++++++++--- readme.txt | 1 + 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/includes/class-gravityview-settings.php b/includes/class-gravityview-settings.php index 7488441ef2..5c2c32eedc 100644 --- a/includes/class-gravityview-settings.php +++ b/includes/class-gravityview-settings.php @@ -632,7 +632,14 @@ public function get_app_setting( $setting_name ) { * @return array */ public function get_app_settings() { - return get_option( 'gravityformsaddon_' . $this->_slug . '_app_settings', $this->get_default_settings() ); + + $settings = get_option( 'gravityformsaddon_' . $this->_slug . '_app_settings', $this->get_default_settings() ); + + if( defined( 'GRAVITYVIEW_LICENSE_KEY' ) ) { + $settings['license_key'] = GRAVITYVIEW_LICENSE_KEY; + } + + return $settings; } @@ -667,7 +674,11 @@ public function set_field_error( $field, $error_message = '' ) { */ protected function settings_edd_license( $field, $echo = true ) { - $text = self::settings_text( $field, false ); + if( defined('GRAVITYVIEW_LICENSE_KEY') && ! empty( GRAVITYVIEW_LICENSE_KEY ) ) { + $field['input_type'] = 'password'; + } + + $text = $this->settings_text( $field, false ); $activation = $this->License_Handler->settings_edd_license_activation( $field, false ); @@ -895,6 +906,7 @@ public function app_settings_fields() { 'label' => __( 'License Key', 'gravityview' ), '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' ) ), 'type' => 'edd_license', + 'disabled' => ( defined('GRAVITYVIEW_LICENSE_KEY') && ! empty( GRAVITYVIEW_LICENSE_KEY ) ), 'data-pending-text' => __('Verifying license…', 'gravityview'), 'default_value' => $default_settings['license_key'], 'class' => ( '' == $this->get_app_setting( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key', @@ -990,8 +1002,11 @@ public function app_settings_fields() { if( $disabled_attribute ) { $field['disabled'] = $disabled_attribute; } - } + if( empty( $field['disabled'] ) ) { + unset( $field['disabled'] ); + } + } $sections = array( array( diff --git a/readme.txt b/readme.txt index 0c7b17aae1..d88f1d23d7 100644 --- a/readme.txt +++ b/readme.txt @@ -23,6 +23,7 @@ Beautifully display your Gravity Forms entries. Learn more on [gravityview.co](h = 1.22 = * Changed: +* Fixed: When `GRAVITYVIEW_LICENSE_KEY` constant is defined, it will always be used, and the license field will be disabled * Fixed: Inline Edit plugin not working when displaying a single entry * Fixed: Featured Entries plugin not adding `gv-featured-entry` CSS selector to a single entry container * Fixed: List View and Table View templates have more standardized CSS selectors for single & multiple contexts ([Learn more](http://docs.gravityview.co/article/63-css-guide)) From f93b5a2541f832897d140ccd72af593b8607f181 Mon Sep 17 00:00:00 2001 From: Zack Katz Date: Fri, 1 Sep 2017 16:41:34 -0600 Subject: [PATCH 3/3] Improve readme --- readme.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index d88f1d23d7..bc08139000 100644 --- a/readme.txt +++ b/readme.txt @@ -22,10 +22,12 @@ Beautifully display your Gravity Forms entries. Learn more on [gravityview.co](h = 1.22 = -* Changed: -* Fixed: When `GRAVITYVIEW_LICENSE_KEY` constant is defined, it will always be used, and the license field will be disabled * Fixed: Inline Edit plugin not working when displaying a single entry -* Fixed: Featured Entries plugin not adding `gv-featured-entry` CSS selector to a single entry container +* Fixed: Featured Entries plugin not adding correct CSS selector to the single entry container + +__Developer Updates:__ + +* Fixed: When `GRAVITYVIEW_LICENSE_KEY` constant is defined, it will always be used, and the license field will be disabled * Fixed: List View and Table View templates have more standardized CSS selectors for single & multiple contexts ([Learn more](http://docs.gravityview.co/article/63-css-guide)) = 1.21.5.3 on July 24, 2017 =