本文整理汇总了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);
}
示例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'));
}
}
示例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);
}
}
示例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);
}
示例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';
}
示例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();
}
}
}
示例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();
}
示例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);
}
示例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');
}
示例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();
}
示例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';
}
示例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();
}
示例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'));
}
}
示例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();
}
示例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);
//.........这里部分代码省略.........