Add current class to selected menu items

This commit is contained in:
Zach Copley 2011-06-09 19:29:19 -04:00
parent 1f1616223a
commit e1ac64f2cb

View File

@ -1351,13 +1351,16 @@ class Action extends HTMLOutputter // lawsuit
{
// Added @id to li for some control.
// XXX: We might want to move this to htmloutputter.php
$lattrs = array();
$lattrs = array();
$classes = array();
if ($class !== null) {
$lattrs['class'] = $class;
if ($is_selected) {
$lattrs['class'] = trim('current ' . $lattrs['class']);
}
$classes[] = trim($class);
}
if ($is_selected) {
$classes[] = 'current';
}
$lattrs['class'] = implode(' ', $classes);
(is_null($id)) ? $lattrs : $lattrs['id'] = $id;