From e1ac64f2cb7c0209133cb68859ef4275c4377b02 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 9 Jun 2011 19:29:19 -0400 Subject: [PATCH] Add current class to selected menu items --- lib/action.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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); -- 2.39.5