forked from GNUsocial/gnu-social
Add current class to selected menu items
This commit is contained in:
parent
1f1616223a
commit
e1ac64f2cb
@ -1352,13 +1352,16 @@ class Action extends HTMLOutputter // lawsuit
|
|||||||
// Added @id to li for some control.
|
// Added @id to li for some control.
|
||||||
// XXX: We might want to move this to htmloutputter.php
|
// XXX: We might want to move this to htmloutputter.php
|
||||||
$lattrs = array();
|
$lattrs = array();
|
||||||
|
$classes = array();
|
||||||
if ($class !== null) {
|
if ($class !== null) {
|
||||||
$lattrs['class'] = $class;
|
$classes[] = trim($class);
|
||||||
|
}
|
||||||
if ($is_selected) {
|
if ($is_selected) {
|
||||||
$lattrs['class'] = trim('current ' . $lattrs['class']);
|
$classes[] = 'current';
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$lattrs['class'] = implode(' ', $classes);
|
||||||
|
|
||||||
(is_null($id)) ? $lattrs : $lattrs['id'] = $id;
|
(is_null($id)) ? $lattrs : $lattrs['id'] = $id;
|
||||||
|
|
||||||
$this->elementStart('li', $lattrs);
|
$this->elementStart('li', $lattrs);
|
||||||
|
Loading…
Reference in New Issue
Block a user