Plugin Directory

Changeset 1088624


Ignore:
Timestamp:
02/13/2015 01:54:53 AM (11 years ago)
Author:
unclhos
Message:

Per Field Persistence added

Location:
gravity-forms-data-persistence-add-on-reloaded/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gravity-forms-data-persistence-add-on-reloaded/trunk/persistent_multipage_forms-reloaded.php

    r1024140 r1088624  
    55  Description: This is a <a href="http://www.gravityforms.com/" target="_blank">Gravity Form</a> plugin. A big limitation with Gravity Form is, in case of big multipage forms, if you close or refresh the page during somewhere midle of some step. all the steps data will loose. this plugin solves that problem. This is an updated version of asthait's plugin.
    66  Author: Robert Iseley
    7   Version: 3.2.2
     7  Version: TRUNK
    88  Author URI: http://www.robertiseley.com
    99  Orginal Plugin by: asthait
    1010 */
    1111
    12 define('GFDPVERSION', '3.2.2');
    13 
    14 add_action('wp_head', 'ri_gfdp_version_head');
     12define( 'GFDPVERSION', 'TRUNK' );
     13
     14add_action( 'wp_head', 'ri_gfdp_version_head' );
    1515function ri_gfdp_version_head() {
    16     echo '<!-- Gravity Forms Data Persistence Add-On Reloaded Version '.GFDPVERSION.' -->';
     16    echo '<!-- Gravity Forms Data Persistence Add-On Reloaded Version ' . GFDPVERSION . ' -->';
    1717}
    1818
    1919// Register garlic script for local persistence
    20 add_action('wp_enqueue_scripts', 'ri_gfdp_script_register');
     20add_action( 'wp_enqueue_scripts', 'ri_gfdp_script_register' );
    2121function ri_gfdp_script_register() {
    22     wp_enqueue_script('jquery');
     22    wp_enqueue_script( 'jquery' );
    2323}
    2424
    2525// Render persistence data before form output
    26 add_filter("gform_pre_render", "ri_pre_populate_the_form");
    27 function ri_pre_populate_the_form($form) {
    28     if ($form['isPersistent'] || $form['ri_gfdp_persist']) {
    29         $current_page = GFFormDisplay::get_current_page($form["id"]);
    30         if ($current_page == 1) {
    31             $option_key = ri_getFormOptionKeyForGF($form);
    32             if (get_option($option_key)) {
    33                 $_POST = json_decode(get_option($option_key), true);
    34             }
    35         }
    36     }   
    37     return $form;
     26add_filter( "gform_pre_render", "ri_pre_populate_the_form" );
     27function ri_pre_populate_the_form( $form ) {
     28    if ( ! empty( $form['isPersistent'] ) || ! empty( $form['ri_gfdp_persist'] ) ) {
     29        $current_page = GFFormDisplay::get_current_page( $form["id"] );
     30        if ( $current_page == 1 ) {
     31            $option_key = ri_getFormOptionKeyForGF( $form );
     32            if ( get_option( $option_key ) ) {
     33                $_POST = json_decode( get_option( $option_key ), true );
     34                foreach ( $form['fields'] as $field ) {
     35                    if ( rgar( $field, "allowsPrepopulate" ) ) {
     36                        if ( is_array( rgar( $field, "inputs" ) ) ) {
     37                            foreach ( $field["inputs"] as $input ) {
     38                                if ( ! empty( $_GET[ $input['name'] ] ) ) {
     39                                    $_POST[ 'input_' . str_replace( '.', '_', $input['id'] ) ] = $_GET[ $input['name'] ];
     40                                }
     41                            }
     42                        } else {
     43                            if ( ! empty( $_GET[ $field['inputName'] ] ) ) {
     44                                $_POST[ 'input_' . $field['id'] ] = $_GET[ $field['inputName'] ];
     45                            }
     46                        }
     47                    }
     48                }
     49            }
     50        }
     51    }
     52
     53    return $form;
    3854}
    3955
     
    4258function ri_gfdp_ajax() {
    4359    global $wpdb; // this is how you get access to the database
    44     parse_str($_POST['form'], $data);
    45     $form_id = isset($data['gform_submit']) ? $data["gform_submit"] : 0;
    46         if($form_id){
    47             $form_info = RGFormsModel::get_form($form_id);
    48             $is_valid_form = $form_info && $form_info->is_active;
    49             if($is_valid_form){
    50                 $form = RGFormsModel::get_form_meta($form_id);
    51                 $form = RGFormsModel::add_default_properties($form);
    52                 ri_gfdp_ajax_save($form);
    53                 echo "Saved";   
    54             } else {
    55                 echo "Invalid Form";
    56             }
    57         } else {
     60    parse_str( $_POST['form'], $data );
     61    $form_id = isset( $data['gform_submit'] ) ? $data["gform_submit"] : 0;
     62    if ( $form_id ) {
     63        $form_info     = RGFormsModel::get_form( $form_id );
     64        $is_valid_form = $form_info && $form_info->is_active;
     65        if ( $is_valid_form ) {
     66            $form = RGFormsModel::get_form_meta( $form_id );
     67            $form = RGFormsModel::add_default_properties( $form );
     68            ri_gfdp_ajax_save( $form );
     69            echo "Saved";
     70        } else {
    5871            echo "Invalid Form";
    5972        }
     73    } else {
     74        echo "Invalid Form";
     75    }
    6076
    6177    die(); // this is required to terminate immediately and return a proper response
     
    6480
    6581//The js for ajax call
    66 add_action('gform_enqueue_scripts', 'ri_gfdp_js_enqueue', 90, 2);
    67 function ri_gfdp_js_enqueue($form, $is_ajax) {
    68     if($form['ri_gfdp_persist'] == 'ajax' && is_user_logged_in()) {
    69         add_action('wp_footer', 'ri_gfdp_js');
    70     }
    71 }
    72 function ri_gfdp_js() {
    73 ?>
    74         <script type="text/javascript" >
    75         var changed = false;
    76        
     82add_action( 'gform_enqueue_scripts', 'ri_gfdp_js_enqueue', 90, 2 );
     83function ri_gfdp_js_enqueue( $form, $is_ajax ) {
     84    if ( $form['ri_gfdp_persist'] == 'ajax' && is_user_logged_in() ) {
     85        add_action( 'wp_footer', 'ri_gfdp_js' );
     86    }
     87}
     88
     89function ri_gfdp_js() {
     90    ?>
     91    <script type="text/javascript">
     92        var changed = false;
     93
    7794        function gfdp_events() {
    78             jQuery('form').on('change keyup', function() {
    79                     changed = true;
    80                 })
    81         }
    82        
     95            jQuery('form').on('change keyup', function () {
     96                changed = true;
     97            })
     98        }
     99
    83100        jQuery(document).ready(gfdp_events);
    84101        jQuery(document).ajaxComplete(gfdp_events);
    85        
    86        
    87         function gfdp_ajax($) {
    88             if(changed == true) {
    89                 var data = {
    90                     'action': 'gfdp_save',
    91                     'form': jQuery('form').serialize()
    92                 };
    93    
    94                 jQuery.ajax({
    95                     url: '<?php echo admin_url('admin-ajax.php'); ?>',
    96                     type: 'POST',
    97                     data: data,
    98                     success: function(response) {
     102
     103
     104        function gfdp_ajax($) {
     105            if (changed == true) {
     106                var data = {
     107                    'action': 'gfdp_save',
     108                    'form': jQuery('form').serialize()
     109                };
     110
     111                jQuery.ajax({
     112                    url: '<?php echo admin_url('admin-ajax.php'); ?>',
     113                    type: 'POST',
     114                    data: data,
     115                    success: function (response) {
    99116                        changed = false;
    100                     }
    101                 })
    102             }
    103         };
    104        
    105         jQuery(document).ready( setInterval(gfdp_ajax, 10000));
    106         </script> <?php
     117                    }
     118                })
     119            }
     120        }
     121        ;
     122
     123        jQuery(document).ready(setInterval(gfdp_ajax, 10000));
     124    </script> <?php
    107125}
    108126
    109127// Saving data from ajax call
    110 function ri_gfdp_ajax_save($form, $coming_from_page, $current_page) {
    111     if ($form['ri_gfdp_persist'] == 'ajax') {
    112         if (is_user_logged_in()) {
    113             $option_key = ri_getFormOptionKeyForGF($form);
    114             parse_str($_POST['form'], $data);
    115             $data = ri_gfdp_sanitize_data($data, $form);
    116             update_option($option_key, json_encode($data));
    117         }
    118     }
    119 }
    120 
    121 function ri_gfdp_sanitize_data($data, $form) {
    122     foreach ($form['fields'] as $field) {
    123         if($field['ri_gfdp_no_persist']) {
    124             if(is_array($field['inputs'])) {
    125                 foreach($field['inputs'] as $input) {
    126                     $data['input_'.str_replace('.','_',$input['id'])] = '';
     128function ri_gfdp_ajax_save( $form, $coming_from_page, $current_page ) {
     129    if ( $form['ri_gfdp_persist'] == 'ajax' ) {
     130        if ( is_user_logged_in() ) {
     131            $option_key = ri_getFormOptionKeyForGF( $form );
     132            parse_str( $_POST['form'], $data );
     133            $data = ri_gfdp_sanitize_data( $data, $form );
     134            update_option( $option_key, json_encode( $data ) );
     135        }
     136    }
     137}
     138
     139function ri_gfdp_sanitize_data( $data, $form ) {
     140    foreach ( $form['fields'] as $field ) {
     141        if ( $field['ri_gfdp_no_persist'] ) {
     142            if ( is_array( $field['inputs'] ) ) {
     143                foreach ( $field['inputs'] as $input ) {
     144                    $data[ 'input_' . str_replace( '.', '_', $input['id'] ) ] = '';
    127145                }
    128             } else
    129             $data['input_'.$field['id']] = ''; 
    130         }
    131     }
    132     return $data;   
     146            } else {
     147                $data[ 'input_' . $field['id'] ] = '';
     148            }
     149        }
     150    }
     151
     152    return $data;
    133153}
    134154
    135155// Updating persistence data on page change
    136 add_action("gform_post_paging", "ri_page_changed", 10, 3);
    137 function ri_page_changed($form, $coming_from_page, $current_page) {
    138     if ($form['isPersistent'] || $form['ri_gfdp_persist']) {
    139         if (is_user_logged_in()) {
    140             $option_key = ri_getFormOptionKeyForGF($form);
    141             $data = ri_gfdp_sanitize_data($_POST, $form);
    142             update_option($option_key, json_encode($data));
    143         }
    144     }
     156add_action( "gform_post_paging", "ri_page_changed", 10, 3 );
     157function ri_page_changed( $form, $coming_from_page, $current_page ) {
     158    if ( $form['isPersistent'] || $form['ri_gfdp_persist'] ) {
     159        if ( is_user_logged_in() ) {
     160            $option_key = ri_getFormOptionKeyForGF( $form );
     161            $data       = ri_gfdp_sanitize_data( $_POST, $form );
     162            update_option( $option_key, json_encode( $data ) );
     163        }
     164    }
    145165}
    146166
    147167// Updating or clearning persistence data on form submission
    148 add_action("gform_post_submission", "ri_set_post_content", 10, 2);
    149 function ri_set_post_content($entry, $form) {
    150     if ($form['isPersistent'] || $form['ri_gfdp_persist']) {
    151         //Update form data in wp_options table
    152         if (is_user_logged_in()) {
    153             $option_key = ri_getFormOptionKeyForGF($form);
    154            
    155             if($form['isEnablePersistentClear'] || $form['ri_gfdp_persist_clear'])
    156                 delete_option($option_key);
    157             else {
    158                 $data = ri_gfdp_sanitize_data($_POST, $form);
    159                 update_option($option_key, json_encode($data));
    160             }
    161 
    162             $entry_option_key = ri_getEntryOptionKeyForGF($form);
    163             if (get_option($entry_option_key)) {
    164                 //Delete old entry from GF tables
    165                 if(isset($form['ri_gfdp_persist'])) {
    166                    
    167                     if (!$form['ri_gfdp_multiple_entries']) {
    168                        RGFormsModel::delete_lead(get_option($entry_option_key));
    169                     } 
     168add_action( "gform_post_submission", "ri_set_post_content", 10, 2 );
     169function ri_set_post_content( $entry, $form ) {
     170    if ( $form['isPersistent'] || $form['ri_gfdp_persist'] ) {
     171        //Update form data in wp_options table
     172        if ( is_user_logged_in() ) {
     173            $option_key = ri_getFormOptionKeyForGF( $form );
     174
     175            if ( $form['isEnablePersistentClear'] || $form['ri_gfdp_persist_clear'] ) {
     176                delete_option( $option_key );
     177            } else {
     178                $data = ri_gfdp_sanitize_data( $_POST, $form );
     179                update_option( $option_key, json_encode( $data ) );
     180            }
     181
     182            $entry_option_key = ri_getEntryOptionKeyForGF( $form );
     183            if ( get_option( $entry_option_key ) ) {
     184                //Delete old entry from GF tables
     185                if ( isset( $form['ri_gfdp_persist'] ) ) {
     186
     187                    if ( ! $form['ri_gfdp_multiple_entries'] ) {
     188                        RGFormsModel::delete_lead( get_option( $entry_option_key ) );
     189                    }
    170190                } else {
    171                     if(!$form['isEnableMulipleEntry']) {
    172                        RGFormsModel::delete_lead(get_option($entry_option_key));
     191                    if ( ! $form['isEnableMulipleEntry'] ) {
     192                        RGFormsModel::delete_lead( get_option( $entry_option_key ) );
    173193                    }
    174194                }
    175             }
    176         }
    177 
    178         //Update entry in wp_options table
    179         update_option($entry_option_key, $entry['id']);
    180     }
     195            }
     196        }
     197
     198        //Update entry in wp_options table
     199        update_option( $entry_option_key, $entry['id'] );
     200    }
    181201}
    182202
    183203// Create and return option table key for a form and user
    184 function ri_getFormOptionKeyForGF($form) {
    185 
    186     global $current_user;
    187     get_currentuserinfo();
    188 
    189     $option_key = $current_user->user_login . '_GF_' . $form['id'];
    190 
    191     return $option_key;
     204function ri_getFormOptionKeyForGF( $form ) {
     205
     206    global $current_user;
     207    get_currentuserinfo();
     208
     209    $option_key = $current_user->user_login . '_GF_' . $form['id'];
     210
     211    return $option_key;
    192212}
    193213
    194214// Create and return option table key for user form entry
    195 function ri_getEntryOptionKeyForGF($form) {
    196 
    197     global $current_user;
    198     get_currentuserinfo();
    199 
    200     $option_key = $current_user->user_login . '_GF_' . $form['id'] . '_entry';
    201 
    202     return $option_key;
     215function ri_getEntryOptionKeyForGF( $form ) {
     216
     217    global $current_user;
     218    get_currentuserinfo();
     219
     220    $option_key = $current_user->user_login . '_GF_' . $form['id'] . '_entry';
     221
     222    return $option_key;
    203223}
    204224
    205225//Add persistent settings to the form settings
    206 add_filter("gform_form_settings", "ri_persistency_settings", 50, 2);
    207 function ri_persistency_settings($form_settings, $form) {
    208    
    209     // create settings on position 50 (right after Admin Label)
     226add_filter( "gform_form_settings", "ri_persistency_settings", 50, 2 );
     227function ri_persistency_settings( $form_settings, $form ) {
     228
     229    // create settings on position 50 (right after Admin Label)
    210230    $tr_persistent = '
    211231        <tr>
     
    213233        </tr>
    214234        <tr>
    215             <th>Persistence '. gform_tooltip('ri_gfdp_persist', '', true) .' </th>
     235            <th>Persistence ' . gform_tooltip( 'ri_gfdp_persist', '', true ) . ' </th>
    216236            <td>
    217237                <select name="ri_gfdp_persist" id="ri_gfdp_persist">
    218                     <option value="off" '.selected(rgar($form, "ri_gfdp_persist"), 'off', false).'>Off</option>
    219                     <option value="submit_only" '.selected(rgar($form, "ri_gfdp_persist"), 'submit_only', false).'>Save data on page change/submit only</option>
    220                     <option value="ajax" '.selected(rgar($form, "ri_gfdp_persist"), 'ajax', false).'>Save data with ajax</option>
     238                    <option value="off" ' . selected( rgar( $form, "ri_gfdp_persist" ), 'off', false ) . '>Off</option>
     239                    <option value="submit_only" ' . selected( rgar( $form, "ri_gfdp_persist" ), 'submit_only', false ) . '>Save data on page change/submit only</option>
     240                    <option value="ajax" ' . selected( rgar( $form, "ri_gfdp_persist" ), 'ajax', false ) . '>Save data with ajax</option>
    221241                </select>
    222242            </td>
    223243        </tr>';
    224        
     244
    225245    $tr_persistent .= '
    226246        <tr>
    227             <th>Multiple Entries '. gform_tooltip("ri_gfdp_multiple_entries", '', true) .' </th>
     247            <th>Multiple Entries ' . gform_tooltip( "ri_gfdp_multiple_entries", '', true ) . ' </th>
    228248            <td>
    229             <input type="checkbox" name="ri_gfdp_multiple_entries" id="ri_gfdp_multiple_entries" '.checked(rgar($form, "ri_gfdp_multiple_entries"),'1', false).'" value="1" />
     249            <input type="checkbox" name="ri_gfdp_multiple_entries" id="ri_gfdp_multiple_entries" ' . checked( rgar( $form, "ri_gfdp_multiple_entries" ), '1', false ) . '" value="1" />
    230250            <label for="ri_gfdp_multiple_entries">Allow multiple entries</label>
    231251            </td>
    232252        </tr>';
    233        
     253
    234254    $tr_persistent .= '
    235255        <tr>
    236             <th>Clear Persistence '. gform_tooltip("ri_gfdp_clear_persist", '', true) .' </th>
     256            <th>Clear Persistence ' . gform_tooltip( "ri_gfdp_clear_persist", '', true ) . ' </th>
    237257           
    238258            <td>
    239             <input type="checkbox" name="ri_gfdp_persist_clear" id="ri_gfdp_persist_clear" '.checked(rgar($form, "ri_gfdp_persist_clear"), '1', false).'" value="1" />
     259            <input type="checkbox" name="ri_gfdp_persist_clear" id="ri_gfdp_persist_clear" ' . checked( rgar( $form, "ri_gfdp_persist_clear" ), '1', false ) . '" value="1" />
    240260            <label for="ri_gfdp_persist_clear"> Clear persistence on submit</label>
    241261            </td>
    242262        </tr>';
    243        
    244         $form_settings["Form Options"]['persistent'] = $tr_persistent;
    245        
    246         return $form_settings;
    247 }
    248 
    249 add_filter('gform_pre_form_settings_save', 'ri_gfdp_save_form_settings');
    250 function ri_gfdp_save_form_settings($form) {
    251    
     263
     264    $form_settings["Form Options"]['persistent'] = $tr_persistent;
     265
     266    return $form_settings;
     267}
     268
     269add_filter( 'gform_pre_form_settings_save', 'ri_gfdp_save_form_settings' );
     270function ri_gfdp_save_form_settings( $form ) {
     271
    252272    //Remove old setting names
    253     unset($form['isPersistent']);
    254     unset($form['isEnableMulipleEntry']);
    255     unset($form['isEnablePersistentClear']);
    256    
     273    unset( $form['isPersistent'] );
     274    unset( $form['isEnableMulipleEntry'] );
     275    unset( $form['isEnablePersistentClear'] );
     276
    257277    //update settings
    258     $form['ri_gfdp_persist'] = rgpost('ri_gfdp_persist');
    259     $form['ri_gfdp_multiple_entries'] = rgpost('ri_gfdp_multiple_entries');
    260     $form['ri_gfdp_persist_clear'] = rgpost('ri_gfdp_persist_clear');
    261    
     278    $form['ri_gfdp_persist']          = rgpost( 'ri_gfdp_persist' );
     279    $form['ri_gfdp_multiple_entries'] = rgpost( 'ri_gfdp_multiple_entries' );
     280    $form['ri_gfdp_persist_clear']    = rgpost( 'ri_gfdp_persist_clear' );
     281
    262282    return $form;
    263    
    264 };
     283
     284}
     285
     286;
    265287
    266288// Action to inject supporting script to the form editor page
    267 add_action("gform_advanced_settings", "ri_editor_script_persistency");
     289add_action( "gform_advanced_settings", "ri_editor_script_persistency" );
    268290function ri_editor_script_persistency() {
    269     ?>
    270     <script type='text/javascript'>
    271         if(typeof form != 'undefined') {
    272             if(typeof form.isPersistent != 'undefined') {
    273                 jQuery("#ri_gfdp_persist").val('submit_only'); 
    274             }
    275             if(typeof form.isEnableMulipleEntry != 'undefined') {
    276                 jQuery("#ri_gfdp_multiple_entries").attr("checked", form.isEnableMulipleEntry); 
    277             }
    278             if(typeof form.isEnablePersistentClear != 'undefined') {
     291    ?>
     292    <script type='text/javascript'>
     293        if (typeof form != 'undefined') {
     294            if (typeof form.isPersistent != 'undefined') {
     295                jQuery("#ri_gfdp_persist").val('submit_only');
     296            }
     297            if (typeof form.isEnableMulipleEntry != 'undefined') {
     298                jQuery("#ri_gfdp_multiple_entries").attr("checked", form.isEnableMulipleEntry);
     299            }
     300            if (typeof form.isEnablePersistentClear != 'undefined') {
    279301                jQuery("#ri_gfdp_persist_clear").attr("checked", form.isEnablePersistentClear);
    280302            }
    281303        }
    282     </script>
    283     <?php
    284 }
    285 
    286 add_action('gform_field_advanced_settings', 'ri_gfdp_advanced_settings', 10, 2);
    287 function ri_gfdp_advanced_settings($position, $form_id) {
    288     if($position == 550) {
    289     ?> 
     304    </script>
     305<?php
     306}
     307
     308add_action( 'gform_field_advanced_settings', 'ri_gfdp_advanced_settings', 10, 2 );
     309function ri_gfdp_advanced_settings( $position, $form_id ) {
     310    if ( $position == 550 ) {
     311        ?>
    290312        <li class="field_ri_gfdp_no_persist_setting">
    291             <input type="checkbox" id="ri_gfdp_no_persist" name="ri_gfdp_no_persist" onclick="SetFieldProperty('ri_gfdp_no_persist', this.checked);" />
    292             <label for="ri_gfdp_no_persist" class="inline">
    293                 <?php _e('Do not allow persistence', 'ri_gfdp'); ?>
    294                 <?php gform_tooltip('ri_gfdp_no_persist'); ?>
    295             </label> 
    296         </li>
    297     <?php   
     313            <input type="checkbox" id="ri_gfdp_no_persist" name="ri_gfdp_no_persist"
     314                   onclick="SetFieldProperty('ri_gfdp_no_persist', this.checked);"/>
     315            <label for="ri_gfdp_no_persist" class="inline">
     316                <?php _e( 'Do not allow persistence', 'ri_gfdp' ); ?>
     317                <?php gform_tooltip( 'ri_gfdp_no_persist' ); ?>
     318            </label>
     319        </li>
     320    <?php
    298321    }
    299322}
    300323
    301324//Action to inject supporting script to the form editor page
    302 add_action("gform_editor_js", "ri_gfdp_editor_script", 11);
    303 function ri_gfdp_editor_script(){
    304     ?>
    305     <script type='text/javascript'>
    306         //adding setting to fields of type "text"
    307         //fieldSettings["text"] += ", .field_ri_gfdp_no_persist_setting";
    308 
    309         //binding to the load field settings event to initialize the checkbox
    310         jQuery(document).bind("gform_load_field_settings", function(event, field, form){
    311             jQuery("#ri_gfdp_no_persist").attr("checked", field["ri_gfdp_no_persist"] == true);
    312         });
    313     </script>
    314     <?php
     325add_action( "gform_editor_js", "ri_gfdp_editor_script", 11 );
     326function ri_gfdp_editor_script() {
     327    ?>
     328    <script type='text/javascript'>
     329        //adding setting to fields of type "text"
     330        //fieldSettings["text"] += ", .field_ri_gfdp_no_persist_setting";
     331
     332        //binding to the load field settings event to initialize the checkbox
     333        jQuery(document).bind("gform_load_field_settings", function (event, field, form) {
     334            jQuery("#ri_gfdp_no_persist").attr("checked", field["ri_gfdp_no_persist"] == true);
     335        });
     336    </script>
     337<?php
    315338}
    316339
    317340// Filter to add a new tooltip
    318 add_filter('gform_tooltips', 'ri_add_persistency_tooltips');
    319 function ri_add_persistency_tooltips($tooltips) {
    320     $tooltips["ri_gfdp_persist"] = "<h6>Persistency</h6>Select to save users progress with form so they may continue at another time. Must be a logged in user.";
    321     $tooltips["ri_gfdp_multiple_entries"] = "<h6>Multiple Entries Allowed</h6>This will allow multiple entry from same user. User can not edit their last and the previous entry not removed from the entry list";
    322     $tooltips['ri_gfdp_no_persist'] = '<h6>No Persist</h6>Checking this will removed this field(s) from the persistence data. User will have to re-enter information upon returning to the form. This does not affect the submission of an entry. Useful for sensitive information.';
    323     $tooltips['ri_gfdp_clear_persist'] = '<h6>Clear Persist</h6>This option will delete the persistence data when a form is submitted. Allow the user to return to a fresh blank form.';
    324     return $tooltips;
    325 }
     341add_filter( 'gform_tooltips', 'ri_add_persistency_tooltips' );
     342function ri_add_persistency_tooltips( $tooltips ) {
     343    $tooltips["ri_gfdp_persist"]          = "<h6>Persistency</h6>Select to save users progress with form so they may continue at another time. Must be a logged in user.";
     344    $tooltips["ri_gfdp_multiple_entries"] = "<h6>Multiple Entries Allowed</h6>This will allow multiple entry from same user. User can not edit their last and the previous entry not removed from the entry list";
     345    $tooltips['ri_gfdp_no_persist']       = '<h6>No Persist</h6>Checking this will removed this field(s) from the persistence data. User will have to re-enter information upon returning to the form. This does not affect the submission of an entry. Useful for sensitive information.';
     346    $tooltips['ri_gfdp_clear_persist']    = '<h6>Clear Persist</h6>This option will delete the persistence data when a form is submitted. Allow the user to return to a fresh blank form.';
     347
     348    return $tooltips;
     349}
  • gravity-forms-data-persistence-add-on-reloaded/trunk/readme.txt

    r1033453 r1088624  
    1515Consider this scenario:
    1616
    17 1. Your site uses multipage <a href="http://www.gravityforms.com/" target="_blank">Gravity Forms</a>.
    18 2. Your user logs in to the site and starts filling up a 5-step form.
    19 3. During the 3rd step, the user leaves without completely finishing the form.
    20 4. Some days later, the user comes back and logs in to see that his inputs are all gone!
     17a) Your site uses multipage <a href="http://www.gravityforms.com/" target="_blank">Gravity Forms</a>.
     18b) Your user logs in to the site and starts filling up a 5-step form.
     19c) During the 3rd step, the user leaves without completely finishing the form.
     20d) Some days later, the user comes back and logs in to see that his inputs are all gone!
    2121
    2222This happens because Gravity Forms by default does not save partially submitted forms.
     
    4646
    4747We don't provide a dedicated support, but we will try our best to reply you back.
     48If there is a specific feature you would like to sponsor, you can email me directly at: me at robertiseley dot com
    4849
    4950== Screenshots ==
Note: See TracChangeset for help on using the changeset viewer.