aboutsummaryrefslogtreecommitdiff
path: root/engine/classes
diff options
context:
space:
mode:
Diffstat (limited to 'engine/classes')
-rw-r--r--engine/classes/ElggMenuBuilder.php2
-rw-r--r--engine/classes/ElggMenuItem.php12
2 files changed, 9 insertions, 5 deletions
diff --git a/engine/classes/ElggMenuBuilder.php b/engine/classes/ElggMenuBuilder.php
index 3528eaef8..f51ec8c62 100644
--- a/engine/classes/ElggMenuBuilder.php
+++ b/engine/classes/ElggMenuBuilder.php
@@ -32,7 +32,7 @@ class ElggMenuBuilder {
$this->selectFromContext();
- $selected = $this->findSelected();
+ $this->selected = $this->findSelected();
$this->setupSections();
diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php
index 2205ebc89..40df8f182 100644
--- a/engine/classes/ElggMenuItem.php
+++ b/engine/classes/ElggMenuItem.php
@@ -21,7 +21,7 @@ class ElggMenuItem {
/**
* @var string The menu url
*/
- protected $url;
+ protected $url = null;
/**
* @var array Page context array
@@ -68,7 +68,9 @@ class ElggMenuItem {
public function __construct($name, $title, $url) {
$this->name = $name;
$this->title = $title;
- $this->url = elgg_normalize_url($url);
+ if ($url) {
+ $this->url = elgg_normalize_url($url);
+ }
}
/**
@@ -82,7 +84,7 @@ class ElggMenuItem {
* @return ElggMenuItem or NULL on error
*/
public static function factory($options) {
- if (!isset($options['name']) || !isset($options['title']) || !isset($options['url'])) {
+ if (!isset($options['name']) || !isset($options['title'])) {
return NULL;
}
@@ -323,8 +325,10 @@ class ElggMenuItem {
* @return string
*/
public function getLink(array $vars = array()) {
- $vars['href'] = $this->url;
$vars['text'] = $this->title;
+ if ($this->url) {
+ $vars['href'] = $this->url;
+ }
return elgg_view('output/url', $vars);
}