aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggMenuItem.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-29 13:36:33 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-29 13:36:33 +0000
commit6412a94c3c21ce163c68546e33bdeb9c8650e9f9 (patch)
treed361d0c268a8b6342f8f522b499e9aac5121359b /engine/classes/ElggMenuItem.php
parent8f7a86ebae5f6fd3f64f976a83cfc6712e083c2a (diff)
downloadelgg-6412a94c3c21ce163c68546e33bdeb9c8650e9f9.tar.gz
elgg-6412a94c3c21ce163c68546e33bdeb9c8650e9f9.tar.bz2
page menu using the new menu system - admin menu updated
git-svn-id: http://code.elgg.org/elgg/trunk@7738 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes/ElggMenuItem.php')
-rw-r--r--engine/classes/ElggMenuItem.php12
1 files changed, 8 insertions, 4 deletions
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);
}