This gets pretty tiresome:
$first_class = $index == 1 ? ' first ' : '';
$oddeven_class = $index % 2 == 0 ? ' even ' : ' odd ';
$last_class = $index == $count ? ' last ' : '';
Better to leave off the spaces either side and just implode with a space.
For that matter, there's not really a need to name all these -- they are only used again when making the LI.
So this would do:
$classes[] = $index % 2 == 0 ? 'even' : 'odd';
// etc
Not making a patch yet, as would clash with #508690: level-based classes for drop-down menus.
Comments
Comment #1
Naiya commentedI'm looking forward the stable version with patch. When it will be composed :)
I also had a problem with these spaces and W3C as You can see here #1040750: W3C Validation - There should not be any white space at the start or end of an attribute's value
I also found this example in documentation: http://drupal.org/node/561158 maybe it will be helpfull
Comment #2
astonvictor commentedI'm closing it because the issue was created a long time ago without any further steps.
if you still need it then raise a new one.
thanks