/**
  * Load the plugin.
  *
  * @since 2.0.0
  */
 public function load_plugin()
 {
     if (!method_exists('GFForms', 'include_addon_framework')) {
         return;
     }
     add_action('init', array($this, 'register_rewrite_rules'));
     add_filter('query_vars', array($this, 'query_vars'));
     add_action('template_redirect', array($this, 'template_redirect'));
     add_action('wp_footer', array($this, 'wp_footer'));
     // Load the Gravity Forms add-on framework and iframe add-on.
     GFForms::include_addon_framework();
     $this->addon = new GravityFormsIframe_Addon($this);
 }
Exemple #2
0
 * - API wrappers
 */
if (!defined('GFWEBAPI_REQUIRE_SIGNATURE')) {
    define('GFWEBAPI_REQUIRE_SIGNATURE', true);
}
if (!defined('GFWEBAPI_SLUG')) {
    define('GFWEBAPI_SLUG', "gravityformsapi");
}
if (!defined('GFWEBAPI_ROUTE_VAR')) {
    define('GFWEBAPI_ROUTE_VAR', 'gfapi_route');
}
if (!defined('GFWEBAPI_API_BASE_URL')) {
    define('GFWEBAPI_API_BASE_URL', site_url(GFWEBAPI_SLUG));
}
if (class_exists("GFForms")) {
    GFForms::include_addon_framework();
    class GFWebAPI extends GFAddOn
    {
        protected $_version = "1.0";
        protected $_min_gravityforms_version = "1.7.9999";
        protected $_slug = "gravityformswebapi";
        protected $_path = "gravityformswebapi/webapi.php";
        protected $_full_path = __FILE__;
        protected $_url = "http://www.gravityforms.com";
        protected $_title = "Gravity Forms API";
        protected $_short_title = "API";
        private $_enabled;
        private $_private_key;
        private $_public_key;
        // Members plugin integration
        protected $_capabilities = array("gravityforms_api", "gravityforms_api_settings");
 /**
  * Load the plugin.
  *
  * Attaches hooks for intercepting requests for iframed forms and loads the
  * Gravity Forms add-on framework and iframe add-on.
  *
  * @since 1.0.0
  */
 public function load()
 {
     if (!method_exists('GFForms', 'include_addon_framework')) {
         return;
     }
     self::load_textdomain();
     add_action('init', array($this, 'init'));
     add_filter('query_vars', array($this, 'query_vars'));
     add_action('wp_loaded', array($this, 'maybe_flush_rewrite_rules'));
     add_action('template_redirect', array($this, 'template_redirect'));
     add_action('wp_footer', array($this, 'wp_footer'));
     // Load the Gravity Forms add-on framework and iframe add-on.
     GFForms::include_addon_framework();
     require dirname(__FILE__) . '/includes/class-gfiframe-addon.php';
     $this->addon = new GFIframe_Addon();
 }
function cfp_opinionshare_gform_field()
{
    $options = get_option('cfp_opinionshare_options');
    if ($options['cfp_opinionshare_gformchk_0'] == 1) {
        if (class_exists("GFForms")) {
            GFForms::include_addon_framework();
            $forms = GFAPI::get_forms();
            $i = 0;
            $f = 0;
            if (count($forms) != 0) {
                echo '<select name="cfp_opinionshare_options[cfp_opinionshare_gform_0]">';
                foreach ($forms as $form) {
                    // echo '<pre>';
                    // print_r($form);
                    // echo '</pre>';
                    // echo $form[title].' - '.$form[id].'<br/>';
                    echo '<option value="' . $form[id] . '" ' . selected($options['cfp_opinionshare_gform_0'], $form[id], false) . '>' . $form[title] . '</option>';
                }
                echo '</select>';
            } else {
                echo 'No Forms Found';
            }
        } else {
            echo '<p><span class="dashicons dashicons-warning"></span> <strong class="red">Please install Gravity Forms</strong></p><p>Opinion Share uses Gravity Forms to provide feedback as to why your customer was unhappy with their service. Please install <a href="http://www.gravityforms.com/">Gravity Forms</a>.';
        }
    } else {
        $authorbox = isset($options['authorbox_template']) ? $options['authorbox_template'] : '';
        $authorbox = esc_textarea($authorbox);
        //sanitise output
        $settings = array('textarea_name' => 'cfp_opinionshare_options[authorbox_template]');
        wp_editor($authorbox, 'right_editor', $settings);
    }
}