Skip to content

Commit

Permalink
Merge pull request #605 from gravityview/version/1.16
Browse files Browse the repository at this point in the history
Version 1.16
  • Loading branch information
zackkatz committed Jan 14, 2016
2 parents 3ac4b16 + 257098f commit 21157a0
Show file tree
Hide file tree
Showing 168 changed files with 13,737 additions and 9,539 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,5 @@ languages/gravityview-de.mo
languages/gravityview-de.po

docs/config.doxygen

.idea/modules.xml
2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ php:
- 5.6

env:
- WP_VERSION=nightly WP_MULTISITE=0
- WP_VERSION=latest WP_MULTISITE=0
- WP_VERSION=4.4 WP_MULTISITE=0
- WP_VERSION=4.3 WP_MULTISITE=0
- WP_VERSION=4.2 WP_MULTISITE=0
- WP_VERSION=4.1 WP_MULTISITE=0
Expand All @@ -18,7 +19,7 @@ env:
matrix:
include:
- php: 5.3
env: WP_VERSION=nightly WP_MULTISITE=1
env: WP_VERSION=latest WP_MULTISITE=1

before_script:
- bash tests/bin/install.sh gravityview_test root '' localhost $WP_VERSION
Expand Down
2 changes: 1 addition & 1 deletion assets/css/admin-views.css

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion assets/css/scss/admin-views.scss
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ $gv-overlay-index: 10000;
.row-actions {
visibility: visible;
padding: 0;
left: auto;
}
.gv-form-title {
display: none;
Expand Down Expand Up @@ -353,7 +354,7 @@ $gv-overlay-index: 10000;
list-style: none;
float: left;
position: relative;
top: 1px;
top: 2px;
margin: 0 .2em 1px 0;
border-bottom: 0;
padding: 0;
Expand All @@ -366,6 +367,7 @@ $gv-overlay-index: 10000;
padding: .5em 1em;
text-decoration: none;
font-size: 14px;
font-weight: 400;

&:link, &:visited, &:hover, &:active, &:focus {
outline: none;
Expand Down Expand Up @@ -854,6 +856,7 @@ hr {
text-align: center;
font-size: 16px;
line-height: 20px;
padding: 0 40px; // When there's error text, have it be narrow
display: block;

.spinner {
Expand Down
Binary file added assets/images/screenshots/developing-future.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/screenshots/pricing-merge-tags.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 9 additions & 11 deletions gravityview.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
* @license GPL2+
* @author Katz Web Services, Inc.
* @link http://gravityview.co
* @copyright Copyright 2014, Katz Web Services, Inc.
* @copyright Copyright 2016, Katz Web Services, Inc.
*
* @wordpress-plugin
* Plugin Name: GravityView
* Plugin URI: http://gravityview.co
* Description: Create directories based on a Gravity Forms form, insert them using a shortcode, and modify how they output.
* Version: 1.15.2
* Version: 1.16
* Author: Katz Web Services, Inc.
* Author URI: http://www.katzwebservices.com
* Text Domain: gravityview
Expand Down Expand Up @@ -89,7 +89,7 @@
*/
final class GravityView_Plugin {

const version = '1.15.2';
const version = '1.16';

private static $instance;

Expand Down Expand Up @@ -124,7 +124,7 @@ private function __construct() {
*
* @since 1.12
*/
function add_hooks() {
private function add_hooks() {
// Load plugin text domain
add_action( 'init', array( $this, 'load_plugin_textdomain' ), 1 );

Expand All @@ -137,15 +137,16 @@ function add_hooks() {
*
* @since 1.12
*/
function include_files() {
public function include_files() {

include_once( GRAVITYVIEW_DIR .'includes/class-admin.php' );

// Load fields
include_once( GRAVITYVIEW_DIR . 'includes/fields/class-gravityview-fields.php' );
include_once( GRAVITYVIEW_DIR . 'includes/fields/class-gravityview-field.php' );

// Load all field files automatically
foreach ( glob( GRAVITYVIEW_DIR . 'includes/fields/*.php' ) as $gv_field_filename ) {
foreach ( glob( GRAVITYVIEW_DIR . 'includes/fields/class-gravityview-field*.php' ) as $gv_field_filename ) {
include_once( $gv_field_filename );
}

Expand Down Expand Up @@ -198,10 +199,9 @@ public static function is_network_activated() {
*
* @access public
* @static
* @param mixed $network_wide
* @return void
*/
public static function activate( $network_wide = false ) {
public static function activate() {

// register post types
GravityView_Post_Types::init_post_types();
Expand Down Expand Up @@ -229,10 +229,9 @@ public static function activate( $network_wide = false ) {
*
* @access public
* @static
* @param mixed $network_wide
* @return void
*/
public static function deactivate( $network_wide ) {
public static function deactivate() {

flush_rewrite_rules();

Expand Down Expand Up @@ -335,7 +334,6 @@ public static function get_default_widget_areas() {
$default_areas = array(
array( '1-1' => array( array( 'areaid' => 'top', 'title' => __('Top', 'gravityview' ) , 'subtitle' => '' ) ) ),
array( '1-2' => array( array( 'areaid' => 'left', 'title' => __('Left', 'gravityview') , 'subtitle' => '' ) ), '2-2' => array( array( 'areaid' => 'right', 'title' => __('Right', 'gravityview') , 'subtitle' => '' ) ) ),
//array( '1-1' => array( array( 'areaid' => 'bottom', 'title' => __('Full Width Bottom', 'gravityview') , 'subtitle' => '' ) ) )
);

/**
Expand Down
12 changes: 5 additions & 7 deletions includes/admin/class-gravityview-support-port.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ class GravityView_Support_Port {
*/
const related_plugins_key = 'gravityview_related_plugins';

function __construct() {
public function __construct() {
$this->add_hooks();
}

/**
* @since 1.15
*/
function add_hooks() {
private function add_hooks() {
add_action( 'personal_options', array( $this, 'user_field' ) );
add_action( 'personal_options_update', array( $this, 'update_user_meta_value' ) );
add_action( 'edit_user_profile_update', array( $this, 'update_user_meta_value' ) );
Expand All @@ -42,7 +42,7 @@ function add_hooks() {
*
* @return void
*/
static function maybe_enqueue_script( $hook ) {
public static function maybe_enqueue_script( $hook ) {
global $pagenow;

// Don't show if not GravityView page, or if we're on the Widgets page
Expand Down Expand Up @@ -97,8 +97,6 @@ private static function _localize_script() {
'messageError' => _x( 'Please enter a message', 'Error shown when submitting support request and there is no message provided', 'gravityview' ),
'contactSuccessLabel' => __( 'Message sent!', 'gravityview' ),
'contactSuccessDescription' => __( 'Thanks for reaching out! Someone from the GravityView team will get back to you soon.', 'gravityview' ),
#'topicLabel' => __('Select a topic', 'gravityview' ), // Not yet implemented
#'topicError' => __('Please select a topic from the list', 'gravityview' ), // Not yet implemented
);

$response = GravityView_Settings::getSetting( 'license_key_response' );
Expand Down Expand Up @@ -197,7 +195,7 @@ static private function get_related_plugins_and_extensions() {
$extensions[] = sprintf( '%s %s', $plugin_data['Name'], $plugin_data['Version'] );
}

if( $extensions ) {
if( ! empty( $extensions ) ) {
set_site_transient( self::related_plugins_key, $extensions, HOUR_IN_SECONDS );
} else {
return 'There was an error fetching related plugins.';
Expand Down Expand Up @@ -274,7 +272,7 @@ public function update_user_meta_value( $user_id ) {
*
* @return void
*/
function user_field( $user ) {
public function user_field( $user ) {

/**
* @filter `gravityview/support_port/show_profile_setting` Should the "GravityView Support Port" setting be shown on user profiles?
Expand Down
3 changes: 2 additions & 1 deletion includes/admin/class.field.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static function get_field_defaults() {
'desc' => '',
'value' => NULL,
'label' => '',
'left_label' => NULL,
'id' => NULL,
'type' => 'text',
'options' => NULL,
Expand Down Expand Up @@ -111,7 +112,7 @@ function get_field_label() {
* @return string
*/
function get_field_left_label() {
return isset( $this->field['left_label'] ) ? esc_html( trim( $this->field['left_label'] ) ) : NULL;
return ! empty( $this->field['left_label'] ) ? esc_html( trim( $this->field['left_label'] ) ) : NULL;
}

/**
Expand Down
14 changes: 8 additions & 6 deletions includes/admin/class.render.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ public static function render_field_option( $name = '', $option, $curr_value = N
* Output a table row for view settings
* @param string $key The key of the input
* @param array $current_settings Associative array of current settings to use as input values, if set. If not set, the defaults are used.
* @param [type] $override_input [description]
* @param string $override_input [description]
* @param string $name [description]
* @param string $id [description]
* @return [type] [description]
* @return void [description]
*/
public static function render_setting_row( $key = '', $current_settings = array(), $override_input = null, $name = 'template_settings[%s]', $id = 'gravityview_se_%s' ) {

Expand Down Expand Up @@ -326,9 +326,12 @@ public static function render_setting_row( $key = '', $current_settings = array(
}
}

$output = '';

// render the setting
$type_class = self::load_type_class( $setting );
if( class_exists( $type_class ) ) {
/** @var GravityView_FieldType $render_type */
$render_type = new $type_class( $name, $setting, $curr_value );
ob_start();
$render_type->render_setting( $override_input );
Expand Down Expand Up @@ -414,8 +417,8 @@ public static function render_checkbox_option( $name = '', $id = '', $current =
* Render the HTML for an input text to be used on the field & widgets options
* @param string $name Unique name of the field. Exampe: `fields[directory_list-title][5374ff6ab128b][custom_label]`
* @param string $current [current value]
* @param string $desc Option description
* @param string $add_merge_tags Add merge tags to the input?
* @param array $args Field settings, including `class` key for CSS class
* @return string [html tags]
*/
public static function render_text_option( $name = '', $id = '', $current = '', $add_merge_tags = NULL, $args = array() ) {
Expand Down Expand Up @@ -444,8 +447,8 @@ public static function render_text_option( $name = '', $id = '', $current = '',
* Render the HTML for an textarea input to be used on the field & widgets options
* @param string $name Unique name of the field. Exampe: `fields[directory_list-title][5374ff6ab128b][custom_label]`
* @param string $current [current value]
* @param string $desc Option description
* @param string $add_merge_tags Add merge tags to the input?
* @param string|boolean $add_merge_tags Add merge tags to the input?
* @param array $args Field settings, including `class` key for CSS class
* @return string [html tags]
*/
public static function render_textarea_option( $name = '', $id = '', $current = '', $add_merge_tags = NULL, $args = array() ) {
Expand All @@ -464,7 +467,6 @@ public static function render_textarea_option( $name = '', $id = '', $current =
}

$class .= !empty( $args['class'] ) ? 'widefat '.$args['class'] : 'widefat';
$type = !empty( $args['type'] ) ? $args['type'] : 'text';

return '<textarea name="'. esc_attr( $name ) .'" id="'. esc_attr( $id ) .'" class="'.esc_attr( $class ).'">'. esc_textarea( $current ) .'</textarea>';
}
Expand Down
12 changes: 6 additions & 6 deletions includes/admin/metaboxes/class-gravityview-admin-metaboxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ class GravityView_Admin_Metaboxes {

static $metaboxes_dir;

/**
* @var int The post ID of the current View
*/
var $post_id = 0;

/**
*
*/
Expand Down Expand Up @@ -191,10 +196,6 @@ private function get_data_source_header( $post_id ) {
*/
function render_data_source_metabox( $post ) {

if( !empty( $post->ID ) ) {
$this->post_id = $post->ID;
}

include self::$metaboxes_dir . 'views/data-source.php';

}
Expand All @@ -214,7 +215,7 @@ function render_select_template_metabox( $post ) {
/**
* Generate the script tags necessary for the Gravity Forms Merge Tag picker to work.
*
* @param mixed $curr_form Form ID
* @param int $curr_form Form ID
* @return null|string Merge tags html; NULL if $curr_form isn't defined.
*/
public static function render_merge_tags_scripts( $curr_form ) {
Expand Down Expand Up @@ -290,7 +291,6 @@ function render_view_settings_metabox( $post ) {
* Render shortcode hint in the Publish metabox
*
* @access public
* @param object $post
* @return void
*/
function render_shortcode_hint() {
Expand Down
4 changes: 2 additions & 2 deletions includes/admin/metaboxes/class-gravityview-metabox-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ class GravityView_Metabox_Tab {
* @param string $file The file name of a file stored in the /gravityview/includes/admin/metaboxes/views/ directory to render the metabox output, or the full path to a file. If defined, `callback` is not used.
* @param string $icon_class_name Icon class used in vertical tabs. Supports non-dashicon. If dashicons, no need for `dashicons ` prefix
* @param string $callback Function to render the metabox, if $file is not defined.
* @param null $callback_args Arguments passed to the callback
* @param array $callback_args Arguments passed to the callback
* @return void
*/
function __construct( $id, $title = '', $file = '', $icon_class_name = '', $callback = '', $callback_args = null ) {
function __construct( $id, $title = '', $file = '', $icon_class_name = '', $callback = '', $callback_args = array() ) {

$this->id = $this->prefix.$id;
$this->title = $title;
Expand Down
1 change: 1 addition & 0 deletions includes/admin/metaboxes/views/data-source.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @package GravityView
* @subpackage Gravityview/admin/metaboxes/views
* @since 1.8
* @global WP_Post $post
*/


Expand Down
9 changes: 8 additions & 1 deletion includes/class-admin-add-shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ function is_post_editor_screen() {
* @return void
*/
function add_shortcode_button() {

/**
* @since 1.15.3
*/
if( ! GVCommon::has_cap( array( 'publish_gravityviews' ) ) ) {
return;
}

if( !$this->is_post_editor_screen() ) {
return;
}
Expand Down Expand Up @@ -144,7 +152,6 @@ function add_shortcode_popup() {
* Enqueue scripts and styles
*
* @access public
* @param mixed $hook
* @return void
*/
function add_scripts_and_styles() {
Expand Down
2 changes: 1 addition & 1 deletion includes/class-admin-approve-entries.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ private static function update_bulk( $entries, $approved, $form_id ) {
*
* @access public
* @static
* @param int $lead_id (default: 0)
* @param int $entry_id (default: 0)
* @param int $approved (default: 0)
* @param int $form_id (default: 0)
* @param int $approvedcolumn (default: 0)
Expand Down
Loading

0 comments on commit 21157a0

Please sign in to comment.