diff --git a/nice_menus.module b/nice_menus.module index a536488..0df6b04 100644 --- a/nice_menus.module +++ b/nice_menus.module @@ -399,9 +399,21 @@ function theme_nice_menus_tree($menu_name, $mlid = NULL, $depth = -1, $menu = NU */ function theme_nice_menus_build($menu, $depth = -1, $trail = NULL) { $output = ''; + $index = 0; + $count = 0; + foreach ($menu as $menu_count) { + if ($menu_count['link']['hidden'] == 0) { + $count++; + } + } foreach ($menu as $menu_item) { $mlid = $menu_item['link']['mlid']; // Check to see if it is a visible menu item. + //prepare marking of li tag as odd, even, first or last + $index++; + $first_class = $index == 1 ? ' first ' : ''; + $oddeven_class = $index % 2 == 0 ? ' even ' : ' odd '; + $last_class = $index == $count ? ' last ' : ''; if ($menu_item['link']['hidden'] == 0) { // Build class name based on menu path // e.g. to give each menu item individual style. @@ -419,7 +431,7 @@ function theme_nice_menus_build($menu, $depth = -1, $trail = NULL) { $children = theme('nice_menus_build', $menu_item['below'], $depth, $trail); // Set the class to parent only of children are displayed. $parent_class = $children ? 'menuparent ' : ''; - $output .= '\n"; } else { - $output .= ''."\n"; + $output .= ''."\n"; } } }