本文整理匯總了PHP中GFForms::top_toolbar方法的典型用法代碼示例。如果您正苦於以下問題:PHP GFForms::top_toolbar方法的具體用法?PHP GFForms::top_toolbar怎麽用?PHP GFForms::top_toolbar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GFForms
的用法示例。
在下文中一共展示了GFForms::top_toolbar方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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
}