aboutsummaryrefslogtreecommitdiff
path: root/engine/classes
diff options
context:
space:
mode:
Diffstat (limited to 'engine/classes')
-rw-r--r--engine/classes/ElggMenuItem.php9
1 files changed, 8 insertions, 1 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;