本文整理汇总了PHP中menu_secondary_local_tasks函数的典型用法代码示例。如果您正苦于以下问题:PHP menu_secondary_local_tasks函数的具体用法?PHP menu_secondary_local_tasks怎么用?PHP menu_secondary_local_tasks使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了menu_secondary_local_tasks函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boldy_preprocess_page
/**
* Override or insert PHPTemplate variables into the templates.
*/
function boldy_preprocess_page(&$vars)
{
$vars['tabs2'] = menu_secondary_local_tasks();
// Hook into color.module
if (module_exists('color')) {
_color_page_alter($vars);
}
// Classes for body element. Allows advanced theming based on context
// (home page, node of certain type, etc.)
$classes = explode(' ', $vars['body_classes']);
// Remove the mostly useless page-ARG0 class.
if ($index = array_search(preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', 'page-' . drupal_strtolower(arg(0))), $classes)) {
unset($classes[$index]);
}
if (!$vars['is_front']) {
// Add unique class for each page.
$path = drupal_get_path_alias($_GET['q']);
$classes[] = boldy_id_safe('page-' . $path);
// Add unique class for each website section.
list($section, ) = explode('/', $path, 2);
if (arg(0) == 'node') {
if (arg(1) == 'add') {
$section = 'node-add';
} elseif (is_numeric(arg(1)) && (arg(2) == 'edit' || arg(2) == 'delete')) {
$section = 'node-' . arg(2);
}
}
$classes[] = boldy_id_safe('section-' . $section);
}
$vars['body_classes_array'] = $classes;
$vars['body_classes'] = implode(' ', $classes);
// Concatenate with spaces.
}
示例2: phptemplate_preprocess_page
function phptemplate_preprocess_page(&$vars)
{
$vars['tabs2'] = menu_secondary_local_tasks();
if (module_exists('path')) {
$alias = drupal_get_path_alias(str_replace('/edit', '', $_GET['q']));
if ($alias != $_GET['q']) {
$suggestions = array();
$template_filename = 'page';
foreach (explode('/', $alias) as $path_part) {
$template_filename = $template_filename . '-' . $path_part;
$suggestions[] = $template_filename;
}
$vars['template_files'] = array_merge((array) $suggestions, $vars['template_files']);
}
}
//todo i think this can be deleted
if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) {
$termid = arg(2);
$parent_term = taxonomy_get_parents($termid);
if (key($parent_term) == EMAILS_TERM_ID) {
$term = taxonomy_get_term($termid);
$vars['template_file'] = 'page-taxonomy-term-emails';
}
}
}
示例3: seven_preprocess_page
/**
* Override or insert variables into the page template.
*/
function seven_preprocess_page(&$vars)
{
$vars['primary_local_tasks'] = menu_primary_local_tasks();
$vars['secondary_local_tasks'] = menu_secondary_local_tasks();
$vars['ie_styles'] = '<!--[if lt IE 7]><style type="text/css" media="screen">@import ' . path_to_theme() . '/ie6.css";</style><![endif]-->';
$vars['back_to_site'] = l(t('Back to the front page'), '');
}
示例4: cube_preprocess_page
/**
* Preprocessor for theme('page').
*/
function cube_preprocess_page(&$vars)
{
// Automatically adjust layout for page with right sidebar content if no
// explicit layout has been set.
$layout = module_exists('context_layouts') ? context_layouts_get_active_layout() : NULL;
if (arg(0) != 'admin' && !empty($vars['page']['right']) && (!$layout || $layout['layout'] == 'default')) {
$vars['theme_hook_suggestion'] = 'page__context_layouts_cube_columns';
drupal_add_css(drupal_get_path('theme', 'cube') . '/layout-sidebar.css');
}
// Clear out help text if empty.
if (empty($vars['help']) || !strip_tags($vars['help'])) {
$vars['help'] = '';
}
// Help text toggler link.
$vars['help_toggler'] = l(t('Help'), $_GET['q'], array('attributes' => array('id' => 'help-toggler', 'class' => array('toggler')), 'fragment' => 'help-text'));
// Overlay is enabled.
$vars['overlay'] = module_exists('overlay') && overlay_get_mode() === 'child';
if ($vars['overlay']) {
}
// Display user links
$vars['user_links'] = _cube_user_links();
// Display tabs
$vars['primary_tabs'] = menu_primary_local_tasks();
$vars['secondary_tabs'] = menu_secondary_local_tasks();
}
示例5: garland_preprocess_page
/**
* Override or insert variables into the page template.
*/
function garland_preprocess_page(&$vars)
{
$vars['tabs2'] = menu_secondary_local_tasks();
if (isset($vars['main_menu'])) {
$vars['primary_nav'] = theme('links__system_main_menu', array('links' => $vars['main_menu'], 'attributes' => array('class' => array('links', 'main-menu')), 'heading' => array('text' => t('Main menu'), 'level' => 'h2', 'class' => array('element-invisible'))));
} else {
$vars['primary_nav'] = FALSE;
}
if (isset($vars['secondary_menu'])) {
$vars['secondary_nav'] = theme('links__system_secondary_menu', array('links' => $vars['secondary_menu'], 'attributes' => array('class' => array('links', 'secondary-menu')), 'heading' => array('text' => t('Secondary menu'), 'level' => 'h2', 'class' => array('element-invisible'))));
} else {
$vars['secondary_nav'] = FALSE;
}
// Prepare header.
$site_fields = array();
if (!empty($vars['site_name'])) {
$site_fields[] = check_plain($vars['site_name']);
}
if (!empty($vars['site_slogan'])) {
$site_fields[] = check_plain($vars['site_slogan']);
}
$vars['site_title'] = implode(' ', $site_fields);
if (!empty($site_fields)) {
$site_fields[0] = '<span>' . $site_fields[0] . '</span>';
}
$vars['site_html'] = implode(' ', $site_fields);
// Set a variable for the site name title and logo alt attributes text.
$slogan_text = filter_xss_admin(variable_get('site_slogan', ''));
$site_name_text = filter_xss_admin(variable_get('site_name', 'Drupal'));
$vars['site_name_and_slogan'] = $site_name_text . ' ' . $slogan_text;
}
示例6: garland_preprocess_page
/**
* Override or insert variables into the page template.
*/
function garland_preprocess_page(&$vars)
{
$vars['tabs2'] = menu_secondary_local_tasks();
if (isset($vars['main_menu'])) {
$vars['primary_nav'] = theme('links', array('links' => $vars['main_menu'], 'attributes' => array('class' => array('links', 'main-menu')), 'heading' => array('text' => t('Main menu'), 'level' => 'h2', 'class' => array('element-invisible'))));
} else {
$vars['primary_nav'] = FALSE;
}
if (isset($vars['secondary_menu'])) {
$vars['secondary_nav'] = theme('links', array('links' => $vars['secondary_menu'], 'attributes' => array('class' => array('links', 'secondary-menu')), 'heading' => array('text' => t('Secondary menu'), 'level' => 'h2', 'class' => array('element-invisible'))));
} else {
$vars['secondary_nav'] = FALSE;
}
// Prepare header
$site_fields = array();
if (!empty($vars['site_name'])) {
$site_fields[] = check_plain($vars['site_name']);
}
if (!empty($vars['site_slogan'])) {
$site_fields[] = check_plain($vars['site_slogan']);
}
$vars['site_title'] = implode(' ', $site_fields);
if (!empty($site_fields)) {
$site_fields[0] = '<span>' . $site_fields[0] . '</span>';
}
$vars['site_html'] = implode(' ', $site_fields);
}
示例7: garland_preprocess_page
/**
* Override or insert variables into the page template.
*/
function garland_preprocess_page(&$vars)
{
$vars['tabs2'] = menu_secondary_local_tasks();
if (isset($vars['main_menu'])) {
$vars['primary_nav'] = theme('links', $vars['main_menu'], array('class' => array('links', 'main-menu')), array('text' => t('Main menu'), 'level' => 'h2', 'class' => array('element-invisible')));
} else {
$vars['primary_nav'] = FALSE;
}
if (isset($vars['secondary_menu'])) {
$vars['secondary_nav'] = theme('links', $vars['secondary_menu'], array('class' => array('links', 'secondary-menu')), array('text' => t('Secondary menu'), 'level' => 'h2', 'class' => array('element-invisible')));
} else {
$vars['secondary_nav'] = FALSE;
}
$vars['ie_styles'] = garland_get_ie_styles();
// Prepare header
$site_fields = array();
if (!empty($vars['site_name'])) {
$site_fields[] = check_plain($vars['site_name']);
}
if (!empty($vars['site_slogan'])) {
$site_fields[] = check_plain($vars['site_slogan']);
}
$vars['site_title'] = implode(' ', $site_fields);
if (!empty($site_fields)) {
$site_fields[0] = '<span>' . $site_fields[0] . '</span>';
}
$vars['site_html'] = implode(' ', $site_fields);
// Hook into color.module
if (module_exists('color')) {
_color_page_alter($vars);
}
}
示例8: phptemplate_preprocess_page
/**
* Override or insert PHPTemplate variables into the templates.
*/
function phptemplate_preprocess_page(&$vars)
{
$vars['tabs2'] = menu_secondary_local_tasks();
// Hook into color.module
if (module_exists('color')) {
_color_page_alter($vars);
}
// handy helper for themes, not related to 404 issue
$vars['base_path'] = base_path();
// Only does the check if required
if (!$vars['show_blocks']) {
global $theme;
$regions = system_region_list($theme);
foreach (array_keys($regions) as $region) {
// Only set left and right regions
// Drupal core sets the other blocks already
// IMHO this shows a real lack of design considerations for leaving these out!
if ($region == 'left' || $region == 'right') {
$blocks = theme('blocks', $region);
if (isset($variables[$region])) {
$vars[$region] .= $blocks;
} else {
$vars[$region] = $blocks;
}
}
}
}
}
示例9: phptemplate_preprocess_page
/**
* Override or insert PHPTemplate variables into the templates.
*/
function phptemplate_preprocess_page(&$vars)
{
$vars['tabs2'] = menu_secondary_local_tasks();
// Hook into color.module
if (module_exists('color')) {
_color_page_alter($vars);
}
}
示例10: tao_preprocess_page
/**
* Implementation of preprocess_page().
*/
function tao_preprocess_page(&$vars)
{
// Split primary and secondary local tasks
$vars['primary_local_tasks'] = menu_primary_local_tasks();
$vars['secondary_local_tasks'] = menu_secondary_local_tasks();
// Link site name to frontpage
$vars['site_name'] = l($vars['site_name'], '<front>');
}
示例11: vdb_preprocess_page
/**
* Implements hook_preprocess_page().
*/
function vdb_preprocess_page(&$vars)
{
$menu1 = menu_navigation_links('main-menu', 0);
$vars['menu_first'] = theme('links__system_main_menu', array('links' => $menu1, 'attributes' => array('id' => 'main-menu-links')));
$menu2 = menu_navigation_links('main-menu', 1);
$vars['menu_second'] = empty($menu2) ? '' : theme('links__system_main_menu', array('links' => $menu2, 'preserve_query' => TRUE, 'attributes' => array('class' => array('tabs', 'primary'))));
$vars['tabs_first'] = menu_primary_local_tasks();
$vars['tabs_second'] = menu_secondary_local_tasks();
}
示例12: phptemplate_preprocess_page
/**
* Override or insert PHPTemplate variables into the templates.
*/
function phptemplate_preprocess_page(&$vars)
{
$view = get_artx_drupal_view();
$message = $view->get_incorrect_version_message();
if (!empty($message)) {
drupal_set_message($message, 'error');
}
$vars['tabs'] = menu_primary_local_tasks();
$vars['tabs2'] = menu_secondary_local_tasks();
}
示例13: dgd7_preprocess_html
/**
* Implements template_preprocess_html().
*
* The changes made in this function affect the variables for the html.tpl.php
* template file, which is located in templates/html.tpl.php of this theme.
* Using drupal_css_css() is covered on pages 344-345.
*/
function dgd7_preprocess_html(&$vars)
{
// Unfortunately, the XHTML+RDFa 1.0 doctype is hardcoded. We don't want an
// XHMTL doctype and the RDFa version is old. The following code changes it
// to HTML+RDFa 1.1 when the RDF module is enabled, and a plain jane HTML5
// doctype when it's not. To learn more about theming with RDFa in Drupal 7
// see http://lin-clark.com/blog/theming-html5-and-rdfa-drupal-7
if (module_exists('rdf')) {
$vars['doctype'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN">' . "\n";
$vars['rdf_profile'] = ' profile="' . $vars['grddl_profile'] . '"';
} else {
$vars['doctype'] = '<!DOCTYPE html>' . "\n";
$vars['rdf_profile'] = '';
}
// Add externally hosted files. This will not work if entered in .info file.
// Setting the group to CSS_THEME will load these files in the "theme group"
// which load after system and module CSS files. This is not terribly
// important in this case, but we do need to specify "external" as TRUE.
// Ideally that wouldn't be necessary it would "just work" like
// drupal_add_js(). See http://drupal.org/node/953340 to help make it happen.
drupal_add_css('http://fonts.googleapis.com/css?family=Droid+Serif:regular,italic,bold,bolditalic&subset=latin', array('external' => TRUE, 'group' => CSS_THEME));
drupal_add_css('http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold&subset=latin', array('external' => TRUE, 'group' => CSS_THEME));
// Create a variable containing the path to the theme. We'll use this in
// in html.tpl.php.
$vars['path'] = drupal_get_path('theme', 'dgd7');
// Add the regular theme stylesheets.
// This is done here as opposed to using the .info file so that we can control
// the order. Since we cannot add the external CSS files via .info and we need
// those to load first, we add them all here.
drupal_add_css($vars['path'] . '/css/layout.css', array('group' => CSS_THEME));
drupal_add_css($vars['path'] . '/css/forms.css', array('group' => CSS_THEME));
drupal_add_css($vars['path'] . '/css/style.css', array('group' => CSS_THEME));
// We have a separate CSS file for styling the tabs that we only want to load
// when there are actually tabs present. The following code checks for the
// existence of primary and secondary tabs and then proceeds to load the CSS
// file if needed.
if (menu_primary_local_tasks() || menu_secondary_local_tasks()) {
drupal_add_css($vars['path'] . '/css/tabs.css', array('group' => CSS_THEME, 'preprocess' => FALSE));
}
// Add a print stylesheet.
drupal_add_css($vars['path'] . '/css/print.css', array('group' => CSS_THEME, 'media' => 'print', 'preprocess' => FALSE));
// Add a conditional stylesheet for Internet Explorer.
// The "browsers" key allows you to specify what versions of IE to target. In
// this case we are targeting "less than or equal to IE 7". Drupal will wrap
// the code for this stylesheet in conditional comments:
// "<!--[if lte IE 7]> … <![endif]-->. For more details about conditional
// comments see: http://www.quirksmode.org/css/condcom.html
drupal_add_css($vars['path'] . '/css/ie.css', array('browsers' => array('IE' => 'lte IE 7', '!IE' => FALSE), 'group' => CSS_THEME, 'preprocess' => FALSE));
// In template_preprocess_html() we have easy access to the "class" attribute
// for the <body> element. Here we add a helper class that indicates that
// there is no title for the page to help styling the content region easily.
if (!drupal_get_title()) {
$vars['classes_array'][] = 'no-title';
}
}
示例14: scholar_base_menu_local_tasks
/**
* Adds clearfix to tabs.
*/
function scholar_base_menu_local_tasks()
{
$output = '';
if (menu_primary_local_tasks()) {
$output .= '<ul class="tabs primary clearfix">' . menu_primary_local_tasks() . '</ul>';
}
if (menu_secondary_local_tasks()) {
$output .= '<ul class="tabs secondary clearfix">' . menu_secondary_local_tasks() . '</ul>';
}
return $output;
}
示例15: earthen_menu_local_tasks
function earthen_menu_local_tasks()
{
$output = '';
if ($primary = menu_primary_local_tasks()) {
$output .= $primary;
}
if ($secondary = menu_secondary_local_tasks()) {
$output .= $secondary;
}
return $output;
}