From: Zach Copley Date: Thu, 9 Jun 2011 23:29:19 +0000 (-0400) Subject: Add current class to selected menu items X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e1ac64f2cb7c0209133cb68859ef4275c4377b02;p=quix0rs-gnu-social.git Add current class to selected menu items --- diff --git a/lib/action.php b/lib/action.php index 920bbf31b9..21e5f78db1 100644 --- a/lib/action.php +++ b/lib/action.php @@ -1351,14 +1351,17 @@ 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; $this->elementStart('li', $lattrs);