本文整理汇总了PHP中GFFormSettings::get_tabs方法的典型用法代码示例。如果您正苦于以下问题:PHP GFFormSettings::get_tabs方法的具体用法?PHP GFFormSettings::get_tabs怎么用?PHP GFFormSettings::get_tabs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GFFormSettings
的用法示例。
在下文中一共展示了GFFormSettings::get_tabs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: page_header
public static function page_header($title = '')
{
// register admin styles
wp_register_style('gform_admin', GFCommon::get_base_url() . '/css/admin.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 <?php
echo GFCommon::get_browser_class();
?>
">
<h2 class="gf_admin_page_title">
<span><?php
echo $title;
?>
</span><span class="gf_admin_page_subtitle"><span class="gf_admin_page_formid">ID: <?php
echo $form['id'];
?>
</span><span class="gf_admin_page_formname"><?php
_e('Form Name', 'gravityforms');
?>
: <?php
echo $form['title'];
?>
</span></span>
</h2>
<?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 $current_tab;
?>
">
<?php
}
示例2: get_form_settings_sub_menu_items
public static function get_form_settings_sub_menu_items($form_id)
{
require_once GFCommon::get_base_path() . '/form_settings.php';
$sub_menu_items = array();
$tabs = GFFormSettings::get_tabs($form_id);
foreach ($tabs as $tab) {
if ($tab['name'] == 'settings') {
$form_setting_menu_item['label'] = 'Settings';
}
$sub_menu_items[] = array('url' => admin_url("admin.php?page=gf_edit_forms&view=settings&subview={$tab['name']}&id={$form_id}"), 'label' => $tab['label'], 'capabilities' => array('gravityforms_edit_forms'));
}
return $sub_menu_items;
}
示例3: 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
}