]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Add setHref() method to ElggMenuItem class. Fixes #3486.
authorFranz Liedke <franz@develophp.org>
Mon, 20 Jun 2011 13:24:53 +0000 (15:24 +0200)
committerFranz Liedke <franz@develophp.org>
Mon, 20 Jun 2011 13:24:53 +0000 (15:24 +0200)
engine/classes/ElggMenuItem.php

index 157ed9ceb503098a6e6e4b206dc0f2991b9dd3c1..d76518be23055e0d50b28ac04ac56ff51786802c 100644 (file)
@@ -132,7 +132,7 @@ class ElggMenuItem {
                        $item->setItemClass($options['item_class']);
                        unset($options['item_class']);
                }
-               
+
                foreach ($options as $key => $value) {
                        $item->$key = $value;
                }
@@ -163,6 +163,15 @@ class ElggMenuItem {
                return $this->text;
        }
 
+       /**
+        * Set the URL of the menu item
+        *
+        * @return void
+        */
+       public function setHref($href) {
+               $this->href = $href;
+       }
+
        /**
         * Get the URL of the menu item
         *
@@ -465,7 +474,7 @@ class ElggMenuItem {
         * @params array $vars Options to pass to output/url if a link
         *
         * @return string
-        * 
+        *
         * @todo View code in a model.  How do we feel about that?
         */
        public function getContent(array $vars = array()) {
@@ -475,7 +484,7 @@ class ElggMenuItem {
                }
 
                $vars['text'] = $this->text;
-               
+
                if ($this->href) {
                        $vars['href'] = $this->href;
                }
@@ -483,15 +492,15 @@ class ElggMenuItem {
                if ($this->linkClass) {
                        $vars['class'] = $this->getLinkClass();
                }
-               
+
                if ($this->rel) {
                        $vars['rel'] = $this->rel;
                }
-                               
+
                if ($this->title) {
                        $vars['title'] = $this->title;
                }
-               
+
                if ($this->is_action) {
                        $vars['is_action'] = $this->is_action;
                }