Ejemplo n.º 1
0
 /**
  * load JS for fields.
  *
  * @param  string $hook  The admin page we are on.
  *
  * @return void
  */
 public function scripts_styles($hook)
 {
     // Bail if not on the GF page.
     if (!RGForms::is_gravity_page()) {
         return;
     }
     // Enqueue our items.
     wp_enqueue_script('gftips-admin', plugins_url('/js/gftips.admin.js', __FILE__), array('jquery'), GFT_VER, true);
     wp_localize_script('gftips-admin', 'gftipsAdmin', array('fldTypes' => self::show_field_item_types()));
 }
Ejemplo n.º 2
0
require_once plugin_dir_path(__FILE__) . 'forms_model.php';
require_once plugin_dir_path(__FILE__) . 'widget.php';
require_once plugin_dir_path(__FILE__) . 'includes/api.php';
require_once plugin_dir_path(__FILE__) . 'includes/webapi/webapi.php';
require_once plugin_dir_path(__FILE__) . 'includes/fields/class-gf-fields.php';
// GFCommon::$version is deprecated, set it to current version for backwards compatibility
GFCommon::$version = GFForms::$version;
add_action('init', array('RGForms', 'init'));
add_action('wp', array('RGForms', 'maybe_process_form'), 9);
add_action('admin_init', array('RGForms', 'maybe_process_form'), 9);
add_action('wp', array('RGForms', 'process_exterior_pages'));
add_filter('upgrader_pre_install', array('GFForms', 'validate_upgrade'), 10, 2);
add_filter('tiny_mce_before_init', array('GFForms', 'modify_tiny_mce_4'), 20);
add_filter('user_has_cap', array('RGForms', 'user_has_cap'), 10, 3);
//Hooks for no-conflict functionality
if (is_admin() && (RGForms::is_gravity_page() || RGForms::is_gravity_ajax_action())) {
    add_action('wp_print_scripts', array('RGForms', 'no_conflict_mode_script'), 1000);
    add_action('admin_print_footer_scripts', array('RGForms', 'no_conflict_mode_script'), 9);
    add_action('wp_print_styles', array('RGForms', 'no_conflict_mode_style'), 1000);
    add_action('admin_print_styles', array('RGForms', 'no_conflict_mode_style'), 1);
    add_action('admin_print_footer_scripts', array('RGForms', 'no_conflict_mode_style'), 1);
    add_action('admin_footer', array('RGForms', 'no_conflict_mode_style'), 1);
}
add_action('plugins_loaded', array('GFForms', 'loaded'));
register_deactivation_hook(__FILE__, array('GFForms', 'deactivation_hook'));
class GFForms
{
    public static $version = '1.9.13.26';
    public static function loaded()
    {
        /**
Ejemplo n.º 3
0
    define("IS_ADMIN", is_admin());
}
define("RG_CURRENT_VIEW", RGForms::get("view"));
define("GF_SUPPORTED_WP_VERSION", version_compare(get_bloginfo("version"), '3.0', '>='));
if (!defined("GRAVITY_MANAGER_URL")) {
    define("GRAVITY_MANAGER_URL", " ");
}
require_once WP_PLUGIN_DIR . "/" . basename(dirname(__FILE__)) . "/common.php";
require_once WP_PLUGIN_DIR . "/" . basename(dirname(__FILE__)) . "/forms_model.php";
require_once WP_PLUGIN_DIR . "/" . basename(dirname(__FILE__)) . "/widget.php";
add_action('init', array('RGForms', 'init'));
add_action('wp', array('RGForms', 'maybe_process_form'), 9);
add_action('wp', array('RGForms', 'process_exterior_pages'));
add_filter('user_has_cap', array("RGForms", "user_has_cap"), 10, 3);
//Hooks for no-conflict functionality
if (is_admin() && (RGForms::is_gravity_page() || RG_CURRENT_PAGE == "admin-ajax.php")) {
    add_action("wp_print_scripts", array("RGForms", "no_conflict_mode_script"), 1000);
    add_action("admin_print_footer_scripts", array("RGForms", "no_conflict_mode_script"), 9);
    add_action("wp_print_styles", array("RGForms", "no_conflict_mode_style"), 1000);
    add_action("admin_print_styles", array("RGForms", "no_conflict_mode_style"), 1);
    add_action("admin_print_footer_scripts", array("RGForms", "no_conflict_mode_style"), 1);
    add_action("admin_footer", array("RGForms", "no_conflict_mode_style"), 1);
}
class RGForms
{
    public static function has_members_plugin()
    {
        return function_exists('members_get_capabilities');
    }
    //Plugin starting point. Will load appropriate files
    public static function init()
 public static function is_gravity_page()
 {
     return class_exists('RGForms') ? RGForms::is_gravity_page() : false;
 }
 public function useyourdrive_extra_scripts()
 {
     if (RGForms::is_gravity_page()) {
         add_thickbox();
     }
 }
Ejemplo n.º 6
0
function bb_click_array_enqueue_form_editor_style()
{
    if (RGForms::is_gravity_page()) {
        $url = plugins_url('css/gform_bb_click_array.css', __FILE__);
        wp_enqueue_style('gform_bb_click_array_style', $url);
    }
}