]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
finished the implementation of non-links in menu system
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 24 Feb 2011 01:59:43 +0000 (01:59 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 24 Feb 2011 01:59:43 +0000 (01:59 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8458 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggMenuItem.php
views/default/navigation/menu/elements/item.php

index 58c26aa22a22881ec417ac8547c8e76a1b03a1c1..b5b7f2f81415b2104a1f7c9febacaf2cbba3f234 100644 (file)
@@ -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;
index d1d721c63081057d41dd5245020d119f5ef2e5bc..e11b01bbfeb95df3a88d939cce4ed70a5f9d4411 100644 (file)
@@ -26,7 +26,7 @@ if ($item_class) {
 }
 
 echo "<li $class>";
-echo $item->getContent($link_vars);
+echo $item->getContent();
 if ($children) {
        echo elgg_view('navigation/menu/elements/group', array(
                'items' => $children,