• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP menu_tree_output函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: fs_core_preprocess_page

/**
 * Implemements hook_process_page
 * @param array $variables
 */
function fs_core_preprocess_page(&$variables)
{
    //Search form
    $search_form = drupal_get_form('search_form');
    $search_form_box = drupal_render($search_form);
    $variables['search_box'] = $search_form_box;
    if ($views_page = views_get_page_view()) {
        $variables['theme_hook_suggestions'][] = 'page__views__' . $views_page->name;
        $variables['theme_hook_suggestions'][] = 'page__views__' . $views_page->name . '_' . $views_page->current_display;
    }
    if (isset($variables['node']->type)) {
        $variables['theme_hook_suggestions'][] = 'page__' . $variables['node']->type;
    }
    // changes the links tree for the main menu, since by
    // default Drupal just provides first level ones
    $menu_tree = menu_tree_all_data('main-menu');
    $menu_tree = menu_tree_output($menu_tree);
    foreach ($menu_tree as $k => $v) {
        if (is_numeric($k) && count($v['#below'])) {
            $menu_tree[$k]['#below']['#theme_wrappers'][0] = 'menu_tree__submenu';
        }
    }
    $variables['main_menu'] = $menu_tree;
    if (arg(0) == 'taxonomy' && arg(1) == 'term') {
        $tid = (int) arg(2);
        $term = taxonomy_term_load($tid);
        if (is_object($term)) {
            $variables['theme_hook_suggestions'][] = 'page__taxonomy__' . $term->vocabulary_machine_name;
        }
    }
}
开发者ID:phpsubbarao,项目名称:test-core,代码行数:35,代码来源:template.php


示例2: scsmetronic_subtheme_preprocess_page

/**
 * Processes variables for block.tpl.php.
 *
 * Prepares the values passed to the theme_block function to be passed
 * into a pluggable template engine. Uses block properties to generate a
 * series of template file suggestions. If none are found, the default
 * block.tpl.php is used.
 *
 * Most themes utilize their own copy of block.tpl.php. The default is located
 * inside "modules/block/block.tpl.php". Look in there for the full list of
 * variables.
 *
 * The $variables array contains the following arguments:
 * - $block
 *
 * @see block.tpl.php
 */
function scsmetronic_subtheme_preprocess_page(&$variables)
{
    global $user;
    if (variable_get('scsmetronic_redirect_to_login') && $user->uid == 0 && arg(0) != 'user') {
        //header('Location: ' . url('user/login', array( 'absolute' => TRUE)), TRUE, 302);
        // Handle redirection to the login form.
        // using drupal_goto() with destination set causes a recursive redirect loop
        $login_path = 'user/login';
        $code = 302;
        // The code in drupal_get_destination() doesn't preserve any query string
        // on 403 pages, so reproduce the part we want here.
        $path = isset($_GET['destination']) ? $_GET['destination'] : '<front>';
        $query = drupal_http_build_query(drupal_get_query_parameters(NULL, array('q', 'destination')));
        if ($query != '') {
            $path .= '?' . $query;
        }
        $destination = array('destination' => $path);
        header('Location: ' . url($login_path, array('query' => $destination, 'absolute' => TRUE)), TRUE, 302);
        drupal_exit();
    }
    $variables['navbar_top'] = 'navbar-static-top';
    $theme_header = theme_get_setting('theme_header', 'scsmetronic');
    if (!empty($theme_header) && $theme_header !== 'default') {
        $variables['navbar_top'] = 'navbar-fixed-top';
    }
    //Get the entire main menu tree
    $main_menu_name = theme_get_setting('theme_main_menu', 'scsmetronic');
    $main_menu_tree = menu_tree_all_data($main_menu_name);
    $user_menu_tree = menu_tree_all_data('user-menu');
    //Add the rendered output to the $main_menu_expanded variable
    $variables['main_menu_expanded'] = menu_tree_output($main_menu_tree);
    $variables['user_menu_expanded'] = menu_tree_output($user_menu_tree);
    if ($modal_form_paths = theme_get_setting('theme_modal')) {
        $modal_forms = explode("\r\n", $modal_form_paths);
        drupal_add_js(array('scsmetronic_forms_modal' => $modal_forms), 'setting');
    }
    if ($user->uid) {
        $name = theme('username', array('account' => $user, 'link_path' => NULL));
    } else {
        $name = variable_get('anonymous', t('Guest'));
    }
    $variables['loggedin_user_name'] = $name;
    $variables['image'] = scsmetronic_login_user_image($user);
}
开发者ID:Thomsonaj,项目名称:Ken,代码行数:61,代码来源:template.php


示例3: qualiceutics__topbar_main_menu

/**
 * Implements theme_links() targeting the main menu topbar.
 * Override base template, which would add the class of "left",which  we don't need
 */
function qualiceutics__topbar_main_menu($variables)
{
    // We need to fetch the links ourselves because we need the entire tree.
    $links = menu_tree_output(menu_tree_all_data(variable_get('menu_main_links_source', 'main-menu')));
    $output = _zurb_foundation_links($links);
    return '<ul' . drupal_attributes($variables['attributes']) . '>' . $output . '</ul>';
}
开发者ID:CTH12,项目名称:qualiceutics,代码行数:11,代码来源:template.php


示例4: mdl_links__topbar_secondary_menu

/**
 * Implements theme_links() targeting the secondary menu topbar.
 */
function mdl_links__topbar_secondary_menu($variables)
{
    // We need to fetch the links ourselves because we need the entire tree.
    $links = menu_tree_output(menu_tree_all_data(variable_get('menu_secondary_links_source', 'user-menu')));
    $output = _mdl_links($links);
    return '<nav' . drupal_attributes($variables['attributes']) . '>' . $output . '</nav>';
}
开发者ID:zacdavidm,项目名称:mdl,代码行数:10,代码来源:template.php


示例5: msd15_preprocess_page

/**
 * Preprocessor for page.tpl.php template file.
 */
function msd15_preprocess_page(&$vars, $hook)
{
    // Get the entire main menu tree
    $main_menu_tree = menu_tree_all_data('main-menu');
    $vars['menu_tree_all_data'] = $main_menu_tree;
    // Add the rendered output to the $main_menu_expanded variable
    $vars['main_menu_expanded'] = menu_tree_output($main_menu_tree);
    if (isset($vars['node']->type)) {
        // We don't want to apply this on taxonomy or view pages
        // Splice (2) is based on existing default suggestions. Change it if you need to.
        array_splice($vars['theme_hook_suggestions'], -1, 0, 'page__' . $vars['node']->type);
        // Get the url_alias and make each item part of an array
        $url_alias = drupal_get_path_alias($_GET['q']);
        $split_url = explode('/', $url_alias);
        // Add the full path template pages
        // Insert 2nd to last to allow page--node--[nid] to be last
        $cumulative_path = '';
        foreach ($split_url as $path) {
            $cumulative_path .= '__' . $path;
            $path_name = 'page' . $cumulative_path;
            array_splice($vars['theme_hook_suggestions'], -1, 0, str_replace('-', '_', $path_name));
        }
        // This does just the page name on its own & is considered more specific than the longest path
        // (because sometimes those get too long)
        // Also we don't want to do this if there were no paths on the URL
        // Again, add 2nd to last to preserve page--node--[nid] if we do add it in
        if (count($split_url) > 1) {
            $page_name = end($split_url);
            array_splice($vars['theme_hook_suggestions'], -1, 0, 'page__' . str_replace('-', '_', $page_name));
        }
    }
}
开发者ID:patpaev,项目名称:benvs15,代码行数:35,代码来源:template.php


示例6: drupalcampbelgium_links__topbar_secondary_menu

/**
 * Implements theme_links() targeting the secondary menu topbar.
 */
function drupalcampbelgium_links__topbar_secondary_menu($variables)
{
    // We need to fetch the links ourselves because we need the entire tree.
    $links = menu_tree_output(menu_tree_all_data(variable_get('menu_secondary_links_source', 'user-menu')));
    $output = _zurb_foundation_links($links);
    $variables['attributes']['class'][] = 'center-buttons';
    return '<ul' . drupal_attributes($variables['attributes']) . '>' . $output . '</ul>';
}
开发者ID:soniCaH,项目名称:drupalcamp-2015,代码行数:11,代码来源:template.php


示例7: fever_preprocess_page

function fever_preprocess_page(&$vars)
{
    // ....
    // Get the entire main menu tree
    $main_menu_tree = menu_tree_all_data('main-menu');
    // Add the rendered output to the $main_menu_expanded variable
    $vars['main_menu_expanded'] = menu_tree_output($main_menu_tree);
}
开发者ID:rlhardrock,项目名称:drupalxtr,代码行数:8,代码来源:template.php


示例8: courage_admin_preprocess_page

function courage_admin_preprocess_page(&$variables)
{
    $main_menu_tree = menu_tree_all_data('management');
    $link = array('#theme' => 'item_list', '#items' => array(l('Home', url('<front>'))));
    $link['home'] = array('#theme' => 'link', '#text' => t('Home'), '#path' => '<front>', '#options' => array('attributes' => array(), 'html' => TRUE));
    $main_menu_output = menu_tree_output($main_menu_tree);
    array_unshift($main_menu_output, $link);
    $variables['primary_main_menu'] = render($main_menu_output);
}
开发者ID:picpen,项目名称:dentalevents,代码行数:9,代码来源:template.php


示例9: carpediem_process_page

/**
 * Display submenu on menu items.
 */
function carpediem_process_page(&$variables)
{
    // Array with the names of the menus
    $menu_names = array('menu-logopedie', 'menu-kinesitherapie');
    foreach ($menu_names as $menu_name) {
        $menu_tree = menu_tree_all_data($menu_name);
        $variables[$menu_name] = menu_tree_output($menu_tree);
    }
}
开发者ID:AnneliesVDWee,项目名称:drupal_carpediem,代码行数:12,代码来源:template.php


示例10: _bootstrap_book_children

/**
 * Formats the menu links for the child pages of the current page.
 *
 * @param array $book_link
 *   A fully loaded menu link that is part of the book hierarchy.
 *
 * @return string
 *   HTML for the links to the child pages of the current page.
 */
function _bootstrap_book_children($book_link)
{
    // Rebuild entire menu tree for the book.
    $tree = menu_build_tree($book_link['menu_name']);
    $tree = menu_tree_output($tree);
    // Fix the theme hook suggestions.
    _bootstrap_book_fix_theme_hooks($book_link['nid'], $tree);
    // Return the rendered output.
    return drupal_render($tree);
}
开发者ID:PixelGarage,项目名称:hso2,代码行数:19,代码来源:book-navigation.vars.php


示例11: spacelab_preprocess_page

/**
 * Preprocess variables for page template.
 */
function spacelab_preprocess_page(&$vars)
{
    // Get the entire main menu tree.
    $main_menu_tree = array();
    $main_menu_tree = menu_tree_all_data('main-menu', NULL, 2);
    // Add the rendered output to the $main_menu_expanded variable.
    $vars['main_menu_expanded'] = menu_tree_output($main_menu_tree);
    // Always print the site name and slogan, but if they are toggled off, we'll
    // just hide them visually.
    $vars['hide_site_name'] = theme_get_setting('toggle_name') ? FALSE : TRUE;
    $vars['hide_site_slogan'] = theme_get_setting('toggle_slogan') ? FALSE : TRUE;
    if ($vars['hide_site_name']) {
        // If toggle_name is FALSE, the site_name will be empty, so we rebuild it.
        $vars['site_name'] = filter_xss_admin(variable_get('site_name', 'Drupal'));
    }
    if ($vars['hide_site_slogan']) {
        // If toggle_site_slogan is FALSE, the site_slogan will be empty,
        // so we rebuild it.
        $vars['site_slogan'] = filter_xss_admin(variable_get('site_slogan', ''));
    }
    // Since the title and the shortcut link are both block level elements,
    // positioning them next to each other is much simpler with a wrapper div.
    if (!empty($vars['title_suffix']['add_or_remove_shortcut']) && $vars['title']) {
        // Add a wrapper div using title_prefix and title_suffix render elements.
        $vars['title_prefix']['shortcut_wrapper'] = array('#markup' => '<div class="shortcut-wrapper clearfix">', '#weight' => 100);
        $vars['title_suffix']['shortcut_wrapper'] = array('#markup' => '</div>', '#weight' => -99);
        // Make sure the shortcut link is the first item in title_suffix.
        $vars['title_suffix']['add_or_remove_shortcut']['#weight'] = -100;
    }
    // If panels arent being used at all.
    $vars['no_panels'] = !(module_exists('page_manager') && page_manager_get_current_page());
    // Check if we're to always print the page title, even on panelized pages.
    $vars['always_show_page_title'] = theme_get_setting('always_show_page_title') ? TRUE : FALSE;
    /**
     * insert variables into page template.
     */
    if ($vars['page']['sidebar_first'] && $vars['page']['sidebar_second']) {
        $vars['sidebar_grid_class'] = 'col-md-3';
        $vars['main_grid_class'] = 'col-md-6';
    } elseif ($vars['page']['sidebar_first'] || $vars['page']['sidebar_second']) {
        $vars['sidebar_grid_class'] = 'col-md-3';
        $vars['main_grid_class'] = 'col-md-9';
    } else {
        $vars['main_grid_class'] = 'col-md-12';
    }
    if ($vars['page']['header_top_left'] && $vars['page']['header_top_right']) {
        $vars['header_top_left_grid_class'] = 'col-md-8';
        $vars['header_top_right_grid_class'] = 'col-md-4';
    } elseif ($vars['page']['header_top_right'] || $vars['page']['header_top_left']) {
        $vars['header_top_left_grid_class'] = 'col-md-12';
        $vars['header_top_right_grid_class'] = 'col-md-12';
    }
}
开发者ID:creazy412,项目名称:vmware-win10-c65-drupal7,代码行数:56,代码来源:template.php


示例12: 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


示例13: spartan_preprocess_region

/**
 * Implements hook_preprocess_region().
 */
function spartan_preprocess_region(&$vars)
{
    global $language;
    switch ($vars['region']) {
        // Menu region.
        case 'menu':
            $footer_menu_cache = cache_get("footer_menu_data:" . $language->language);
            if ($footer_menu_cache) {
                $footer_menu = $footer_menu_cache->data;
            } else {
                $footer_menu = menu_tree_output(_spartan_menu_build_tree('main-menu', array('max_depth' => 2)));
                cache_set("footer_menu_data:" . $language->language, $footer_menu);
            }
            //set the active trail
            $active_trail = menu_get_active_trail();
            foreach ($active_trail as $trail) {
                if (isset($trail['mlid']) && isset($footer_menu[$trail['mlid']])) {
                    $footer_menu[$trail['mlid']]['#attributes']['class'][] = 'active-trail';
                }
            }
            $vars['dropdown_menu'] = $footer_menu;
            break;
            // Default footer content.
        // Default footer content.
        case 'footer_first':
            $footer_menu_cache = cache_get("footer_menu_data:" . $language->language);
            if ($footer_menu_cache) {
                $footer_menu = $footer_menu_cache->data;
            } else {
                $footer_menu = menu_tree_output(_spartan_menu_build_tree('main-menu', array('max_depth' => 2)));
                cache_set("footer_menu_data:" . $language->language, $footer_menu);
            }
            //set the active trail
            $active_trail = menu_get_active_trail();
            foreach ($active_trail as $trail) {
                if (isset($trail['mlid']) && isset($footer_menu[$trail['mlid']])) {
                    $footer_menu[$trail['mlid']]['#attributes']['class'][] = 'active-trail';
                }
            }
            $vars['footer_menu'] = $footer_menu;
            $vars['site_name'] = $site_name = variable_get('site_name');
            $vars['footer_logo'] = l(theme('image', array('path' => drupal_get_path('theme', 'spartan') . "/logo-sm.png", 'alt' => "{$site_name} logo")), '', array("html" => TRUE, 'attributes' => array('class' => 'logo')));
            if (function_exists('defaultcontent_get_node') && ($node = defaultcontent_get_node("email_update"))) {
                $node = node_view($node);
                $vars['subscribe_form'] = $node['webform'];
            }
            //krumo($vars['footer_menu']);
            break;
    }
}
开发者ID:jeffanthony,项目名称:openpublic-drops-7,代码行数:53,代码来源:template.php


示例14: innovation_preprocess_block

/**
 * Override or insert variables into the page template.
 *
 * Implements template_process_block().
 */
function innovation_preprocess_block(&$variables)
{
    $block = $variables['block'];
    if ($block->delta == 'main-menu' && $block->module == 'system' && $block->status == 1 && ($block->theme = 'innovation')) {
        // Get the entire main menu tree.
        $main_menu_tree = array();
        $main_menu_tree = menu_tree_all_data('main-menu', NULL, 2);
        // Add the rendered output to the $main_menu_expanded variable.
        //
        $main_menu_asu = menu_tree_output($main_menu_tree);
        $pri_attributes = array('class' => array('nav', 'navbar-nav', 'links', 'clearfix'));
        $variables['content'] = theme('links__system_main_menu', array('links' => $main_menu_asu, 'attributes' => $pri_attributes, 'heading' => array('text' => t('Main menu'), 'level' => 'h2', 'class' => array('element-invisible'))));
        $block->subject = '';
    }
}
开发者ID:sourfacedcyclop,项目名称:webspark-drops-drupal7,代码行数:20,代码来源:template.php


示例15: metroblocks_links__topbar_main_menu

/**
 * Implements theme_links() targeting the main menu specifically.
 * Formats links for Top Bar http://foundation.zurb.com/docs/components/top-bar.html
 */
function metroblocks_links__topbar_main_menu($variables)
{
    // We need to fetch the links ourselves because we need the entire tree.
    $links = menu_tree_output(menu_tree_all_data(variable_get('menu_main_links_source', 'main-menu')));
    $i = 1;
    foreach ($links as $key => $value) {
        if (is_numeric($key)) {
            $links[$key]['#attributes']['class'][] = 'color-' . $i;
            $i++;
        }
    }
    $output = _metroblocks_links($links);
    //$variables['attributes']['class'][] = 'right';
    return '<ul' . drupal_attributes($variables['attributes']) . '>' . $output . '</ul>';
}
开发者ID:Alexabr23,项目名称:bomberos120,代码行数:19,代码来源:template.php


示例16: bunsen_preprocess_page

function bunsen_preprocess_page(&$variables)
{
    drupal_add_library('system', 'ui.accordion');
    // Primary nav.
    $variables['primary_nav'] = FALSE;
    if ($variables['main_menu']) {
        // Build links.
        $variables['primary_nav'] = menu_tree_output(menu_tree_all_data(variable_get('menu_main_links_source', 'main-menu')));
        // Provide default theme wrapper function.
        $variables['primary_nav']['#theme_wrappers'] = array('menu_tree__primary');
    }
    if (drupal_is_front_page()) {
        $variables['content_column_class'] = 'col-lg-12 text-center';
    } else {
        $variables['content_column_class'] = 'col-lg-12 content-page';
    }
}
开发者ID:signaltrace-dev,项目名称:d7-theme-bunsen,代码行数:17,代码来源:page.vars.php


示例17: valghalla_bs_theme_navbarmenu

/**
 * Genereate navbar menu.
 */
function valghalla_bs_theme_navbarmenu($path)
{
    $parent = menu_link_get_preferred($path);
    $parameters = array('active_trail' => array($parent['plid']), 'only_active_trail' => FALSE, 'min_depth' => $parent['depth'] + 1, 'max_depth' => $parent['depth'] + 1, 'conditions' => array('plid' => $parent['mlid']));
    $children = menu_build_tree($parent['menu_name'], $parameters);
    $tree_output = menu_tree_output($children);
    $items = array();
    foreach ($tree_output as $item_id => $item_data) {
        if (is_numeric($item_id) && is_array($item_data)) {
            $items[] = l($item_data['#title'], $item_data['#href'], array('attributes' => $item_data['#attributes'], 'html' => TRUE));
        }
    }
    $menu = theme('item_list', array('items' => $items, 'type' => 'ul', 'attributes' => array('class' => 'dropdown-menu')));
    $toggle = '<a href="#" class="dropdown-toggle" data-toggle="dropdown">' . $parent['link_title'] . ' <b class="caret"></b></a>';
    if ($menu) {
        return $toggle . $menu;
    }
}
开发者ID:OS2Valghalla,项目名称:valghalla,代码行数:21,代码来源:template.php


示例18: open_framework_preprocess_page

function open_framework_preprocess_page(&$vars)
{
    // Add page template suggestions based on the aliased path. For instance, if the current page has an alias of about/history/early, we'll have templates of:
    // page-about-history-early.tpl.php, page-about-history.tpl.php, page-about.tpl.php
    // Whichever is found first is the one that will be used.
    if (module_exists('path')) {
        $alias = drupal_get_path_alias(str_replace('/edit', '', $_GET['q']));
        if ($alias != $_GET['q']) {
            $template_filename = 'page';
            foreach (explode('/', $alias) as $path_part) {
                $template_filename = $template_filename . '-' . $path_part;
                $vars['template_files'][] = $template_filename;
            }
        }
    }
    // Get the entire main menu tree
    $main_menu_tree = menu_tree_all_data('main-menu');
    // Add the rendered output to the $main_menu_expanded variables
    $vars['main_menu_expanded'] = menu_tree_output($main_menu_tree);
    // Primary nav
    $vars['primary_nav'] = FALSE;
    if ($vars['main_menu']) {
        // Build links
        $vars['primary_nav'] = menu_tree(variable_get('menu_main_links_source', 'main-menu'));
        // Provide default theme wrapper function
        $vars['primary_nav']['#theme_wrappers'] = array('menu_tree__primary');
    }
    // Secondary nav
    $vars['secondary_nav'] = FALSE;
    if ($vars['secondary_menu']) {
        // Build links
        $vars['secondary_nav'] = menu_tree(variable_get('menu_secondary_links_source', 'user-menu'));
        // Provide default theme wrapper function
        $vars['secondary_nav']['#theme_wrappers'] = array('menu_tree__secondary');
    }
    // Checks if tabs are set
    if (!isset($vars['tabs']['#primary'])) {
        $vars['tabs']['#primary'] = FALSE;
    }
    // Replace tabs with drop down version
    $vars['tabs']['#primary'] = _bootstrap_local_tasks($vars['tabs']['#primary']);
    // Add variable for site title
    $vars['my_site_title'] = variable_get('site_name');
}
开发者ID:Sorekk,项目名称:cvillecouncilus,代码行数:44,代码来源:template.php


示例19: openomega_preprocess_region

/**
 * Implements hook_preprocess_region().
 */
function openomega_preprocess_region(&$vars)
{
    global $language;
    switch ($vars['region']) {
        // menu region
        case 'menu':
            $dropdown_menu = menu_tree_output(_openomega_menu_build_tree('main-menu', array('max_depth' => 2)));
            //set the active trail
            $active_trail = menu_get_active_trail();
            foreach ($active_trail as $trail) {
                if (isset($trail['mlid']) && isset($dropdown_menu[$trail['mlid']])) {
                    $dropdown_menu[$trail['mlid']]['#attributes']['class'][] = 'active-trail';
                }
            }
            // Set the tab index for those with drop downs so can access the links.
            foreach ($dropdown_menu as $key => $item) {
                if (!empty($dropdown_menu[$key]['#below'])) {
                    $dropdown_menu[$key]['#attributes']['tabindex'] = 0;
                }
            }
            $vars['dropdown_menu'] = $dropdown_menu;
            break;
            // default footer content
        // default footer content
        case 'footer_first':
            $footer_menu = menu_tree_output(_openomega_menu_build_tree('main-menu', array('max_depth' => 2)));
            //set the active trail
            $active_trail = menu_get_active_trail();
            foreach ($active_trail as $trail) {
                if (isset($trail['mlid']) && isset($footer_menu[$trail['mlid']])) {
                    $footer_menu[$trail['mlid']]['#attributes']['class'][] = 'active-trail';
                }
            }
            $vars['footer_menu'] = $footer_menu;
            $vars['site_name'] = $site_name = variable_get('site_name');
            $vars['footer_logo'] = l(theme('image', array('path' => drupal_get_path('theme', 'openomega') . "/logo-sm.png", 'alt' => "{$site_name} logo")), '', array("html" => TRUE, 'attributes' => array('class' => 'logo')));
            if (function_exists('defaultcontent_get_node') && ($node = defaultcontent_get_node("email_update"))) {
                $node = node_view($node);
                $vars['subscribe_form'] = $node['webform'];
            }
            break;
    }
}
开发者ID:jeffanthony,项目名称:openpublic-drops-7,代码行数:46,代码来源:template.php


示例20: sizzle_preprocess_page

/**
 * Implements template_preprocess_page().
 */
function sizzle_preprocess_page(&$variables)
{
    $theme_path = drupal_get_path('theme', 'sizzle');
    // Add a menu link.
    $variables['menu_link'] = l(t('The Menu'), 'menus', array('attributes' => array('class' => array('btn'))));
    // Add a reservation link.
    $variables['reservation_link'] = '';
    if (module_exists('restaurant_reservation')) {
        $variables['reservation_link'] = l(t('Book a Table'), 'reservation', array('attributes' => array('class' => array('btn'))));
    }
    // Add the footer menu to the template.
    $show_footer_nav = theme_get_setting('show_footer_nav');
    if ($show_footer_nav) {
        $footer_nav_data = menu_build_tree('menu-footer-menu', array('min_depth' => 1, 'max_depth' => 2));
        $variables['footer_nav'] = menu_tree_output($footer_nav_data);
        $variables['footer_nav']['#theme_wrappers'] = array();
    }
    // Add the site background image.
    if ($site_background_image_fid = theme_get_setting('site_background_image')) {
        $site_background_image = file_load($site_background_image_fid);
        $site_background_image_url = file_create_url($site_background_image->uri);
        drupal_add_css('body { background-image: url("' . $site_background_image_url . '") }', array('type' => 'inline'));
    }
    // Add the footer background image.
    if ($footer_background_image_fid = theme_get_setting('footer_background_image')) {
        $footer_background_image = file_load($footer_background_image_fid);
        $footer_background_image_url = file_create_url($footer_background_image->uri);
    } else {
        $footer_background_image_url = '/' . $theme_path . '/assets/images/bg/bg-footer-default.jpg';
    }
    drupal_add_css('.footer { background-image: url("' . $footer_background_image_url . '") }', array('type' => 'inline'));
    // Add copyright to theme.
    $copyright = theme_get_setting('copyright');
    $variables['copyright'] = check_markup($copyright['value'], $copyright['format']);
    // Add footer text.
    $footer_text = theme_get_setting('footer_text');
    $variables['footer_text'] = check_markup($footer_text['value'], $footer_text['format']);
    $variables['address'] = panopoly_config_get('address');
    $variables['phone'] = panopoly_config_get('phone');
    $variables['opening_hours'] = panopoly_config_get('opening_hours');
}
开发者ID:shinjanidhar,项目名称:book-your-show,代码行数:44,代码来源:template.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP menu_url函数代码示例发布时间:2022-05-15
下一篇:
PHP menu_tree_all_data函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap