本文整理汇总了PHP中GFForms类的典型用法代码示例。如果您正苦于以下问题:PHP GFForms类的具体用法?PHP GFForms怎么用?PHP GFForms使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GFForms类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: ensure_tables_exist
public static function ensure_tables_exist()
{
global $wpdb;
$form_table_name = self::get_form_table_name();
$form_count = $wpdb->get_var("SELECT count(0) FROM {$form_table_name}");
if ($wpdb->last_error) {
GFCommon::log_debug('GFFormsModel::ensure_tables_exist(): Blog ' . get_current_blog_id() . ' - Form database table does not exist. Forcing database setup.');
GFForms::setup_database();
}
}
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:10,代码来源:forms_model.php
示例17: get_instance
<?php
GFForms::include_feed_addon_framework();
class GFZohoCRM extends GFFeedAddOn
{
protected $_version = GF_ZOHOCRM_VERSION;
protected $_min_gravityforms_version = '1.9.14.26';
protected $_slug = 'gravityformszohocrm';
protected $_path = 'gravityformszohocrm/zohocrm.php';
protected $_full_path = __FILE__;
protected $_url = 'http://www.gravityforms.com';
protected $_title = 'Gravity Forms Zoho CRM Add-On';
protected $_short_title = 'Zoho CRM';
protected $_enable_rg_autoupgrade = true;
protected $api = null;
protected $fields_transient_name = 'gform_zohocrm_fields';
private static $_instance = null;
/* Permissions */
protected $_capabilities_settings_page = 'gravityforms_zohocrm';
protected $_capabilities_form_settings = 'gravityforms_zohocrm';
protected $_capabilities_uninstall = 'gravityforms_zohocrm_uninstall';
/* Members plugin integration */
protected $_capabilities = array('gravityforms_zohocrm', 'gravityforms_zohocrm_uninstall');
/**
* Get instance of this class.
*
* @access public
* @static
* @return GFZohoCRM
*/
public static function get_instance()
开发者ID:wp-premium,项目名称:gravityformszohocrm,代码行数:31,代码来源:class-gf-zohocrm.php
示例18: is_last_page
/**
* Determine if the last page for the current form object is being submitted or rendered (depending on the provided $mode).
*
* @param array $form A Gravity Forms form object.
* @param string $mode Mode to check for: 'submit' or 'render'
*
* @return boolean
*/
public static function is_last_page($form, $mode = 'submit')
{
$page_number = self::get_source_page($form['id']);
$field_values = GFForms::post('gform_field_values');
$target_page = self::get_target_page($form, $page_number, $field_values);
if ($mode == 'render') {
$is_valid = rgars(self::$submission, "{$form['id']}/is_valid");
$is_last_page = $is_valid && $target_page == self::get_max_page_number($form);
} else {
$is_last_page = (string) $target_page === '0';
}
return $is_last_page;
}
开发者ID:timk85,项目名称:DIT,代码行数:21,代码来源:form_display.php
示例19: setup
/**
* Performs upgrade tasks when the version of the Add-On changes. To add additional upgrade tasks, override the upgrade() function, which will only get executed when the plugin version has changed.
*/
protected function setup()
{
//Upgrading add-on
$installed_version = get_option("gravityformsaddon_" . $this->_slug . "_version");
//Making sure version has really changed. Gets around aggressive caching issue on some sites that cause setup to run multiple times.
if ($installed_version != $this->_version) {
$installed_version = GFForms::get_wp_option("gravityformsaddon_" . $this->_slug . "_version");
}
//Upgrade if version has changed
if ($installed_version != $this->_version) {
$this->upgrade($installed_version);
update_option("gravityformsaddon_" . $this->_slug . "_version", $this->_version);
}
}
开发者ID:BisongT,项目名称:Myevent_website,代码行数:17,代码来源:class-gf-addon.php
示例20: upgrade_payment
private function upgrade_payment($previous_versions)
{
global $wpdb;
$charset_collate = GFFormsModel::get_db_charset();
$sql = "CREATE TABLE {$wpdb->prefix}gf_addon_payment_transaction (\n id int(10) unsigned not null auto_increment,\n lead_id int(10) unsigned not null,\n transaction_type varchar(30) not null,\n transaction_id varchar(50),\n is_recurring tinyint(1) not null default 0,\n amount decimal(19,2),\n date_created datetime,\n PRIMARY KEY (id),\n KEY lead_id (lead_id),\n KEY transaction_type (transaction_type),\n KEY type_lead (lead_id,transaction_type)\n ) {$charset_collate};";
GFFormsModel::dbDelta($sql);
if ($this->_supports_callbacks) {
$sql = "CREATE TABLE {$wpdb->prefix}gf_addon_payment_callback (\n id int(10) unsigned not null auto_increment,\n lead_id int(10) unsigned not null,\n addon_slug varchar(250) not null,\n callback_id varchar(250),\n date_created datetime,\n PRIMARY KEY (id),\n KEY addon_slug_callback_id (addon_slug(50),callback_id(100))\n ) {$charset_collate};";
GFFormsModel::dbDelta($sql);
//droping legacy index
GFForms::drop_index("{$wpdb->prefix}gf_addon_payment_callback", 'slug_callback_id');
}
}
开发者ID:kidaak,项目名称:gravityforms,代码行数:13,代码来源:class-gf-payment-addon.php
注:本文中的GFForms类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论