]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
show remote groups correctly in groupsnav
authorEvan Prodromou <evan@status.net>
Sun, 18 Sep 2011 23:28:56 +0000 (19:28 -0400)
committerEvan Prodromou <evan@status.net>
Sun, 18 Sep 2011 23:28:56 +0000 (19:28 -0400)
lib/groupsnav.php

index 3d282f5e1d88aa1b10d968ae1b70ea31f4b7a0cd..8439ab63992616d466de2c3ff8fca8be59efd1bb 100644 (file)
@@ -71,8 +71,9 @@ class GroupsNav extends MoreMenu
         $items = array();
 
         while ($this->groups->fetch()) {
-            $items[] = array('showgroup',
-                             array('nickname' => $this->groups->nickname),
+            $items[] = array('placeholder',
+                             array('nickname' => $this->groups->nickname,
+                                   'mainpage' => $this->groups->homeUrl()),
                              $this->groups->getBestName(),
                              $this->groups->getBestName()
                             );
@@ -90,4 +91,23 @@ class GroupsNav extends MoreMenu
                      _('See all groups you belong to.'));
     }
 
+    function item($actionName, $args, $label, $description, $id=null, $cls=null)
+    {
+        if ($actionName != 'placeholder') {
+            return parent::item($actionName, $args, $label, $description, $id, $cls);
+        }
+
+        if (empty($id)) {
+            $id = $this->menuItemID('showgroup', array('nickname' => $args['nickname']));
+        }
+
+        $url = $args['mainpage'];
+
+        $this->out->menuItem($url,
+                             $label,
+                             $description,
+                             $this->isCurrent($actionName, $args),
+                             $id,
+                             $cls);
+    }
 }