diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-24 01:59:43 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-24 01:59:43 +0000 |
commit | e1a7ad6b5e21f23fef6824ab08d65366ec701d47 (patch) | |
tree | aeb6a63d1db2cd3fb73c59f0a97d654d219cb8b1 | |
parent | ca2d3d64b45e5e69843a090e5e7da3b3ac19f3ac (diff) | |
download | elgg-e1a7ad6b5e21f23fef6824ab08d65366ec701d47.tar.gz elgg-e1a7ad6b5e21f23fef6824ab08d65366ec701d47.tar.bz2 |
finished the implementation of non-links in menu system
git-svn-id: http://code.elgg.org/elgg/trunk@8458 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/classes/ElggMenuItem.php | 9 | ||||
-rw-r--r-- | views/default/navigation/menu/elements/item.php | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php index 58c26aa22..b5b7f2f81 100644 --- a/engine/classes/ElggMenuItem.php +++ b/engine/classes/ElggMenuItem.php @@ -78,13 +78,15 @@ class ElggMenuItem { * * @param string $name Identifier of the menu item * @param string $text Display text of the menu item - * @param string $href URL of the menu item + * @param string $href URL of the menu item (false if not a link) */ public function __construct($name, $text, $href) { $this->name = $name; $this->text = $text; if ($href) { $this->href = elgg_normalize_url($href); + } else { + $this->href = $href; } } @@ -408,6 +410,11 @@ class ElggMenuItem { * @return string */ public function getContent(array $vars = array()) { + + if ($this->href == false) { + return $this->text; + } + $vars['text'] = $this->text; if ($this->href) { $vars['href'] = $this->href; diff --git a/views/default/navigation/menu/elements/item.php b/views/default/navigation/menu/elements/item.php index d1d721c63..e11b01bbf 100644 --- a/views/default/navigation/menu/elements/item.php +++ b/views/default/navigation/menu/elements/item.php @@ -26,7 +26,7 @@ if ($item_class) { } echo "<li $class>"; -echo $item->getContent($link_vars); +echo $item->getContent(); if ($children) { echo elgg_view('navigation/menu/elements/group', array( 'items' => $children, |