Index: nice_menus.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/nice_menus/nice_menus.module,v retrieving revision 1.48 diff -u -p -r1.48 nice_menus.module --- nice_menus.module 11 Jul 2008 15:27:38 -0000 1.48 +++ nice_menus.module 6 Aug 2008 12:45:46 -0000 @@ -194,7 +194,7 @@ function nice_menus_theme() { 'arguments' => array('menu_name' => NULL, 'mlid' => NULL, 'menu' => NULL), ), 'nice_menu_build' => array( - 'arguments' => array('menu' => NULL), + 'arguments' => array('menu' => NULL, 'menu_name' => NULL), ), 'nice_menu' => array( 'arguments' => array('id' => NULL, 'menu_name' => NULL, 'mlid' => NULL, 'direction' => 'right', 'menu' => NULL), @@ -283,7 +283,7 @@ function theme_nice_menu_tree($menu_name $output['subject'] = $title; if ($menu) { - $output['content'] .= theme('nice_menu_build', $menu); + $output['content'] .= theme('nice_menu_build', $menu, $menu_name); } return $output; @@ -295,8 +295,15 @@ function theme_nice_menu_tree($menu_name * @param $menu * Menu array from which to build the nested lists. */ -function theme_nice_menu_build($menu) { +function theme_nice_menu_build($menu, $menu_name) { $output = ''; + + // Find the active trail and pull out the menus ids. + $active_menu = menu_set_active_menu_name($menu_name); + $trail = menu_get_active_trail($active_menu); + foreach ($trail as $item) { + $trail_ids[] = $item['mlid']; + } foreach ($menu as $menu_item) { $mlid = $menu_item['link']['mlid']; @@ -308,14 +315,17 @@ function theme_nice_menu_build($menu) { $clean_path = str_replace(array('http://', '<', '>', '&', '=', '?', ':'), '', $menu_item['link']['href']); // Convert slashes to dashes. $clean_path = str_replace('/', '-', $clean_path); - $path_class = 'menu-path-'. $clean_path; + $class = 'menu-path-'. $clean_path; // If it has children build a nice little tree under it. if ((!empty($menu_item['link']['has_children'])) && (!empty($menu_item['below']))) { // Keep passing children into the function 'til we get them all. $children = theme('nice_menu_build', $menu_item['below']); // Set the class to parent only of children are displayed. - $parent_class = $children ? 'menuparent ' : ''; - $output .= '