diff U3 drupal_6_5/includes/menu.inc wgu/includes/menu.inc --- drupal_6_5/includes/menu.inc Wed Oct 08 06:33:56 2008 +++ wgu/includes/menu.inc Tue Oct 14 08:07:32 2008 @@ -727,7 +727,7 @@ * @return * The rendered HTML of that data structure. */ -function menu_tree_output($tree) { +function menu_tree_output($tree, $level=0) { $output = ''; $items = array(); @@ -750,13 +750,13 @@ } $link = theme('menu_item_link', $data['link']); if ($data['below']) { - $output .= theme('menu_item', $link, $data['link']['has_children'], menu_tree_output($data['below']), $data['link']['in_active_trail'], $extra_class); + $output .= theme('menu_item', $link, $data['link']['has_children'], menu_tree_output($data['below'], $level+1), $data['link']['in_active_trail'], $extra_class, $level); } else { - $output .= theme('menu_item', $link, $data['link']['has_children'], '', $data['link']['in_active_trail'], $extra_class); + $output .= theme('menu_item', $link, $data['link']['has_children'], '', $data['link']['in_active_trail'], $extra_class, $level); } } - return $output ? theme('menu_tree', $output) : ''; + return $output ? theme('menu_tree', $output, $level) : ''; } /** @@ -1118,8 +1118,8 @@ * * @ingroup themeable */ -function theme_menu_tree($tree) { - return ''; +function theme_menu_tree($tree, $level=0) { + return ''; } /** @@ -1127,7 +1127,7 @@ * * @ingroup themeable */ -function theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) { +function theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL, $level=0) { $class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf')); if (!empty($extra_class)) { $class .= ' '. $extra_class; @@ -1135,6 +1135,9 @@ if ($in_active_trail) { $class .= ' active-trail'; } + if (is_int($level)) { + $class .= " level-$level"; + } return '
  • '. $link . $menu ."
  • \n"; }