Esempio n. 1
0
/**
* Implementation of theme_menu_item().
*
* Add active class to current menu item links.
*/
function phptemplate_menu_item($mid, $children = '', $leaf = TRUE)
{
    $item = menu_get_item($mid);
    // get current menu item
    $class = 'menu-' . str_replace(' ', '-', strtolower(str_replace('?', '', $item['title'])));
    $active_class = in_array($mid, _menu_get_active_trail()) ? ' active-trail' : '';
    // decide whether to add the active class to this menu item
    if (drupal_get_normal_path($item['path']) == $_GET['q'] || drupal_is_front_page() && $item['path'] == '<front>' || in_array($mid, _menu_get_active_trail())) {
        $active_class = ' active';
        // set active class
    } else {
        // otherwise...
        $active_class = '';
        // do nothing
    }
    return '<li class="' . ($leaf ? 'leaf' : ($children ? 'expanded' : 'collapsed')) . $active_class . ' ' . $class . '">' . menu_item_link($mid) . $children . "</li>\n";
}
Esempio n. 2
0
include 'user-login-bar.tpl.php';
?>
		
	</div>
	
	<div id="wrapper-1">
		
		<?php 
print $header;
?>
		
		<?php 
if ($at_forum) {
    $menu_root = 64;
} else {
    $menu_trail = _menu_get_active_trail();
    $menu_root = $menu_trail[1];
}
$menu_root_title = menu_get_item($menu_root);
// Let's see if we're at a blog term page
$at_blog_term = false;
if (arg(0) == 'taxonomy') {
    $this_term = taxonomy_get_term(arg(2));
    if ($this_term->vid == 2) {
        $at_blog_term = true;
    }
}
?>
		
		<?php 
if ($menu_trail[1] == 62) {