]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
GroupsNav uses new Menu class functionality
authorEvan Prodromou <evan@status.net>
Wed, 6 Jul 2011 15:10:26 +0000 (11:10 -0400)
committerEvan Prodromou <evan@status.net>
Wed, 6 Jul 2011 15:10:26 +0000 (11:10 -0400)
lib/groupsnav.php

index 26058c2b7ef8ae5656dba4f246d79a6549481394..b060153f88e5c116d6924fb5c847dfcb673d91ce 100644 (file)
@@ -61,33 +61,24 @@ class GroupsNav extends Menu
         return (!empty($this->groups) && ($this->groups->N > 0));
     }
 
-    /**
-     * Show the menu
-     *
-     * @return void
-     */
-    function show()
+    function tag()
     {
-        $action = $this->actionName;
-
-        $this->out->elementStart('ul', array('class' => 'nav'));
+        return 'groups';
+    }
 
-        if (Event::handle('StartGroupsNav', array($this))) {
+    function getItems()
+    {
+        $items = array();
 
-            while ($this->groups->fetch()) {
-                $this->out->menuItem(($this->groups->mainpage) ?
-                                     $this->groups->mainpage :
-                                     common_local_url('showgroup',
-                                                      array('nickname' => $this->groups->nickname)),
-                                     $this->groups->getBestName(),
-                                     '',
-                                     $action == 'showgroup' &&
-                                     $this->action->arg('nickname') == $this->groups->nickname,
-                                     'nav_timeline_group_'.$this->groups->nickname);
-            }
-            Event::handle('EndGroupsNav', array($this));
+        while ($this->groups->fetch()) {
+            $items[] = array('showgroup',
+                             array('nickname' => $this->groups->nickname),
+                             $this->groups->getBestName(),
+                             $this->groups->getBestName()
+                            );
         }
 
-        $this->out->elementEnd('ul');
+        return $items;
     }
+    
 }