Plugin Directory

Changeset 1396079


Ignore:
Timestamp:
04/15/2016 03:06:18 AM (10 years ago)
Author:
travislopes
Message:

Migrate Ninja Forms to Gravity Forms (0.1.1)

  • Updated notification conversion to not use boolval().
Location:
migrate-ninja-forms-to-gravity-forms
Files:
7 added
3 edited

Legend:

Unmodified
Added
Removed
  • migrate-ninja-forms-to-gravity-forms/trunk/class-gf-migrate-nf.php

    r1361045 r1396079  
    88 * Uses the Gravity Forms Add-On Framework use native elements
    99 *
    10  * @since 1.0
     10 * @since 0.1
    1111 */
    1212class GF_Migrate_NF extends GFAddOn {
     
    1515     * Migrate Ninja Forms to Gravity Forms version number
    1616     *
    17      * @since  1.0
     17     * @since  0.1
    1818     * @access protected
    1919     * @var    string $_version Plugin version number
     
    2424     * Minimum supported version of Gravity Forms
    2525     *
    26      * @since  1.0
     26     * @since  0.1
    2727     * @access protected
    2828     * @var    string $_min_gravityforms_version The minimum version of Gravity Forms this plugin supports
     
    3333     * The plugin slug.  Primarily used in the directory name
    3434     *
    35      * @since  1.0
     35     * @since  0.1
    3636     * @access protected
    3737     * @var    string $_slug The slug (no slimy, and not a bug)
     
    4242     * Path to the plugin file, relative to the wp-content/plugins directory
    4343     *
    44      * @since  1.0
     44     * @since  0.1
    4545     * @access protected
    4646     * @var    string $_path The path.
     
    5151     * The absolute path to the main class file.
    5252     *
    53      * @since  1.0
     53     * @since  0.1
    5454     * @access protected
    5555     * @var    string $_full_path The path.
     
    6060     * The URL for more information about this plugin
    6161     *
    62      * @since  1.0
     62     * @since  0.1
    6363     * @access protected
    6464     * @var    string $_url A super cool site that all the cool kids go to
     
    6969     * The title of this plugin
    7070     *
    71      * @since  1.0
     71     * @since  0.1
    7272     * @access protected
    7373     * @var    string $_title The title
     
    7878     * The shorter title
    7979     *
    80      * @since  1.0
     80     * @since  0.1
    8181     * @access protected
    8282     * @var    string $_short_title The title.  In case the other one was too long for you ;)
     
    8787     * The instance of this class.  Used to instantiate.
    8888     *
    89      * @since  1.0
     89     * @since  0.1
    9090     * @access protected
    9191     * @var    object $_instance The instance
     
    9696     * Get an instance of this class.
    9797     *
    98      * @since  1.0
     98     * @since  0.1
    9999     * @access public
    100100     * @static
     
    114114     * Register required files and filters.
    115115     *
    116      * @since  1.0
     116     * @since  0.1
    117117     * @access public
    118118     */
     
    138138     * Callback from gform_export_menu filer, defined within init()
    139139     *
    140      * @since  1.0
     140     * @since  0.1
    141141     * @see    $this->init()
    142142     * @access public
     
    162162     * Fired from action call in init()
    163163     *
    164      * @since  1.0
     164     * @since  0.1
    165165     * @see    $this->init()
    166166     * @access public
     
    231231     * Then, begins the migration.
    232232     *
    233      * @since  1.0
     233     * @since  0.1
    234234     * @access public
    235235     */
     
    267267     * Migrates forms and submissions from Ninja Forms to Gravity Forms.
    268268     *
    269      * @since  1.0
     269     * @since  0.1
    270270     * @access public
    271271     * @param  array $form_ids The Ninja Forms form IDs being migrated.
     
    321321     * Converts a Ninja Form to a Gravity Form.
    322322     *
    323      * @since  1.0
     323     * @since  0.1
    324324     * @access public
    325325     * @param  array $ninja_form The Ninja Forms form being converted.
     
    391391     * Convert a Ninja Forms notification to a Gravity Forms notification/confirmation.
    392392     *
    393      * @since  1.0
     393     * @since  0.1
    394394     * @access public
    395395     * @param  array $form            The new Gravity Forms form object.
     
    406406            $confirmation = array(
    407407                'id'       => uniqid(),
    408                 'isActive' => boolval( $nf_notification['active'] ),
     408                'isActive' => '1' === $nf_notification['active'] ? true : false,
    409409                'name'     => $nf_notification['name'],
    410410                'type'     => 'redirect',
     
    423423            $confirmation = array(
    424424                'id'       => uniqid(),
    425                 'isActive' => boolval( $nf_notification['active'] ),
     425                'isActive' => '1' === $nf_notification['active'] ? true : false,
    426426                'name'     => $nf_notification['name'],
    427427                'type'     => 'message',
     
    440440            $notification = array(
    441441                'id'       => uniqid(),
    442                 'isActive' => boolval( $nf_notification['active'] ),
     442                'isActive' => '1' === $nf_notification['active'] ? true : false,
    443443                'name'     => $nf_notification['name'],
    444444                'message'  => $this->convert_to_merge_tags( $form, $nf_notification['email_message'] ),
     
    464464     * Convert Ninja Forms submissions to Gravity Forms entries.
    465465     *
    466      * @since  1.0
     466     * @since  0.1
    467467     * @access public
    468468     * @param  array $ninja_form The Ninja Forms form being converted.
     
    536536     * Converts any Ninja Forms shortcodes in a string to Gravity Forms merge tags.
    537537     *
    538      * @since  1.0
     538     * @since  0.1
    539539     * @access public
    540540     * @param  array  $form The Gravity Forms form object.
     
    584584     * Backticks in lists are bad, and you should feel bad.
    585585     *
    586      * @since  1.0
     586     * @since  0.1
    587587     * @access public
    588588     * @param  array  $form The Gravity Forms form object.
  • migrate-ninja-forms-to-gravity-forms/trunk/migrate-nf.php

    r1361045 r1396079  
    55Plugin URI: http://travislop.es/plugins/migrate-ninja-forms-to-gravity-forms/
    66Description: Imports content from Ninja Forms into Gravity Forms
    7 Version: 0.1
     7Version: 0.1.1
    88Author: travislopes
    99Author URI: http://travislop.es
     
    1111*/
    1212
    13 define( 'GF_MIGRATE_NINJAFORMS_VERSION', '0.1' );
     13define( 'GF_MIGRATE_NINJAFORMS_VERSION', '0.1.1' );
    1414
    1515add_action( 'gform_loaded', array( 'GF_Migrate_NinjaForms_Bootstrap', 'load' ), 5 );
  • migrate-ninja-forms-to-gravity-forms/trunk/readme.txt

    r1361187 r1396079  
    6161
    6262== Changelog ==
     63= v0.1.1 =
     64* Updated notification conversion to not use boolval().
    6365= v0.1 =
    6466* Initial release
Note: See TracChangeset for help on using the changeset viewer.