當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GFForms類代碼示例

本文整理匯總了PHP中GFForms的典型用法代碼示例。如果您正苦於以下問題:PHP GFForms類的具體用法?PHP GFForms怎麽用?PHP GFForms使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了GFForms類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: add_hooks

 /**
  * @since 1.7.5
  */
 function add_hooks()
 {
     // If Gravity Forms isn't active or compatibile, stop loading
     if (false === GravityView_Compatibility::is_valid()) {
         return;
     }
     // Migrate Class
     require_once GRAVITYVIEW_DIR . 'includes/class-migrate.php';
     // Don't load tooltips if on Gravity Forms, otherwise it overrides translations
     if (!GFForms::is_gravity_page()) {
         require_once GFCommon::get_base_path() . '/tooltips.php';
     }
     require_once GRAVITYVIEW_DIR . 'includes/admin/metaboxes/class-gravityview-admin-metaboxes.php';
     require_once GRAVITYVIEW_DIR . 'includes/admin/entry-list.php';
     require_once GRAVITYVIEW_DIR . 'includes/class-change-entry-creator.php';
     /** @since 1.6 */
     require_once GRAVITYVIEW_DIR . 'includes/class-gravityview-admin-duplicate-view.php';
     // Filter Admin messages
     add_filter('post_updated_messages', array($this, 'post_updated_messages'));
     add_filter('bulk_post_updated_messages', array($this, 'post_updated_messages'));
     add_filter('plugin_action_links_' . plugin_basename(GRAVITYVIEW_FILE), array($this, 'plugin_action_links'));
     add_action('plugins_loaded', array($this, 'backend_actions'), 100);
     //Hooks for no-conflict functionality
     add_action('wp_print_scripts', array($this, 'no_conflict_scripts'), 1000);
     add_action('admin_print_footer_scripts', array($this, 'no_conflict_scripts'), 9);
     add_action('wp_print_styles', array($this, 'no_conflict_styles'), 1000);
     add_action('admin_print_styles', array($this, 'no_conflict_styles'), 11);
     add_action('admin_print_footer_scripts', array($this, 'no_conflict_styles'), 1);
     add_action('admin_footer', array($this, 'no_conflict_styles'), 1);
 }
開發者ID:psdes,項目名稱:GravityView,代碼行數:33,代碼來源:class-admin.php

示例2: init

 function init()
 {
     if (is_admin()) {
         // add settings page into Gravity Forms > Settings
         GFForms::add_settings_page(__('Force SSL', 'gf-force-ssl'), array($this, 'plugin_settings_page'));
     }
 }
開發者ID:ajay786singh,項目名稱:viriditas-1,代碼行數:7,代碼來源:gravityforms-force-ssl.php

示例3: enqueue_gravity_forms_scripts

 static function enqueue_gravity_forms_scripts()
 {
     GFForms::register_scripts();
     $scripts = array('thickbox', 'gform_gravityforms', 'wp-lists', 'gform_json', 'gform_field_filter', 'plupload-all');
     foreach ($scripts as $script) {
         wp_enqueue_script($script);
     }
 }
開發者ID:hansstam,項目名稱:makerfaire,代碼行數:8,代碼來源:entry_list_makerfaire.php

示例4: setUp

 /**
  * @inheritDoc
  */
 function setUp()
 {
     parent::setUp();
     /* Remove temporary tables which causes problems with GF */
     remove_all_filters('query', 10);
     /* Ensure the database is correctly set up */
     @GFForms::setup_database();
     $this->factory = new GF_UnitTest_Factory($this);
 }
開發者ID:hansstam,項目名稱:makerfaire,代碼行數:12,代碼來源:GV_UnitTestCase.php

示例5: _manually_load_plugin

function _manually_load_plugin()
{
    require dirname(__FILE__) . '/../../gravityforms/gravityforms.php';
    GFForms::setup(true);
    require dirname(__FILE__) . '/../../gravityformssurvey/survey.php';
    require dirname(__FILE__) . '/../../gravityformsquiz/quiz.php';
    require dirname(__FILE__) . '/../../gravityformspolls/polls.php';
    require dirname(__FILE__) . '/../pdf.php';
}
開發者ID:hirenbhut93,項目名稱:gravity-pdf,代碼行數:9,代碼來源:bootstrap.php

示例6: plugins_loaded

 /**
  * Plugins loaded
  */
 public function plugins_loaded()
 {
     // Add-on
     // The `class_exists` call is required to prevent strage errors on some hosting environments
     if (Pronamic_WP_Pay_Class::method_exists('GFForms', 'include_payment_addon_framework')) {
         GFForms::include_payment_addon_framework();
         if (class_exists('GFPaymentAddOn')) {
             $this->addon = new Pronamic_WP_Pay_Extensions_GravityForms_PaymentAddOn();
         }
     }
 }
開發者ID:daanbakker1995,項目名稱:vanteun,代碼行數:14,代碼來源:Extension.php

示例7: load

 /**
  * Load GravityView
  *
  * @since 1.9
  */
 public function load()
 {
     require_once $this->plugin_dir . '/tmp/gravityforms/gravityforms.php';
     $this->load_rest_api();
     require_once $this->plugin_dir . '/gravityview.php';
     /* Remove temporary tables which causes problems with GF */
     remove_all_filters('query', 10);
     // set up Gravity Forms database
     @GFForms::setup(true);
     $this->create_stubs();
 }
開發者ID:hansstam,項目名稱:makerfaire,代碼行數:16,代碼來源:bootstrap.php

示例8: load_plugin

 /**
  * 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);
 }
開發者ID:cedaro,項目名稱:gravity-forms-iframe,代碼行數:18,代碼來源:Plugin.php

示例9: load

 public static function load()
 {
     if (!class_exists('GFForms') || !class_exists('GFAddOn')) {
         return;
     }
     if (!method_exists('GFForms', 'include_feed_addon_framework')) {
         return;
     }
     GFForms::include_feed_addon_framework();
     require_once GFELOQUA_PATH . '/api/class.eloqua.api.php';
     require_once GFELOQUA_PATH . '/includes/helpers.php';
     require_once GFELOQUA_PATH . 'gfeloqua.class.php';
     GFAddOn::register('GFEloqua');
 }
開發者ID:ryanhellyer,項目名稱:gravityforms-eloqua,代碼行數:14,代碼來源:gravityforms-eloqua.plugin.php

示例10: setUp

 public function setUp()
 {
     /*
      * Replace set up with cut down version 
      * so we don't use 'temporary' tables in MySQL
      */
     $this->cut_down_setup();
     /* initialise GF tables */
     GFForms::setup(true);
     /* Load our plugin functions */
     GFPDF_InstallUpdater::check_filesystem_api();
     GFPDF_InstallUpdater::maybe_deploy();
     /* create GF data */
     $this->create_form_and_entries();
     $this->setupConfiguration();
 }
開發者ID:hirenbhut93,項目名稱:gravity-pdf,代碼行數:16,代碼來源:test-pdf-model.php

示例11: include_required_files

 /**
  * @since 1.15
  * @return void
  */
 private function include_required_files()
 {
     // Migrate Class
     require_once GRAVITYVIEW_DIR . 'includes/class-migrate.php';
     // Don't load tooltips if on Gravity Forms, otherwise it overrides translations
     if (class_exists('GFCommon') && class_exists('GFForms') && !GFForms::is_gravity_page()) {
         require_once GFCommon::get_base_path() . '/tooltips.php';
     }
     require_once GRAVITYVIEW_DIR . 'includes/admin/metaboxes/class-gravityview-admin-metaboxes.php';
     require_once GRAVITYVIEW_DIR . 'includes/admin/entry-list.php';
     require_once GRAVITYVIEW_DIR . 'includes/class-change-entry-creator.php';
     /** @since 1.15 **/
     require_once GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-support-port.php';
     /** @since 1.6 */
     require_once GRAVITYVIEW_DIR . 'includes/class-gravityview-admin-duplicate-view.php';
 }
開發者ID:qqz,項目名稱:GravityView,代碼行數:20,代碼來源:class-admin.php

示例12: setUp

 public function setUp()
 {
     /*
      * For some reasons this wasn't automatically set up so
      * we are running it here.
      */
     $this->factory = new WP_UnitTest_Factory();
     /*
      * Replace set up with cut down version
      * so we don't use 'temporary' tables in MySQL
      */
     $this->cut_down_setup();
     /* initialise GF tables */
     GFForms::setup(true);
     /* Load our plugin functions */
     GFPDF_InstallUpdater::check_filesystem_api();
     GFPDF_InstallUpdater::maybe_deploy();
     /* create GF data */
     $this->create_form_and_entries();
 }
開發者ID:hirenbhut93,項目名稱:gravity-pdf,代碼行數:20,代碼來源:test-gravity-forms.php

示例13: init

 public function init()
 {
     if (!GFCommon::current_user_can_any($this->_capabilities)) {
         return;
     }
     // is any GF page
     if (GFForms::is_gravity_page()) {
         // add top toolbar menu item
         add_filter('gform_toolbar_menu', array($this, 'add_toolbar_menu_item'), 10, 2);
         // add custom form action
         add_filter('gform_form_actions', array($this, 'add_form_action'), 10, 2);
     }
     // is results page
     if (rgget('view') == "gf_results_{$this->_slug}") {
         // add the results view
         add_action('gform_entries_view', array($this, 'add_view'), 10, 2);
         add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
         // tooltips
         require_once GFCommon::get_base_path() . '/tooltips.php';
         add_filter('gform_tooltips', array($this, 'add_tooltips'));
     }
 }
開發者ID:arobbins,項目名稱:davis,代碼行數:22,代碼來源:class-gf-results.php

示例14: setUp

 /** Activate the plugin, mock all the things */
 public function setUp()
 {
     parent::setUp();
     /* Activate GravityForms */
     require_once WP_PLUGIN_DIR . '/gravityforms/gravityforms.php';
     require_once WP_PLUGIN_DIR . '/gravityforms/export.php';
     /* Something happened in newer versions, and we can't get the lead cache to initialize
     			properly, we need to do this manually */
     global $_gform_lead_meta;
     if ($_gform_lead_meta === null) {
         $_gform_lead_meta = array();
     }
     GFForms::setup();
     GFCache::flush();
     /* Import some ready-made forms */
     $this->assertEquals(GFExport::import_file(dirname(__FILE__) . '/forms.xml'), 2);
     /* Add a faster turnaround schedule */
     add_filter('cron_schedules', function ($s) {
         $s['minute'] = array('interval' => 60, 'display' => 'Minutely');
         return $s;
     });
     /* Get an instance of our plugin */
     $this->digest = new GFDigestNotifications();
 }
開發者ID:acesmf,項目名稱:Gravity-Forms-Digest-Bulk-Reports,代碼行數:25,代碼來源:main.php

示例15: results_page

        public function results_page($form_id, $page_title, $gf_page, $gf_view)
        {
            $form_id = absint($form_id);
            if (empty($form_id)) {
                $forms = RGFormsModel::get_forms();
                if (!empty($forms)) {
                    $form_id = $forms[0]->id;
                }
            }
            $form = GFFormsModel::get_form_meta($form_id);
            $form = gf_apply_filters(array('gform_form_pre_results', $form_id), $form);
            // set up filter vars
            $start_date = rgget('start');
            $end_date = rgget('end');
            $all_fields = $form['fields'];
            $filter_settings = GFCommon::get_field_filter_settings($form);
            $filter_settings = apply_filters('gform_filters_pre_results', $filter_settings, $form);
            $filter_settings = array_values($filter_settings);
            // reset the numeric keys in case some filters have been unset
            $filter_fields = rgget('f');
            $filter_operators = rgget('o');
            $filter_values = rgget('v');
            $filters = array();
            $init_vars = array();
            if (!empty($filter_fields)) {
                $init_vars['mode'] = rgget('mode');
                foreach ($filter_fields as $i => $filter_field) {
                    $filters[$i]['field'] = $filter_field;
                    $filters[$i]['operator'] = $filter_operators[$i];
                    $filters[$i]['value'] = $filter_values[$i];
                }
                $init_vars['filters'] = $filters;
            }
            $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min';
            $admin_css_url = GFCommon::get_base_url() . "/css/admin{$min}.css?ver=" . GFForms::$version;
            ?>
			<script type="text/javascript">
				var gresultsFields = <?php 
            echo json_encode($all_fields);
            ?>
;
				var gresultsFilterSettings = <?php 
            echo json_encode($filter_settings);
            ?>
;
				var gresultsInitVars = <?php 
            echo json_encode($init_vars);
            ?>
;

				<?php 
            GFCommon::gf_global();
            ?>
				<?php 
            GFCommon::gf_vars();
            ?>
			</script>

			<link rel="stylesheet"
			      href="<?php 
            echo esc_url($admin_css_url);
            ?>
"
			      type="text/css"/>
			<div class="wrap gforms_edit_form <?php 
            echo GFCommon::get_browser_class();
            ?>
">

				<?php 
            GFCommon::form_page_title($form);
            ?>
				<?php 
            GFCommon::display_dismissible_message();
            ?>
				<?php 
            GFForms::top_toolbar();
            ?>
				<?php 
            if (false === empty($all_fields)) {
                ?>

					<div id="poststuff" class="metabox-holder has-right-sidebar">
						<div id="side-info-column" class="inner-sidebar">
							<div id="gresults-results-filter" class="postbox">
								<h3 style="cursor: default;"><?php 
                echo $this->_search_title;
                ?>
</h3>

								<div id="gresults-results-filter-content">
									<form id="gresults-results-filter-form" action="" method="GET">
										<input type="hidden" id="gresults-page-slug" name="page"
										       value="<?php 
                echo esc_attr($gf_page);
                ?>
">
										<input type="hidden" id="gresults-view-slug" name="view"
										       value="<?php 
                echo esc_attr($gf_view);
//.........這裏部分代碼省略.........
開發者ID:Garth619,項目名稱:Femi9,代碼行數:101,代碼來源:class-gf-results.php


注:本文中的GFForms類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。