当前位置: 首页>>代码示例>>PHP>>正文


PHP RGForms类代码示例

本文整理汇总了PHP中RGForms的典型用法代码示例。如果您正苦于以下问题:PHP RGForms类的具体用法?PHP RGForms怎么用?PHP RGForms使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了RGForms类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public static function init()
 {
     if (basename($_SERVER['PHP_SELF']) == "plugins.php") {
         //loading translations
         load_plugin_textdomain('gravityformsmailchimp', FALSE, '/gravityformsmailchimp/languages');
         add_action('after_plugin_row_' . self::$path, array('GFMailChimp', 'plugin_row'));
         //force new remote request for version info on the plugin page
         self::flush_version_info();
     }
     if (!self::is_gravityforms_supported()) {
         return;
     }
     if (is_admin()) {
         //loading translations
         load_plugin_textdomain('gravityformsmailchimp', FALSE, '/gravityformsmailchimp/languages');
         add_filter("transient_update_plugins", array('GFMailChimp', 'check_update'));
         add_filter("site_transient_update_plugins", array('GFMailChimp', 'check_update'));
         add_action('install_plugins_pre_plugin-information', array('GFMailChimp', 'display_changelog'));
         // paypal plugin integration hooks
         add_action("gform_paypal_action_fields", array("GFMailChimp", "add_paypal_settings"), 10, 2);
         add_filter("gform_paypal_save_config", array("GFMailChimp", "save_paypal_settings"));
         //creates a new Settings page on Gravity Forms' settings screen
         if (self::has_access("gravityforms_mailchimp")) {
             RGForms::add_settings_page("MailChimp", array("GFMailChimp", "settings_page"), self::get_base_url() . "/images/mailchip_wordpress_icon_32.png");
         }
     }
     //integrating with Members plugin
     if (function_exists('members_get_capabilities')) {
         add_filter('members_get_capabilities', array("GFMailChimp", "members_get_capabilities"));
     }
     //creates the subnav left menu
     add_filter("gform_addon_navigation", array('GFMailChimp', 'create_menu'));
     if (self::is_mailchimp_page()) {
         //enqueueing sack for AJAX requests
         wp_enqueue_script(array("sack"));
         //loading data lib
         require_once self::get_base_path() . "/data.php";
         //loading upgrade lib
         if (!class_exists("RGMailChimpUpgrade")) {
             require_once "plugin-upgrade.php";
         }
         //loading Gravity Forms tooltips
         require_once GFCommon::get_base_path() . "/tooltips.php";
         add_filter('gform_tooltips', array('GFMailChimp', 'tooltips'));
         //runs the setup when version changes
         self::setup();
     } else {
         if (in_array(RG_CURRENT_PAGE, array("admin-ajax.php"))) {
             //loading data class
             require_once self::get_base_path() . "/data.php";
             add_action('wp_ajax_rg_update_feed_active', array('GFMailChimp', 'update_feed_active'));
             add_action('wp_ajax_gf_select_mailchimp_form', array('GFMailChimp', 'select_mailchimp_form'));
         } else {
             //handling post submission.
             add_action("gform_after_submission", array('GFMailChimp', 'export'), 10, 2);
             //handling paypal fulfillment
             add_action("gform_paypal_fulfillment", array("GFMailChimp", "paypal_fulfillment"), 10, 4);
         }
     }
 }
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:60,代码来源:mailchimp.php

示例2: init

 public static function init()
 {
     global $pagenow;
     load_plugin_textdomain('gravity-forms-marketo', FALSE, '/gravity-forms-marketo/languages');
     if ($pagenow === 'plugins.php') {
         add_action("admin_notices", array('GFMarketo', 'is_gravity_forms_installed'), 10);
     }
     if (self::is_gravity_forms_installed(false, false) === 0) {
         add_action('after_plugin_row_' . self::$path, array('GFMarketo', 'plugin_row'));
         return;
     }
     add_filter('plugin_action_links', array('GFMarketo', 'settings_link'), 10, 2);
     if (!self::is_gravityforms_supported()) {
         return;
     }
     if (is_admin()) {
         //loading translations
         load_plugin_textdomain('gravity-forms-marketo', FALSE, '/gravity-forms-marketo/languages');
         //creates a new Settings page on Gravity Forms' settings screen
         if (self::has_access("gravityforms_marketo")) {
             RGForms::add_settings_page("Marketo", array("GFMarketo", "settings_page"), self::get_base_url() . "/images/marketo_wordpress_icon_32.png");
         }
     }
     //integrating with Members plugin
     if (function_exists('members_get_capabilities')) {
         add_filter('members_get_capabilities', array("GFMarketo", "members_get_capabilities"));
     }
     //creates the subnav left menu
     add_filter("gform_addon_navigation", array('GFMarketo', 'create_menu'));
     if (self::is_marketo_page()) {
         //enqueueing sack for AJAX requests
         wp_enqueue_script(array("sack"));
         wp_enqueue_script("gforms_gravityforms", GFCommon::get_base_url() . "/js/gravityforms.js", null, GFCommon::$version);
         wp_enqueue_style("gforms_css", GFCommon::get_base_url() . "/css/forms.css", null, GFCommon::$version);
         //loading data lib
         require_once self::get_base_path() . "/data.php";
         self::setup_tooltips();
         //runs the setup when version changes
         self::setup();
     } else {
         if (in_array(RG_CURRENT_PAGE, array("admin-ajax.php"))) {
             //loading data class
             require_once self::get_base_path() . "/data.php";
             add_action('wp_ajax_rg_update_feed_active', array('GFMarketo', 'update_feed_active'));
             add_action('wp_ajax_gf_select_marketo_form', array('GFMarketo', 'select_marketo_form'));
         } else {
             //handling post submission.
             add_action('gform_after_submission', array('GFMarketo', 'export'), 10, 2);
         }
     }
     add_action('gform_entry_info', array('GFMarketo', 'entry_info_link_to_marketo'), 1, 2);
     add_filter('gform_save_field_value', array('GFMarketo', 'save_field_value'), 10, 4);
     add_filter('gform_entry_post_save', array('GFMarketo', 'gform_entry_post_save'), 1, 2);
     add_filter('gform_replace_merge_tags', array('GFMarketo', 'replace_merge_tag'), 1, 7);
     add_action("gform_custom_merge_tags", array('GFMarketo', "_deprecated_add_merge_tags"), 1, 4);
     add_action("gform_admin_pre_render", array('GFMarketo', "add_merge_tags"));
     add_filter('gform_pre_render', array('GFMarketo', 'merge_tag_gform_pre_render_filter'), 1, 4);
     add_action('gform_enqueue_scripts', array('GFMarketo', 'add_munchkin_js'), 10, 2);
     add_action('wp_footer', array('GFMarketo', 'add_munchkin_js'));
 }
开发者ID:emilysnothere,项目名称:Gravity-Forms-Marketo-Add-on,代码行数:60,代码来源:marketo.php

示例3: admin_init

 public function admin_init()
 {
     if ('gf_edit_forms' == RGForms::get('page') && 1 == count($_GET)) {
         $this->show_page_on_form_list();
         add_filter('gform_noconflict_scripts', array($this, 'gform_noconflict_scripts'));
     }
 }
开发者ID:jbeyta,项目名称:joelandsam,代码行数:7,代码来源:show-page-on-form-list.php

示例4: init

 public static function init()
 {
     add_action("admin_notices", array('GFSalesforce', 'is_gravity_forms_installed'), 10);
     if (!self::is_gravityforms_supported()) {
         return;
     }
     if (is_admin()) {
         //creates a new Settings page on Gravity Forms' settings screen
         if (self::has_access("gravityforms_salesforce")) {
             RGForms::add_settings_page("Salesforce", array("GFSalesforce", "settings_page"), self::get_base_url() . "/salesforce-50x50.png");
         }
     }
     //creates the subnav left menu
     add_filter("gform_addon_navigation", array('GFSalesforce', 'create_menu'));
     if (self::is_salesforce_page()) {
         //enqueueing sack for AJAX requests
         wp_enqueue_script(array("sack"));
         wp_enqueue_style('gravityforms-admin', GFCommon::get_base_url() . '/css/admin.css');
     } else {
         if (in_array(RG_CURRENT_PAGE, array("admin-ajax.php"))) {
             add_action('wp_ajax_rg_update_feed_active', array('GFSalesforce', 'update_feed_active'));
             add_action('wp_ajax_gf_select_salesforce_form', array('GFSalesforce', 'select_salesforce_form'));
         } elseif (in_array(RG_CURRENT_PAGE, array('admin.php'))) {
             add_action('admin_head', array('GFSalesforce', 'show_salesforce_status'));
         } else {
             add_action("gform_pre_submission", array('GFSalesforce', 'push'), 10, 2);
             //handling post submission.
         }
     }
     #add_action("gform_field_advanced_settings", array('GFSalesforce',"add_salesforce_editor_field"), 10, 2); // For future use
     add_action("gform_editor_js", array('GFSalesforce', 'add_form_option_js'), 10);
     add_filter('gform_tooltips', array('GFSalesforce', 'add_form_option_tooltip'));
     add_filter("gform_confirmation", array('GFSalesforce', 'confirmation_error'));
 }
开发者ID:rongandat,项目名称:cyarevfoods,代码行数:34,代码来源:salesforce.php

示例5: init

 public static function init()
 {
     self::include_logger();
     if (defined('RG_CURRENT_PAGE') && RG_CURRENT_PAGE == "plugins.php") {
         //loading translations
         load_plugin_textdomain('gravityformslogging', FALSE, '/gravityformslogging/languages');
         add_action('after_plugin_row_' . self::$path, array('GFLogging', 'plugin_row'));
         //force new remote request for version info on the plugin page
         self::flush_version_info();
     }
     if (!self::is_gravityforms_supported()) {
         return;
     }
     if (is_admin()) {
         //loading translations
         load_plugin_textdomain('gravityformslogging', FALSE, '/gravityformslogging/languages');
         add_filter("transient_update_plugins", array('GFLogging', 'check_update'));
         add_filter("site_transient_update_plugins", array('GFLogging', 'check_update'));
         add_action('install_plugins_pre_plugin-information', array('GFLogging', 'display_changelog'));
         //creates a new Settings page on Gravity Forms' settings screen
         if (self::has_access("gravityforms_logging")) {
             RGForms::add_settings_page("Logging", array("GFLogging", "settings_page"), "");
         }
     }
     //integrating with Members plugin
     if (function_exists('members_get_capabilities')) {
         add_filter('members_get_capabilities', array("GFLogging", "members_get_capabilities"));
     }
     if (self::is_logging_page()) {
         //loading upgrade lib
         require_once "plugin-upgrade.php";
     }
 }
开发者ID:beyond-z,项目名称:braven,代码行数:33,代码来源:logging.php

示例6: settings_page

    public static function settings_page()
    {
        $addon_name = RGForms::get("addon");
        $icon_path = empty($addon_name) ? "" : self::$addon_pages[$addon_name]["icon"];
        $page_title = empty($addon_name) ? __("Gravity Forms Settings", "gravityforms") : $addon_name . " " . __("Settings", "gravityforms");
        $icon_path = empty($icon_path) ? GFCommon::get_base_url() . "/images/gravity-settings-icon-32.png" : $icon_path;
        echo GFCommon::get_remote_message();
        ?>
        <link rel="stylesheet" href="<?php 
        echo GFCommon::get_base_url();
        ?>
/css/admin.css" />
        <div class="wrap">
            <img alt="<?php 
        $page_title;
        ?>
" src="<?php 
        echo $icon_path;
        ?>
" style="float:left; margin:15px 7px 0 0;"/>
            <h2><?php 
        echo $page_title;
        ?>
</h2>

        <?php 
        if (!empty(self::$addon_pages)) {
            ?>
            <ul class="subsubsub">
                <li><a href="?page=gf_settings">Gravity Forms</a> |</li>
            <?php 
            $count = sizeof(self::$addon_pages);
            for ($i = 0; $i < $count; $i++) {
                $addon_keys = array_keys(self::$addon_pages);
                $addon = $addon_keys[$i];
                ?>
                <li><a href="?page=gf_settings&addon=<?php 
                echo urlencode($addon);
                ?>
"><?php 
                echo esc_html($addon);
                ?>
</a> <?php 
                echo $i < $count - 1 ? "|" : "";
                ?>
</li>
                <?php 
            }
            ?>
            </ul>
            <br style="clear:both;"/>
            <?php 
        }
        if (empty($addon_name)) {
            self::gravityforms_settings_page();
        } else {
            do_action("gform_settings_" . str_replace(" ", "_", $addon_name));
        }
    }
开发者ID:hypenotic,项目名称:slowfood,代码行数:59,代码来源:settings.php

示例7: plugin_settings_init

 protected function plugin_settings_init()
 {
     $subview = rgget("subview");
     RGForms::add_settings_page(array('name' => __("Gravity Forms API Settings", "gravityforms"), 'tab_label' => $this->get_short_title(), 'handler' => array($this, 'plugin_settings_page')));
     if (rgget("page") == "gf_settings" && $subview == $this->get_short_title() && $this->current_user_can_any($this->_capabilities_settings_page)) {
         require_once GFCommon::get_base_path() . "/tooltips.php";
     }
 }
开发者ID:tlandn,项目名称:akvo-web,代码行数:8,代码来源:webapi.php

示例8: admin_init

 public function admin_init()
 {
     if ('gf_edit_forms' == RGForms::get('page') && '' == rgget('view') && is_numeric(rgget('id'))) {
         add_filter('gform_toolbar_menu', array($this, 'gform_toolbar_menu'), 10, 2);
         add_action('gform_editor_js', array($this, 'gform_editor_js'));
         add_filter('gform_noconflict_scripts', array($this, 'gform_noconflict_scripts'));
     }
 }
开发者ID:jbeyta,项目名称:joelandsam,代码行数:8,代码来源:toggle-all-fields-required.php

示例9: add_field_option

 public function add_field_option()
 {
     if (is_admin() && 'gf_edit_forms' == RGForms::get('page')) {
         add_action('gform_field_advanced_settings', array($this, 'gform_field_advanced_settings'), 10, 2);
         add_filter('gform_tooltips', array($this, 'gform_tooltips'));
         add_action('gform_editor_js', array($this, 'gform_editor_js'));
         add_filter('gform_noconflict_scripts', array($this, 'gform_noconflict_scripts'));
     }
 }
开发者ID:jbeyta,项目名称:joelandsam,代码行数:9,代码来源:redact.php

示例10: get_form_parent_post_id

 function get_form_parent_post_id($form)
 {
     foreach ($form['fields'] as $field) {
         if ($field['type'] == 'select' && $field['setParentPost']) {
             $parent_id = RGForms::post('input_' . $field['id']);
             return $parent_id;
         }
     }
     return 0;
 }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:10,代码来源:gfcptaddon_1-5.php

示例11: settings_page

 public static function settings_page()
 {
     if (class_exists('RGForms') && RGForms::get("page") == "gf_settings") {
         /* 
          * Tell Gravity Forms to initiate our settings page
          * Using the following Class/Model
          */
         RGForms::add_settings_page('PDF', array(self::$model, 'gfpdf_settings_page'));
     }
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:10,代码来源:pdf-settings.php

示例12: scripts_styles

 /**
  * 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()));
 }
开发者ID:bself,项目名称:nuimage-wp,代码行数:17,代码来源:admin.php

示例13: adminInit

 /**
  * handle admin init action
  */
 public function adminInit()
 {
     if (isset($_GET['page'])) {
         switch ($_GET['page']) {
             case 'gf_settings':
                 // add our settings page to the Gravity Forms settings menu
                 RGForms::add_settings_page('eWAY Payments', array($this, 'settingsPage'));
                 break;
         }
     }
     add_settings_section(GFEWAY_PLUGIN_OPTIONS, false, false, GFEWAY_PLUGIN_OPTIONS);
     register_setting(GFEWAY_PLUGIN_OPTIONS, GFEWAY_PLUGIN_OPTIONS, array($this, 'settingsValidate'));
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:16,代码来源:class.GFEwayAdmin.php

示例14: init

 public static function init()
 {
     global $pagenow;
     if ($pagenow == 'plugins.php' || defined('RG_CURRENT_PAGE') && RG_CURRENT_PAGE == "plugins.php") {
         //loading translations
         load_plugin_textdomain('gravity-forms-exacttarget', FALSE, '/gravity-forms-exacttarget/languages');
         add_action('after_plugin_row_' . self::$path, array('GFExactTarget', 'plugin_row'));
         add_filter('plugin_action_links', array('GFExactTarget', 'settings_link'), 10, 2);
     }
     if (!self::is_gravityforms_supported()) {
         return;
     }
     if (is_admin()) {
         //loading translations
         load_plugin_textdomain('gravity-forms-exacttarget', FALSE, '/gravity-forms-exacttarget/languages');
         add_filter("transient_update_plugins", array('GFExactTarget', 'check_update'));
         #add_filter("site_transient_update_plugins", array('GFExactTarget', 'check_update'));
         //creates a new Settings page on Gravity Forms' settings screen
         if (self::has_access("gravityforms_exacttarget")) {
             RGForms::add_settings_page("ExactTarget", array("GFExactTarget", "settings_page"), self::get_base_url() . "/images/exacttarget_wordpress_icon_32.png");
         }
     }
     //integrating with Members plugin
     if (function_exists('members_get_capabilities')) {
         add_filter('members_get_capabilities', array("GFExactTarget", "members_get_capabilities"));
     }
     //creates the subnav left menu
     add_filter("gform_addon_navigation", array('GFExactTarget', 'create_menu'));
     if (self::is_exacttarget_page()) {
         //enqueueing sack for AJAX requests
         wp_enqueue_script(array("sack"));
         //loading data lib
         require_once self::get_base_path() . "/data.php";
         //loading Gravity Forms tooltips
         require_once GFCommon::get_base_path() . "/tooltips.php";
         add_filter('gform_tooltips', array('GFExactTarget', 'tooltips'));
         //runs the setup when version changes
         self::setup();
     } else {
         if (in_array(RG_CURRENT_PAGE, array("admin-ajax.php"))) {
             //loading data class
             require_once self::get_base_path() . "/data.php";
             add_action('wp_ajax_rg_update_feed_active', array('GFExactTarget', 'update_feed_active'));
             add_action('wp_ajax_gf_select_exacttarget_form', array('GFExactTarget', 'select_exacttarget_form'));
         } else {
             //handling post submission.
             add_action("gform_post_submission", array('GFExactTarget', 'export'), 10, 2);
         }
     }
 }
开发者ID:thirdwunder,项目名称:Gravity-Forms-ExactTarget,代码行数:50,代码来源:exacttarget.php

示例15: ddw_gftb_add_gfsettings

/**
 * Hook in our plugin's settings page also on the Gravity Forms settings page as
 *    a sub page.
 *
 * @since 1.6.0
 *
 * @uses  is_admin()
 * @uses  RGForms::add_settings_page()
 */
function ddw_gftb_add_gfsettings()
{
    if (is_admin() && class_exists('RGForms')) {
        global $pagenow;
        $gftb_gf_settings_string = array('name' => 'Toolbar', 'tab_label' => _x('Toolbar', 'Translators: Settings (sub) title within Gravity Forms settings page', 'gravity-forms-toolbar'), 'handler' => 'ddw_gftb_options_page', 'icon_path' => '');
        RGForms::add_settings_page($gftb_gf_settings_string, 'ddw_gftb_options_page', '');
        /** Add & display message on saving options */
        if (isset($_GET['subview']) && 'Toolbar' == $_GET['subview'] && isset($_GET['settings-updated'])) {
            add_action('admin_notices', 'ddw_gftb_settings_message');
        }
        // end if
    }
    // end if
}
开发者ID:EasyDayCleaning,项目名称:Easy-Day-Team2,代码行数:23,代码来源:gftb-admin-settings.php


注:本文中的RGForms类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。