本文整理汇总了PHP中GFCommon::display_dismissible_message方法的典型用法代码示例。如果您正苦于以下问题:PHP GFCommon::display_dismissible_message方法的具体用法?PHP GFCommon::display_dismissible_message怎么用?PHP GFCommon::display_dismissible_message使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GFCommon
的用法示例。
在下文中一共展示了GFCommon::display_dismissible_message方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
//.........这里部分代码省略.........
示例2: page_header
public static function page_header($title = '')
{
$min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min';
// register admin styles
wp_register_style('gform_admin', GFCommon::get_base_url() . "/css/admin{$min}.css");
wp_print_styles(array('jquery-ui-styles', 'gform_admin'));
$current_tab = rgempty('view', $_GET) ? 'export_entry' : rgget('view');
$setting_tabs = self::get_tabs();
// kind of boring having to pass the title, optionally get it from the settings tab
if (!$title) {
foreach ($setting_tabs as $tab) {
if ($tab['name'] == $current_tab) {
$title = $tab['name'];
}
}
}
?>
<div class="wrap <?php
echo sanitize_html_class($current_tab);
?>
">
<h2><?php
echo esc_html($title);
?>
</h2>
<?php
GFCommon::display_dismissible_message();
?>
<?php
GFCommon::display_admin_message();
?>
<div id="gform_tab_group" class="gform_tab_group vertical_tabs">
<ul id="gform_tabs" class="gform_tabs">
<?php
foreach ($setting_tabs as $tab) {
$query = array('view' => $tab['name']);
if (isset($tab['query'])) {
$query = array_merge($query, $tab['query']);
}
$url = add_query_arg($query);
?>
<li <?php
echo $current_tab == $tab['name'] ? "class='active'" : '';
?>
>
<a href="<?php
echo esc_url($url);
?>
"><?php
echo esc_html($tab['label']);
?>
</a>
</li>
<?php
}
?>
</ul>
<div id="gform_tab_container" class="gform_tab_container">
<div class="gform_tab_content" id="tab_<?php
echo esc_attr($current_tab);
?>
">
<?php
}
示例3: forms_page
//.........这里部分代码省略.........
echo "<script type=\"text/javascript\">var form = new Form();</script>";
}
?>
<?php
echo GFCommon::get_remote_message();
?>
<div class="wrap gforms_edit_form <?php
echo GFCommon::get_browser_class();
?>
">
<?php
if (empty($form_id)) {
?>
<h1><?php
esc_html_e('New Form', 'gravityforms');
?>
</h1>
<?php
} else {
?>
<?php
GFCommon::form_page_title($form);
?>
<?php
}
?>
<?php
GFCommon::display_dismissible_message();
?>
<?php
RGForms::top_toolbar();
?>
<?php
switch (rgar($update_result, 'status')) {
case 'invalid_json':
?>
<div class="error_base gform_editor_status" id="after_update_error_dialog">
<?php
esc_html_e('There was an error while saving your form.', 'gravityforms');
?>
<?php
printf(__('Please %scontact our support team%s.', 'gravityforms'), '<a href="http://www.gravityhelp.com">', '</a>');
?>
</div>
<?php
break;
case 'duplicate_title':
?>
<div class="error_base gform_editor_status" id="after_update_error_dialog">
<?php
esc_html_e('The form title you have entered is already taken. Please enter a unique form title.', 'gravityforms');
?>
</div>
<?php
break;
default:
if (!empty($update_result)) {
?>
示例4: update_page
public static function update_page()
{
if (!GFCommon::current_user_can_any('gravityforms_view_updates')) {
wp_die(esc_html__("You don't have permissions to view this page", 'gravityforms'));
}
if (!GFCommon::ensure_wp_version()) {
return;
}
GFCommon::cache_remote_message();
echo GFCommon::get_remote_message();
wp_print_styles(array('thickbox'));
$min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min';
?>
<link rel="stylesheet" href="<?php
echo GFCommon::get_base_url() . "/css/admin{$min}.css?ver=" . GFForms::$version;
?>
" />
<div class="wrap <?php
echo GFCommon::get_browser_class();
?>
">
<h2><?php
esc_html_e('Gravity Forms Updates', 'gravityforms');
?>
</h2>
<?php
GFCommon::display_dismissible_message();
?>
<?php
$version_info = GFCommon::get_version_info(false);
/**
* Fires after Gravity Forms checks for a new version
*/
do_action('gform_after_check_update');
if (version_compare(GFCommon::$version, $version_info['version'], '<')) {
$plugin_file = 'gravityforms/gravityforms.php';
$upgrade_url = wp_nonce_url('update.php?action=upgrade-plugin&plugin=' . urlencode($plugin_file), 'upgrade-plugin_' . $plugin_file);
$message = __('There is a new version of Gravity Forms available.', 'gravityforms');
if (rgar($version_info, 'is_valid_key')) {
?>
<div class="gf_update_outdated alert_yellow">
<?php
echo esc_html($message) . ' <p>' . sprintf(esc_html__('You can update to the latest version automatically or download the update and install it manually. %sUpdate Automatically%s %sDownload Update%s', 'gravityforms'), "</p><a class='button-primary' href='{$upgrade_url}'>", '</a>', " <a class='button' href='{$version_info["url"]}'>", '</a>');
?>
</div>
<?php
} else {
?>
<div class="gf_update_expired alert_red">
<?php
echo esc_html($message) . ' ' . sprintf(esc_html('%sRegister%s your copy of Gravity Forms to receive access to automatic updates and support. Need a license key? %sPurchase one now%s.', 'gravityforms'), '<a href="admin.php?page=gf_settings">', '</a>', '<a href="http://www.gravityforms.com">', '</a>');
?>
</div>
<?php
}
echo '<br/><br/>';
$changelog = RGForms::get_changelog();
echo $changelog;
} else {
?>
<div class="gf_update_current alert_green">
<?php
esc_html_e('Your version of Gravity Forms is up to date.', 'gravityforms');
?>
</div>
<?php
}
/**
* Fires after the notifications that signal that Gravity Forms has an update/license key has expired or is needed
*/
do_action('gform_updates');
?>
<div id='gform_upgrade_license' style="display:none;"></div>
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery.post(ajaxurl, {
action : "gf_upgrade_license",
gf_upgrade_license: "<?php
echo wp_create_nonce('gf_upgrade_license');
?>
"},
function (data) {
if (data.trim().length > 0)
jQuery("#gform_upgrade_license").replaceWith(data);
}
);
});
</script>
</div>
<?php
}
示例5: lead_detail_page
//.........这里部分代码省略.........
</strong> of <strong><?php
echo $total_count;
?>
</strong></span>
</li>
<li class="gf_entry_prev gf_entry_pagination"><?php
echo GFEntryDetail::entry_detail_pagination_link($prev_pos, 'Previous Entry', 'gf_entry_prev_link', 'fa fa-arrow-circle-o-left');
?>
</li>
<li class="gf_entry_next gf_entry_pagination"><?php
echo GFEntryDetail::entry_detail_pagination_link($next_pos, 'Next Entry', 'gf_entry_next_link', 'fa fa-arrow-circle-o-right');
?>
</li>
</ul>
</div>
<?php
}
?>
<span class="gf_admin_page_subtitle">
<span class="gf_admin_page_formid">ID: <?php
echo absint($form['id']);
?>
</span>
</span>
<?php
$gf_entry_locking = new GFEntryLocking();
$gf_entry_locking->lock_info($lead_id);
?>
</h2>
<?php
GFCommon::display_dismissible_message();
?>
<?php
RGForms::top_toolbar();
?>
<div id="poststuff">
<?php
wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
?>
<?php
wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
?>
<div id="post-body" class="metabox-holder columns-2">
<div id="post-body-content">
<?php
/**
* Fires before the entry detail content is displayed
*
* @param array $form The Form object
* @param array $lead The Entry object
*/
do_action('gform_entry_detail_content_before', $form, $lead);
if ($mode == 'view') {
self::lead_detail_grid($form, $lead, true);
} else {
self::lead_detail_edit($form, $lead);
}
/**
* Fires when entry details are displayed
示例6: leads_page
public static function leads_page($form_id)
{
global $wpdb;
//quit if version of wp is not supported
if (!GFCommon::ensure_wp_version()) {
return;
}
$form = GFFormsModel::get_form_meta($form_id);
$table = new GF_Entry_List_Table(array('form_id' => $form_id, 'form' => $form));
$table->prepare_items();
$table->output_styles();
$table->output_scripts();
wp_print_styles(array('thickbox'));
echo GFCommon::get_remote_message();
?>
<div class="wrap <?php
echo GFCommon::get_browser_class();
?>
">
<?php
GFCommon::form_page_title($form);
?>
<?php
GFCommon::display_dismissible_message();
?>
<?php
GFForms::top_toolbar();
if ($table->has_items()) {
?>
<div id="entry_search_container">
<div id="entry_filters" style=""></div>
<a style="" class="button" id="entry_search_button"
href="javascript:Search('<?php
echo esc_js($table->get_orderby());
?>
', '<?php
echo esc_js($table->get_order());
?>
', <?php
echo absint($form_id);
?>
, jQuery('.gform-filter-value').val(), '<?php
echo esc_js($table->get_filter());
?>
', jQuery('.gform-filter-field').val(), jQuery('.gform-filter-operator').val());"><?php
esc_html_e('Search', 'gravityforms');
?>
</a>
</div>
<?php
}
?>
<form id="entry_list_form" method="post">
<?php
$table->views();
$table->display();
?>
</form>
</div>
<?php
}
示例7: page_header
public static function page_header($title = '')
{
// register admin styles
$min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min';
wp_register_style('gform_admin', GFCommon::get_base_url() . "/css/admin{$min}.css");
wp_print_styles(array('jquery-ui-styles', 'gform_admin', 'wp-pointer'));
$form = GFFormsModel::get_form_meta(rgget('id'));
$current_tab = rgempty('subview', $_GET) ? 'settings' : rgget('subview');
$setting_tabs = GFFormSettings::get_tabs($form['id']);
// kind of boring having to pass the title, optionally get it from the settings tab
if (!$title) {
foreach ($setting_tabs as $tab) {
if ($tab['name'] == $current_tab) {
$title = $tab['label'];
}
}
}
?>
<div class="wrap gforms_edit_form gforms_form_settings_wrap <?php
echo GFCommon::get_browser_class();
?>
">
<?php
GFCommon::form_page_title($form);
?>
<?php
GFCommon::display_dismissible_message();
?>
<?php
GFCommon::display_admin_message();
?>
<?php
RGForms::top_toolbar();
?>
<div id="gform_tab_group" class="gform_tab_group vertical_tabs">
<ul id="gform_tabs" class="gform_tabs">
<?php
foreach ($setting_tabs as $tab) {
$query = array('subview' => $tab['name']);
if (isset($tab['query'])) {
$query = array_merge($query, $tab['query']);
}
$url = add_query_arg($query);
?>
<li <?php
echo $current_tab == $tab['name'] ? "class='active'" : '';
?>
>
<a href="<?php
echo esc_url($url);
?>
"><?php
echo esc_html($tab['label']);
?>
</a><span></span>
</li>
<?php
}
?>
</ul>
<div id="gform_tab_container_1" class="gform_tab_container">
<div class="gform_tab_content" id="tab_<?php
echo esc_attr($current_tab);
?>
">
<?php
}
示例8: help_page
/**
* Displays the Gravity Forms Help page
*
* @access public
* @static
*/
public static function help_page()
{
if (!GFCommon::ensure_wp_version()) {
return;
}
echo GFCommon::get_remote_message();
$min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min';
?>
<link rel="stylesheet" href="<?php
echo GFCommon::get_base_url();
?>
/css/admin<?php
echo $min;
?>
.css" />
<div class="wrap <?php
echo GFCommon::get_browser_class();
?>
">
<h2><?php
esc_html_e('Gravity Forms Help', 'gravityforms');
?>
</h2>
<?php
GFCommon::display_dismissible_message();
?>
<div style="margin-top:10px;">
<div class="gf_admin_notice"><?php
printf(esc_html__('%sIMPORTANT NOTICE:%s We do not provide support via telephone or e-mail. Please %sopen a support ticket%s.', 'gravityforms'), '<strong>', '</strong>', '<a href="https://www.gravityhelp.com/support/" target="_blank">', '</a>');
?>
</div>
<div class="gf_help_content"><p><?php
printf(esc_html__("Please review the plugin documentation and %sfrequently asked questions (FAQ)%s first. If you still can't find the answer %sopen a support ticket%s and we will be happy to answer your questions and assist you with any problems. %sPlease note:%s If you have not %spurchased a license%s from us, you will not have access to these help resources.", 'gravityforms'), '<a href="https://www.gravityhelp.com/frequently-asked-questions/">', '</a>', '<a href="https://www.gravityhelp.com/support/" target="_blank">', '</a>', '<strong>', '</strong>', '<a href="http://www.gravityforms.com/purchase-gravity-forms/">', '</a>');
?>
</p></div>
<div class="hr-divider"></div>
<h3><?php
esc_html_e('User Documentation', 'gravityforms');
?>
</h3>
<div class="gforms_helpbox" style="margin:15px 0;">
<ul class="resource_list">
<li>
<i class="fa fa-book"></i> <a href="https://www.gravityhelp.com/documentation/article/creating-a-form/">
<?php
esc_html_e('Creating a Form', 'gravityforms');
?>
</a>
</li>
<li>
<i class="fa fa-book"></i> <a target="_blank" href="https://www.gravityhelp.com/documentation/article/embedding-a-form/">
<?php
esc_html_e('Embedding a Form', 'gravityforms');
?>
</a>
</li>
<li>
<i class="fa fa-book"></i> <a target="_blank" href="https://www.gravityhelp.com/documentation/article/reviewing-form-submissions/">
<?php
esc_html_e('Reviewing Form Submissions', 'gravityforms');
?>
</a>
</li>
<li>
<i class="fa fa-book"></i> <a target="_blank" href="https://www.gravityhelp.com/documentation/article/configuring-confirmations-in-gravity-forms/">
<?php
esc_html_e('Configuring Confirmations', 'gravityforms');
?>
</a>
</li>
<li>
<i class="fa fa-book"></i> <a target="_blank" href="https://www.gravityhelp.com/documentation/article/configuring-notifications-in-gravity-forms/">
<?php
esc_html_e('Configuring Notifications', 'gravityforms');
?>
</a>
</li>
</ul>
</div>
<div class="hr-divider"></div>
<h3><?php
esc_html_e('Developer Documentation', 'gravityforms');
?>
//.........这里部分代码省略.........
示例9: page_header
/**
* Outputs the settings page header
*
* @access public
* @static
* @see GFSettings::get_subview
* @see GFSettings::$addon_page
*
* @param string $title Optional. The page title to be used. Defaults to an empty string.
* @param string $message Optional. The message to display in the header. Defaults to empty string.
*/
public static function page_header($title = '', $message = '')
{
$min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min';
// register admin styles
wp_register_style('gform_admin', GFCommon::get_base_url() . "/css/admin{$min}.css");
wp_print_styles(array('jquery-ui-styles', 'gform_admin'));
$current_tab = self::get_subview();
// Build left side options, always have GF Settings first and Uninstall last, put add-ons in the middle
$setting_tabs = array('10' => array('name' => 'settings', 'label' => __('Settings', 'gravityforms')));
if (!empty(self::$addon_pages)) {
$sorted_addons = self::$addon_pages;
asort($sorted_addons);
//add add-ons to menu
foreach ($sorted_addons as $sorted_addon) {
$setting_tabs[] = array('name' => urlencode($sorted_addon['name']), 'label' => esc_html($sorted_addon['tab_label']), 'title' => esc_html(rgar($sorted_addon, 'title')));
}
}
// Prevent Uninstall tab from being added for users that don't have gravityforms_uninstall capability
if (GFCommon::current_user_can_any('gravityforms_uninstall')) {
$setting_tabs[] = array('name' => 'uninstall', 'label' => __('Uninstall', 'gravityforms'));
}
/**
* Filters the Settings menu tabs
*
* @param array $setting_tabs The settings tab names and labels
*/
$setting_tabs = apply_filters('gform_settings_menu', $setting_tabs);
ksort($setting_tabs, SORT_NUMERIC);
// kind of boring having to pass the title, optionally get it from the settings tab
if (!$title) {
foreach ($setting_tabs as $tab) {
if ($tab['name'] == urlencode($current_tab)) {
$title = !empty($tab['title']) ? $tab['title'] : $tab['label'];
}
}
}
?>
<div class="wrap <?php
echo GFCommon::get_browser_class();
?>
gforms_settings_wrap">
<?php
if ($message) {
?>
<div id="message" class="updated"><p><?php
echo $message;
?>
</p></div>
<?php
}
?>
<h2><?php
echo esc_html($title);
?>
</h2>
<?php
GFCommon::display_dismissible_message();
?>
<div id="gform_tab_group" class="gform_tab_group vertical_tabs">
<ul id="gform_tabs" class="gform_tabs">
<?php
foreach ($setting_tabs as $tab) {
$name = $tab['label'];
$url = add_query_arg(array('subview' => $tab['name']), admin_url('admin.php?page=gf_settings'));
?>
<li <?php
echo urlencode($current_tab) == $tab['name'] ? "class='active'" : '';
?>
>
<a href="<?php
echo esc_url($url);
?>
"><?php
echo esc_html($tab['label']);
?>
</a>
</li>
<?php
}
?>
</ul>
<div id="gform_tab_container" class="gform_tab_container">
<div class="gform_tab_content" id="tab_<?php
//.........这里部分代码省略.........
示例10: form_list_page
//.........这里部分代码省略.........
?>
).attr('alt', <?php
echo json_encode(esc_attr__('Active', 'gravityforms'));
?>
);
}
UpdateCount("active_count", is_active ? -1 : 1);
UpdateCount("inactive_count", is_active ? 1 : -1);
var mysack = new sack(<?php
echo json_encode(admin_url('admin-ajax.php'));
?>
);
mysack.execute = 1;
mysack.method = 'POST';
mysack.setVar("action", "rg_update_form_active");
mysack.setVar("rg_update_form_active", <?php
echo json_encode(wp_create_nonce('rg_update_form_active'));
?>
);
mysack.setVar("form_id", form_id);
mysack.setVar("is_active", is_active ? 0 : 1);
mysack.onError = function () {
alert(<?php
echo json_encode(__('Ajax error while updating form', 'gravityforms'));
?>
)
};
mysack.runAJAX();
return true;
}
function UpdateCount(element_id, change) {
var element = jQuery("#" + element_id);
var count = parseInt(element.html()) + change
element.html(count + "");
}
function gfConfirmBulkAction(element_id) {
var element = "#" + element_id;
if (jQuery(element).val() == 'delete')
return confirm(<?php
echo json_encode(__('WARNING: You are about to delete these forms and ALL entries associated with them. ', 'gravityforms') . __("'Cancel' to stop, 'OK' to delete.", 'gravityforms'));
?>
);
else if (jQuery(element).val() == 'reset_views')
return confirm(<?php
echo json_encode(__('Are you sure you would like to reset the Views for the selected forms? ', 'gravityforms') . __("'Cancel' to stop, 'OK' to reset.", 'gravityforms'));
?>
);
else if (jQuery(element).val() == 'delete_entries')
return confirm(<?php
echo json_encode(__('WARNING: You are about to delete ALL entries associated with the selected forms. ', 'gravityforms') . __("'Cancel' to stop, 'OK' to delete.", 'gravityforms'));
?>
);
return true;
}
</script>
<link rel="stylesheet" href="<?php
echo esc_url(GFCommon::get_base_url());
?>
/css/admin<?php
echo $min;
?>
.css?ver=<?php
echo GFForms::$version;
?>
"/>
<div class="wrap <?php
echo sanitize_html_class(GFCommon::get_browser_class());
?>
">
<h2>
<?php
esc_html_e('Forms', 'gravityforms');
if (GFCommon::current_user_can_any('gravityforms_create_form')) {
echo '<a class="add-new-h2" href="" onclick="return loadNewFormModal();" onkeypress="return loadNewFormModal();">' . esc_html__('Add New', 'gravityforms') . '</a>';
}
?>
</h2>
<?php
GFCommon::display_dismissible_message();
?>
<form id="form_list_form" method="post">
<?php
$table = new GF_Form_List_Table();
$table->process_action();
$table->views();
$table->prepare_items();
$table->display();
?>
</form>
<?php
}