diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-06-13 01:46:50 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-06-13 01:46:50 +0000 |
commit | a420910a8b782bae53fbd7f86102db9f9b831388 (patch) | |
tree | bb9112be62f330dbcbbcdea6de6c891fe9f6742a /engine | |
parent | d5a957f871c9d0f82732d77b2ca425ed37a57ecc (diff) | |
download | elgg-a420910a8b782bae53fbd7f86102db9f9b831388.tar.gz elgg-a420910a8b782bae53fbd7f86102db9f9b831388.tar.bz2 |
Fixes #3282 always using a menu item's name in its class
git-svn-id: http://code.elgg.org/elgg/trunk@9200 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r-- | engine/classes/ElggMenuItem.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php index caaba49a1..157ed9ceb 100644 --- a/engine/classes/ElggMenuItem.php +++ b/engine/classes/ElggMenuItem.php @@ -325,7 +325,16 @@ class ElggMenuItem { * @return string */ public function getItemClass() { - return implode(' ', $this->itemClass); + //allow people to specify name with underscores and colons + $name = str_replace('_', '-', $this->getName()); + $name = str_replace(':', '-', $name); + + $class = implode(' ', $this->itemClass); + if ($class) { + return "elgg-menu-item-$name $class"; + } else { + return "elgg-menu-item-$name"; + } } /** |