Plugin Directory

Changeset 1004840


Ignore:
Timestamp:
10/10/2014 02:26:26 AM (11 years ago)
Author:
cognitoapps
Message:

Updated to support new version of Cognito

Location:
cognito-forms/trunk
Files:
7 added
4 edited

Legend:

Unmodified
Added
Removed
  • cognito-forms/trunk/plugin.php

    r915624 r1004840  
    5858        if(!current_user_can('edit_posts') && !current_user_can('edit_pages')) return;     
    5959       
     60        register_setting('cognito_plugin', 'cognito_api_key');
     61        register_setting('cognito_plugin', 'cognito_admin_key');
     62        register_setting('cognito_plugin', 'cognito_public_key');
     63        register_setting('cognito_plugin', 'cognito_organization');
     64       
    6065        // If the flag to delete options was passed-in, delete them
    6166        if (isset($_GET['cog_clear']) && $_GET['cog_clear'] == '1') {
     
    6368            delete_option('cognito_admin_key');
    6469            delete_option('cognito_public_key');
     70            delete_option('cognito_organization');
    6571        }
    6672       
     
    8793            delete_option('cognito_admin_key');
    8894            delete_option('cognito_public_key');
     95            delete_option('cognito_organization');
    8996       
    9097            update_option('cognito_api_key', $organization->apiKey);
    9198            update_option('cognito_admin_key', $organization->adminKey);
    9299            update_option('cognito_public_key', $organization->publicKey);
     100            update_option('cognito_organization', $organization->code);
    93101        }
    94102       
     
    111119    // Initialize administration menu (left-bar)
    112120    public function admin_menu() {
    113         add_menu_page('Cognito Forms', 'Cognito Forms', 'manage_options', 'Cognito', array($this, 'main_page'), '../wp-content/plugins/cognito/gear.ico');
     121        add_menu_page('Cognito Forms', 'Cognito Forms', 'manage_options', 'Cognito', array($this, 'main_page'), '../wp-content/plugins/cognito-forms/cogicon.ico');
    114122        add_submenu_page('Cognito', 'Cognito Forms', 'View Forms', 'manage_options', 'Cognito', array($this, 'main_page'));
    115123        add_submenu_page('Cognito', 'Create Form', 'New Form', 'manage_options', 'CognitoCreateForm', array($this, 'main_page'));
    116124        add_submenu_page('Cognito', 'Templates', 'Templates', 'manage_options', 'CognitoTemplates', array($this, 'main_page'));
     125       
     126        add_options_page('Cognito Options', 'Cognito Forms', 'manage_options', 'CognitoOptions', array($this, 'options_page'));
    117127    }
    118128
     
    138148    public function main_page() {       
    139149        include 'tmpl/main.php';
     150    }
     151   
     152    public function options_page() {
     153        include 'tmpl/options.php';
    140154    }
    141155   
  • cognito-forms/trunk/readme.txt

    r915624 r1004840  
    55Requires at least: 3.5
    66Tested up to: 3.9.1
    7 Stable tag: 1.0
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5858
    5959
     60== Instructions ==
     611. After activating the plugin, a Cognito Forms section will appear on the admin bar. Click on this, and either create an account or login if you already have one.
     622. Once you have logged into Cognito Forms, create a new form. All forms that you create will be available to be inserted into the content editor when editing a page or post.
     633. When editing a page or post, click on the Cognito Forms icon, the orange cog, and select your form to be inserted.
     644. Update your page or post and your form should appear.
     65
     66
    6067== Frequently Asked Questions ==
    6168
     
    7178== Screenshots ==
    7279
     80
     81
    73821. Build your form with our easy-to-use, drag-and-drop editor.
    74832. Publish your form and adjust your form's style.
    75843. View your entries.
     854. After installation, Cognito Forms will appear on the admin bar.
     865. After logging into (or registering with) Cognito Forms from your wordpress site, click on the Cognito Forms icon to insert a form into your page or post.
     876. Choose your Cognito Form.
     887. The appropriate short code will be added to your page or post.
    7689
  • cognito-forms/trunk/tinymce/plugin.js

    r915567 r1004840  
    1414                title : 'Cognito Forms',
    1515                cmd : 'cognito_embed_window',
    16                 image : url + '/gear.ico'
     16                image : url + '/cogicon.ico'
    1717            });
    1818        }
  • cognito-forms/trunk/tmpl/main.php

    r915567 r1004840  
    2121$url = CognitoAPI::$formsBase;
    2222if ($_GET['page'] == 'CognitoCreateForm') {
    23     $url = $url . 'build';
     23    $url = $url . 'forms/new';
    2424} elseif ($_GET['page'] == "CognitoTemplates") {
    25     $url = $url . 'templates';
     25    $url = $url . 'forms/templates';
    2626}
    2727?>
     
    3434
    3535<script language="javascript">
     36    var element = document.getElementById('cognito-frame');
     37    for (; element; element = element.previousSibling) {
     38        if (element.nodeType === 1 && element.id !== 'cognito-frame') {
     39            element.style.display = 'none';
     40        }
     41    }
     42
    3643    var adminheight = document.getElementById('wpadminbar').clientHeight;
    3744    document.getElementById('cognito-frame').height = (document.body.clientHeight - adminheight) + "px";
Note: See TracChangeset for help on using the changeset viewer.