Index: site_map.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/site_map/site_map.module,v retrieving revision 1.39.2.17 diff -u -r1.39.2.17 site_map.module --- site_map.module 21 Aug 2009 06:58:49 -0000 1.39.2.17 +++ site_map.module 15 Sep 2009 22:47:01 -0000 @@ -39,6 +39,9 @@ 'site_map_feed_icon' => array( 'arguments' => array('url' => NULL, 'type' => 'node'), ), + 'site_map_menu_tree' => array( + 'arguments' => array(), + ), ); } @@ -332,7 +335,7 @@ $tree = menu_tree_all_data($node->book['menu_name'], $node->book); $data = array_shift($tree); $output .= theme('book_title_link', $data['link']); - $output .= ($data['below']) ? menu_tree_output($data['below']) : ''; + $output .= ($data['below']) ? _site_map_menu_tree_output($data['below']) : ''; } if ($output) { @@ -365,7 +368,7 @@ if (module_exists('i18nmenu')) { i18nmenu_localize_tree($tree); } - $menu_display = menu_tree_output($tree); + $menu_display = _site_map_menu_tree_output($tree); if (!empty($menu_display)) { $title = $menu['title']; $output .= theme('site_map_box', $title, $menu_display, 'sitemap-menu'); @@ -534,3 +537,47 @@ return $message; } + +/** + * This is a clone of the core core _site_map_menu_tree_output() function + * with the exception of theme('sitemap_menu_tree') for styling reasons. + */ +function _site_map_menu_tree_output($tree) { + $output = ''; + $items = array(); + + // Pull out just the menu items we are going to render so that we + // get an accurate count for the first/last classes. + foreach ($tree as $data) { + if (!$data['link']['hidden']) { + $items[] = $data; + } + } + + $num_items = count($items); + foreach ($items as $i => $data) { + $extra_class = NULL; + if ($i == 0) { + $extra_class = 'first'; + } + if ($i == $num_items - 1) { + $extra_class = 'last'; + } + $link = theme('menu_item_link', $data['link']); + if ($data['below']) { + $output .= theme('menu_item', $link, $data['link']['has_children'], _site_map_menu_tree_output($data['below']), $data['link']['in_active_trail'], $extra_class); + } + else { + $output .= theme('menu_item', $link, $data['link']['has_children'], '', $data['link']['in_active_trail'], $extra_class); + } + } + return $output ? theme('site_map_menu_tree', $output) : ''; +} + +/** + * This is a clone of the core theme_menu_tree() function with the exception of + * the class name used in the UL. + */ +function theme_site_map_menu_tree($tree) { + return ''; +}