--- menu_block.module.orig 2009-06-23 11:05:35.000000000 +0200 +++ menu_block.module 2009-06-23 12:13:46.000000000 +0200 @@ -60,6 +60,9 @@ 'template' => 'menu-block-wrapper', 'arguments' => array('content' => NULL, 'settings' => NULL), ), + 'menu_block_menu' => array( + /** @TODO */ + ), ); } @@ -442,8 +445,17 @@ } } + $output = theme('menu_block_menu', $items); + + return $output ? theme('menu_tree', $output) : ''; +} + +function theme_menu_block_menu($items) { + $output = ''; + $num_items = count($items); $i = 1; + foreach (array_keys($items) as $key) { // Render the link. $link_class = array(); @@ -457,6 +469,7 @@ $items[$key]['link']['localized_options']['attributes']['class'] = implode(' ', $link_class); } $link = theme('menu_item_link', $items[$key]['link']); + // Render the menu item. $extra_class = array(); if ($i == 1) { @@ -465,6 +478,7 @@ if ($i == $num_items) { $extra_class[] = 'last'; } + $extra_class[] = 'child-'.$i; $extra_class[] = 'menu-mlid-' . $items[$key]['link']['mlid']; if (!empty($items[$key]['link']['leaf_has_children'])) { $extra_class[] = 'has-children'; @@ -474,7 +488,9 @@ } $extra_class = !empty($extra_class) ? implode(' ', $extra_class) : NULL; $output .= theme('menu_item', $link, $items[$key]['link']['has_children'], $items[$key]['below'], $items[$key]['link']['in_active_trail'], $extra_class); + $i++; } - return $output ? theme('menu_tree', $output) : ''; + + return $output; }