当前位置: 首页>>代码示例>>PHP>>正文


PHP menu_primary_local_tasks函数代码示例

本文整理汇总了PHP中menu_primary_local_tasks函数的典型用法代码示例。如果您正苦于以下问题:PHP menu_primary_local_tasks函数的具体用法?PHP menu_primary_local_tasks怎么用?PHP menu_primary_local_tasks使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了menu_primary_local_tasks函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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'), '');
}
开发者ID:jmstacey,项目名称:drupal,代码行数:10,代码来源:template.php

示例2: 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();
}
开发者ID:nvaken,项目名称:syte,代码行数:28,代码来源:template.php

示例3: busy_menu_local_tasks

/**
 * Returns renderable local tasks.
 *
 * @ingroup themeable
 */
function busy_menu_local_tasks()
{
    $output = array();
    if ($primary = menu_primary_local_tasks()) {
        foreach ($primary as $key => $task) {
            if (is_numeric($key) && $key == count($primary) - 1) {
                $primary[$key]['#last'] = TRUE;
            }
        }
        $primary['#prefix'] = '<ul class="tabs primary">';
        $primary['#suffix'] = '</ul>';
        $output[] = $primary;
    }
    if ($secondary = menu_secondary_local_tasks()) {
        foreach ($secondary as $key => $task) {
            if (is_numeric($key) && $key == count($secondary) - 1) {
                $secondary[$key]['#last'] = TRUE;
            }
        }
        $secondary['#prefix'] = '<ul class="tabs secondary">';
        $secondary['#suffix'] = '</ul>';
        $output[] = $secondary;
    }
    return $output;
}
开发者ID:EclipseGc,项目名称:busy,代码行数:30,代码来源:template.php

示例4: 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>');
}
开发者ID:netsensei,项目名称:netsensei,代码行数:11,代码来源:template.php

示例5: phptemplate_menu_local_tasks

/**
 * Returns the rendered local tasks. The default implementation renders
 * them as tabs.
 *
 * @ingroup themeable
 */
function phptemplate_menu_local_tasks()
{
    $output = '';
    if ($primary = menu_primary_local_tasks()) {
        $output .= "<ul class=\"tabs primary\">\n" . $primary . "</ul>\n";
    }
    return $output;
}
开发者ID:heshanlk,项目名称:Journalcrunch,代码行数:14,代码来源:template.php

示例6: bootsmacss_preprocess_node

/**
 * Implements hook_preprocess_node().
 *
 * Enable template suggestions for teaser ex. node--conent-type--teaser.tpl.php.
 */
function bootsmacss_preprocess_node(&$vars)
{
    if ($vars['view_mode'] == 'teaser') {
        array_unshift($vars['theme_hook_suggestions'], 'node__' . $vars['node']->type . '__teaser');
        array_unshift($vars['theme_hook_suggestions'], 'node__' . $vars['node']->nid . '__teaser');
    }
    // Prepare tabs to render them in node.tpl or DS layout instead of page.tpl.
    $vars['tabs'] = menu_primary_local_tasks();
}
开发者ID:bandanaman,项目名称:bootsmacss-drupal,代码行数:14,代码来源:template.php

示例7: 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();
}
开发者ID:paulalbert1,项目名称:vivodashboard,代码行数:12,代码来源:modifications.php

示例8: cp_theme_menu_local_tasks

/**
 * Returns the rendered local tasks. The default implementation renders
 * them as tabs. Overridden to split the secondary tasks.
 *
 * @ingroup themeable
 */
function cp_theme_menu_local_tasks()
{
    $output = '';
    $primary = menu_primary_local_tasks();
    if ($primary) {
        $output .= '<ul class="tabs primary clear-block">' . $primary . '</ul>';
    }
    return $output;
}
开发者ID:stacksight,项目名称:openscholar,代码行数:15,代码来源:template.php

示例9: 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();
}
开发者ID:nexusd,项目名称:school,代码行数:13,代码来源:drupal6_theme_methods.php

示例10: 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';
    }
}
开发者ID:patrickouc,项目名称:dgd7,代码行数:62,代码来源:template.php

示例11: 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;
}
开发者ID:eusholli,项目名称:drupal,代码行数:11,代码来源:template.php

示例12: 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;
}
开发者ID:stacksight,项目名称:openscholar,代码行数:14,代码来源:template.php

示例13: 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();
    // get all the current css information into an array
    $css = drupal_add_css();
    // Removing the css files of vertical tabs module because and use the seven style instead.
    unset($css['all']['module'][drupal_get_path('module', 'vertical_tabs') . '/vertical_tabs.css']);
    // now place the remaining css files back into the template variable for rendering
    $vars['styles'] = drupal_get_css($css);
}
开发者ID:Quilted,项目名称:mass_extinction,代码行数:14,代码来源:template.php

示例14: phptemplate_menu_local_tasks

/**
 * Duplicate of theme_menu_local_tasks() but adds clear-block to tabs.
 */
function phptemplate_menu_local_tasks()
{
    $output = '';
    if ($primary = menu_primary_local_tasks()) {
        $output .= '<ul class="tabs primary clear-block">' . $primary . '</ul>';
    }
    if ($secondary = menu_secondary_local_tasks()) {
        $output .= '<ul class="tabs secondary clear-block">' . $secondary . '</ul>';
    }
    return $output;
}
开发者ID:e2thex,项目名称:hackunteers.org,代码行数:14,代码来源:template.php

示例15: townsquare_bootstrap_preprocess_page

/**
 * Implements theme_preprocess_page().
 */
function townsquare_bootstrap_preprocess_page(&$vars)
{
    global $user;
    $vars['primary_local_tasks'] = menu_primary_local_tasks();
    $vars['secondary_local_tasks'] = menu_secondary_local_tasks();
    // The following menu stuff is lame
    foreach ($vars['main_menu'] as $item => $options) {
        $vars['main_menu'][$item]['html'] = TRUE;
        $vars['main_menu'][$item]['attributes']['id'] = 'menu-link-' . drupal_clean_css_identifier($options['href']);
    }
    $admin_menu = menu_tree_all_data('management');
    $children = array_pop($admin_menu);
    if ($children) {
        foreach ($children['below'] as $key => $value) {
            $children['below'][$key]['below'] = array();
        }
        $vars['admin_menu'] = menu_tree_output($children['below']);
    }
    // Add user picture if logged in
    if ($user->uid) {
        $vars['user_name'] = check_plain($user->name);
        if (!empty($user->picture)) {
            if (is_numeric($user->picture)) {
                $user->picture = file_load($user->picture);
            }
            if (!empty($user->picture->uri)) {
                $filepath = $user->picture->uri;
            }
        } elseif (variable_get('user_picture_default', '')) {
            $filepath = variable_get('user_picture_default', '');
        }
        if (isset($filepath)) {
            $alt = t("@user's picture", array('@user' => format_username($user)));
            if (module_exists('image') && file_valid_uri($filepath) && ($style = variable_get('user_picture_style', ''))) {
                $vars['user_picture'] = theme('image_style', array('style_name' => $style, 'path' => $filepath, 'alt' => $alt, 'title' => $alt));
            } else {
                $vars['user_picture'] = theme('image', array('path' => $filepath, 'alt' => $alt, 'title' => $alt));
            }
        } else {
            $vars['user_picture'] = '<i class="icon-user"></i>';
        }
    } else {
        unset($vars['secondary_menu']);
        $vars['login'] = drupal_get_form('user_login_block');
    }
    // Add Bootstrap
    $path = libraries_get_path('bootstrap');
    drupal_add_css($path . '/css/bootstrap.css');
    drupal_add_css($path . '/css/bootstrap-responsive.css');
    drupal_add_js($path . '/js/bootstrap.js');
    $path = libraries_get_path('font-awesome');
    drupal_add_css($path . '/css/font-awesome.css');
}
开发者ID:nningego,项目名称:townsquare,代码行数:56,代码来源:template.php


注:本文中的menu_primary_local_tasks函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。