WordPress.org

Plugin Directory

Changeset 1477464


Ignore:
Timestamp:
08/18/16 04:35:29 (6 months ago)
Author:
katzwebdesign
Message:

Version 3.8.1

Location:
gravity-forms-addons
Files:
343 added
4 edited

Legend:

Unmodified
Added
Removed
  • gravity-forms-addons/trunk/edit-form.php

    r1305745 r1477464  
    66 
    77    static public function initialize() { 
    8         $GFDirectory_EditForm = new GFDirectory_EditForm(); 
     8        new self; 
    99    } 
    1010 
     
    1717            add_filter('admin_head', array(&$this,'directory_admin_head')); 
    1818 
    19             if( isset($_REQUEST['id'] ) ) { 
     19            if( isset($_REQUEST['id'] ) || self::is_gravity_page('gf_entries') ) { 
    2020                add_filter('gform_tooltips', array(&$this, 'directory_tooltips')); //Filter to add a new tooltip 
    2121                add_action("gform_editor_js", array(&$this, "editor_script")); //Action to inject supporting script to the form editor page 
    22                 add_action("admin_head", array(&$this, "toolbar_links")); //Action to inject supporting script to the form editor page 
     22 
     23                // No need to add via JS any more. 
     24                if( class_exists( 'GFForms' ) && version_compare( GFForms::$version, '2.0', '>=' ) ) { 
     25                    add_filter( 'gform_toolbar_menu', array( $this, 'toolbar_menu_item' ), 10, 2 ); 
     26                } else { 
     27                    add_action("admin_head", array(&$this, "toolbar_links")); //Action to inject supporting script to the form editor page 
     28                } 
    2329                add_action("gform_field_advanced_settings", array(&$this,"use_as_entry_link_settings"), 10, 2); 
    2430                add_filter("gform_add_field_buttons", array(&$this,"add_field_buttons")); 
     
    101107        // Entries screen shows first form's entries by default, if not specified 
    102108        if( isset( $_GET['id'] ) ) { 
    103             $formID = $_GET['id']; 
     109            $formID = intval( $_GET['id'] ); 
    104110        } else { 
    105111            if( class_exists('RGFormsModel') ) { 
     
    109115        } 
    110116 
    111         if( !( self::is_gravity_page('gf_entries') && isset( $formID ) && !self::is_gravity_page('gf_edit_forms') ) ) { return; } 
     117        if( !( self::is_gravity_page('gf_entries') && !self::is_gravity_page('gf_edit_forms') ) ) { 
     118            return; 
     119        } 
     120 
     121        if( ! isset( $formID ) ) { 
     122            return; 
     123        } 
    112124 
    113125        // Don't display on single entry view. 
     
    249261 
    250262                // Add the header column 
    251                 $('thead th.check-column:eq(1), tfoot th.check-column:eq(1)').after('<th class="manage-column column-cb check-column"><a href="<?php echo esc_url( add_query_arg(array('sort' => $_gform_directory_approvedcolumn)) ); ?>"><img src="<?php echo plugins_url( '/images/form-button-1.png', __FILE__); ?>" style="text-align:center; margin:0 auto; display:block;" title="<?php echo esc_js( __('Show entry in directory view?', 'gravity-forms-addons')); ?>" /></span></a></th>'); 
     263                $('thead .column-is_starred, tfoot .column-is_starred').after('<th class="manage-column column-is_starred sortable"><a href="<?php echo esc_url( add_query_arg(array('sort' => $_gform_directory_approvedcolumn)) ); ?>"><img src="<?php echo plugins_url( '/images/form-button-1.png', __FILE__); ?>" title="<?php echo esc_js( __('Show entry in directory view?', 'gravity-forms-addons')); ?>" /></span></a></th>'); 
    252264 
    253265                // Add to each row 
     
    324336    } 
    325337 
     338    /** 
     339     * Add "Directory Columns" item to GF toolbar in GF 2.0+ 
     340     * 
     341     * @param array $menu_items Menu items in GF toolbar 
     342     * @param int $form_id Form ID 
     343     * 
     344     * @return array 
     345     */ 
     346    function toolbar_menu_item( $menu_items = array(), $form_id = 0 ) { 
     347 
     348        wp_enqueue_style( 'thickbox' ); 
     349 
     350        $entries_capabilities = array( 
     351            'gravityforms_view_entries', 
     352            'gravityforms_edit_entries', 
     353            'gravityforms_delete_entries' 
     354        ); 
     355 
     356        $menu_items['directory_columns'] = array( 
     357            'label'        => __('Directory Columns', 'gravity-forms-addons'), 
     358            'icon'         => '<i class="dashicons dashicons-welcome-widgets-menus" style="line-height:17px"></i>', 
     359            'title'        => __('Modify Gravity Forms Directory Columns', 'gravity-forms-addons'), 
     360            'url'          => sprintf( '?gf_page=directory_columns&id=%d&add=entry&TB_iframe=true&height=600&width=700', $form_id ), 
     361            'menu_class'   => 'gf_form_toolbar_directory', 
     362            'link_class'   => 'thickbox', 
     363            'capabilities' => $entries_capabilities, 
     364            'priority'     => 200, 
     365        ); 
     366 
     367        return $menu_items; 
     368    } 
     369 
     370    /** 
     371    * Add "Directory Columns" link to GF toolbar. No longer used after 2.0 
     372    * @see toolbar_menu_item 
     373    * @return void 
     374    */ 
    326375    public function toolbar_links() { 
     376 
    327377        wp_enqueue_style( 'thickbox' ); 
     378         
    328379    ?> 
    329380        <script type='text/javascript'> 
    330381            jQuery(document).ready(function($) { 
    331                 var url = '<?php echo add_query_arg(array('gf_page' => 'directory_columns', 'id' => @$_GET['id'], 'TB_iframe' => 'true', 'height' => 600, 'width' => 700), admin_url()); ?>'; 
     382                var url = '<?php echo esc_url_raw( add_query_arg(array('gf_page' => 'directory_columns', 'id' => intval( $_GET['id'] ), 'TB_iframe' => 'true', 'height' => 600, 'width' => 700), admin_url()) ); ?>'; 
    332383                $link = $('<li class="gf_form_toolbar_preview gf_form_toolbar_directory" id="gf_form_toolbar_directory"><a href="'+url+'" class="thickbox" title="<?php echo esc_js(__('Modify Gravity Forms Directory Columns', 'gravity-forms-addons')); ?>"><i class="dashicons dashicons-welcome-widgets-menus" style="line-height:17px"></i> <?php echo esc_js( __('Directory Columns', 'gravity-forms-addons')); ?></a></li>'); 
    333384                $('#gf_form_toolbar_links').append($link); 
  • gravity-forms-addons/trunk/gravity-forms-addons.php

    r1305745 r1477464  
    55Description:    Turn <a href="http://katz.si/gravityforms">Gravity Forms</a> into a great WordPress directory...and more! 
    66Author:         Katz Web Services, Inc. 
    7 Version:        3.8 
     7Version:        3.8.1 
    88Author URI:     https://gravityview.co 
    99Text Domain:    gravity-forms-addons 
     
    3737    private static $path = "gravity-forms-addons/gravity-forms-addons.php"; 
    3838    private static $slug = "gravity-forms-addons"; 
    39     private static $version = "3.8"; 
     39    private static $version = "3.8.1"; 
    4040    private static $min_gravityforms_version = "1.5"; 
    4141 
     
    20412041            } 
    20422042            if ( self::check_approval( $lead, $_gform_directory_approvedcolumn ) ) { 
    2043                 echo '<td style="display:none;"><input type="hidden" class="lead_approved" id="lead_approved_' . $lead['id'] . '" value="true" /></td>'; 
     2043                echo '<span style="display:none;"><input type="hidden" class="lead_approved" id="lead_approved_' . $lead['id'] . '" value="true" /></span>'; 
    20442044            } 
    20452045        } 
  • gravity-forms-addons/trunk/readme.txt

    r1305745 r1477464  
    22Tags: gravity forms, gravity form, forms, gravity, form, directory, business, business directory, directorypress, classifieds, cforms, formidable, gravityview 
    33Requires at least: 3.3 
    4 Tested up to: 4.4 
    5 Stable tag: 3.8 
     4Tested up to: 4.6 
     5Stable tag: 3.8.1 
    66Contributors: katzwebdesign, katzwebservices 
    77License: GPLv2 or later 
     
    3939 
    4040####Insert a totally configurable table using the editor 
     41 
    4142There are tons of configurable options for how you want the directory to display. 
    4243 
     
    4647* Edit form entries directly from the Entries page (saving two clicks) 
    4748* Easily access form data to use in your website with PHP functions - [Learn more on the plugin's website](https://katz.co/gravity-forms-addons/) 
    48  
    49 #### Other Gravity Forms Add-ons: 
    50  
    51 * <a href="http://wordpress.org/extend/plugins/gravity-forms-salesforce/">Gravity Forms Salesforce Add-on</a> - Integrate Gravity Forms with Salesforce.com 
    52 * <a href="http://wordpress.org/extend/plugins/gravity-forms-highrise/">Gravity Forms Highrise Add-on</a> - Integrate Gravity Forms with Highrise, a CRM 
    53 * <a href="http://wordpress.org/extend/plugins/gravity-forms-constant-contact/">Gravity Forms + Constant Contact</a> - If you use Constant Contact and Gravity Forms, this plugin is for you. 
    54 * <a href="http://wordpress.org/extend/plugins/gravity-forms-mad-mimi/">Gravity Forms Mad Mimi Add-on</a> - Integrate Mad Mimi, a great email marketing company, and Gravity Forms. 
    55 * <a href="http://wordpress.org/extend/plugins/gravity-forms-exacttarget/">Gravity Forms ExactTarget Add-on</a> - Integrate with ExactTarget, an enterprise-class email marketing service 
    5649 
    5750#### Have an idea or issue with this Gravity Forms add-on plugin? 
     
    233226 
    234227== Changelog == 
     228 
     229= 3.8.1 on August 17, 2016 = 
     230* Fixed: Compatibility with Gravity Forms 2.0 Entries screen 
     231    - The "Directory Columns" menu returns to the toolbar 
     232    - Show the "Directory Columns" link when displaying the default form in the admin 
     233    - The "Approved" checkbox now does not break entries layout 
     234* Fixed: PHP warnings shown when configuring directory columns 
    235235 
    236236= 3.8 on December 10, 2015 = 
     
    559559== Upgrade Notice == 
    560560 
     561= 3.8.1 on August 17, 2016 = 
     562* Fixed: Compatibility with Gravity Forms 2.0 Entries screen 
     563    - The "Directory Columns" menu returns to the toolbar 
     564    - Show the "Directory Columns" link when displaying the default form in the admin 
     565    - The "Approved" checkbox now does not break entries layout 
     566* Fixed: PHP warnings shown when configuring directory columns 
     567 
    561568= 3.8 on December 10, 2015 = 
    562569* Fixed: Gravity Forms 1.9.15 Entries screen conflict 
  • gravity-forms-addons/trunk/select_directory_columns.php

    r1305745 r1477464  
    2626    public static function select_columns_page() { 
    2727 
    28         $form_id = $_GET["id"]; 
     28        $form_id = intval( $_GET["id"] ); 
    2929        if ( empty( $form_id ) ) { 
    3030            echo esc_html__( "Oops! We could not locate your form. Please try again.", "gravity-forms-addons" ); 
     
    4343            ?> 
    4444            <style type="text/css"> 
    45                 body { 
    46                     font-family: "Lucida Grande", Verdana, Arial, sans-serif; 
    47                 } 
    48  
    4945                #wrapper { 
    5046                    padding: 10px; 
     
    262258            <div class="panel-instructions"> 
    263259                <p><?php esc_html_e( "Drag & drop to order and select which columns are displayed in the Gravity Forms Directory.", "gravity-forms-addons" ) ?></p> 
    264                 <p><?php echo sprintf( esc_html__( "Embed the Directory on a post or a page using %s ", "gravity-forms-addons" ), '<code>[directory form="' . $_GET['id'] . '"]</code>' ); ?></p> 
     260                <p><?php echo sprintf( esc_html__( "Embed the Directory on a post or a page using %s ", "gravity-forms-addons" ), '<code>[directory form="' . $form_id . '"]</code>' ); ?></p> 
    265261            </div> 
    266262            <div class="clear"></div> 
     
    290286                        $approvedcolumn = GFDirectory::get_approved_column( $form ); 
    291287                        foreach ( $form["fields"] as $field ) { 
     288                            if ( is_array( $field ) && ! isset( $field['type'] ) ) { 
     289                                continue; 
     290                            } 
    292291                            if ( 
     292                                ( $field instanceof GF_Field || is_array( $field ) && ! isset( $field['type'] ) ) && 
    293293                                in_array( RGFormsModel::get_input_type( $field ), array( 
    294294                                    "checkbox", 
     
    309309                            ) { 
    310310                                foreach ( $field["inputs"] as $input ) { 
    311                                     if ( ! in_array( $input["id"], $field_ids ) && ! ( $field["type"] == "creditcard" && in_array( $input["id"], array( 
     311                                    if ( ! in_array( $input["id"], $field_ids ) && ! ( rgar( $field, 'type' ) === "creditcard" && in_array( $input["id"], array( 
    312312                                                floatval( "{$field["id"]}.2" ), 
    313313                                                floatval( "{$field["id"]}.3" ), 
Note: See TracChangeset for help on using the changeset viewer.