diff options
author | Sem <sembrestels@riseup.net> | 2011-11-18 07:32:27 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2011-11-18 07:32:27 +0100 |
commit | e53d410129701ea1c9d19529afa493f11b5f5b70 (patch) | |
tree | d9963b24bf8932654b4a47e36602c75975e50dba /engine/classes/ElggMenuItem.php | |
parent | 377da25d2965c64941f83baae119fc970ec60982 (diff) | |
parent | 08a962c98e2923724f8013d6eaae89101243752a (diff) | |
download | elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.gz elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.bz2 |
Merge github.com:Elgg/Elgg
Conflicts:
engine/lib/input.php
Diffstat (limited to 'engine/classes/ElggMenuItem.php')
-rw-r--r-- | engine/classes/ElggMenuItem.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php index f7a6b5c65..62547134a 100644 --- a/engine/classes/ElggMenuItem.php +++ b/engine/classes/ElggMenuItem.php @@ -100,6 +100,9 @@ class ElggMenuItem { if (!isset($options['name']) || !isset($options['text'])) { return NULL; } + if (!isset($options['href'])) { + $options['href'] = ''; + } $item = new ElggMenuItem($options['name'], $options['text'], $options['href']); unset($options['name']); @@ -412,6 +415,7 @@ class ElggMenuItem { * * @param int $priority The smaller numbers mean higher priority (1 before 100) * @return void + * @deprecated */ public function setWeight($priority) { $this->data['priority'] = $priority; @@ -421,12 +425,32 @@ class ElggMenuItem { * Get the priority of the menu item * * @return int + * @deprecated */ public function getWeight() { return $this->data['priority']; } /** + * Set the priority of the menu item + * + * @param int $priority The smaller numbers mean higher priority (1 before 100) + * @return void + */ + public function setPriority($priority) { + $this->data['priority'] = $priority; + } + + /** + * Get the priority of the menu item + * + * @return int + */ + public function getPriority() { + return $this->data['priority']; + } + + /** * Set the section identifier * * @param string $section The identifier of the section @@ -543,12 +567,16 @@ class ElggMenuItem { if ($this->data['linkClass']) { if (isset($vars['class'])) { - $vars['class'] += $this->getLinkClass(); + $vars['class'] = $vars['class'] . ' ' . $this->getLinkClass(); } else { $vars['class'] = $this->getLinkClass(); } } + if (!isset($vars['rel']) && !isset($vars['is_trusted'])) { + $vars['is_trusted'] = true; + } + if ($this->confirm) { $vars['confirm'] = $this->confirm; return elgg_view('output/confirmlink', $vars); |