]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Added hook for the Group navigation items
authorSarven Capadisli <csarven@status.net>
Tue, 10 Nov 2009 13:52:47 +0000 (13:52 +0000)
committerSarven Capadisli <csarven@status.net>
Tue, 10 Nov 2009 13:52:47 +0000 (13:52 +0000)
EVENTS.txt
lib/groupnav.php

index c3fe73134cbe1aac647156fa32cd949daf09da85..af686b9cdfabc83d70653cdbde18e0fa535d9191 100644 (file)
@@ -191,6 +191,12 @@ StartPersonalGroupNav: beginning of personal group nav menu
 EndPersonalGroupNav: end of personal group nav menu (good place to add a menu item)
 - $action: action object being shown
 
+StartGroupGroupNav: Showing the group nav menu
+- $action: the current action
+
+EndGroupGroupNav: At the end of the group nav menu
+- $action: the current action
+
 StartEndHTML: just before the </html> tag
 - $action: action object being shown
 
index 31cf378c8a821077a494585b9e141b241a6ce34f..131b38fa27b7261765045f73c5c6aa1974429e0b 100644 (file)
@@ -79,46 +79,49 @@ class GroupNav extends Widget
         $nickname = $this->group->nickname;
 
         $this->out->elementStart('ul', array('class' => 'nav'));
-        $this->out->menuItem(common_local_url('showgroup', array('nickname' =>
-                                                                 $nickname)),
-                             _('Group'),
-                             sprintf(_('%s group'), $nickname),
-                             $action_name == 'showgroup',
-                             'nav_group_group');
-        $this->out->menuItem(common_local_url('groupmembers', array('nickname' =>
-                                                                    $nickname)),
-                             _('Members'),
-                             sprintf(_('%s group members'), $nickname),
-                             $action_name == 'groupmembers',
-                             'nav_group_members');
+        if (Event::handle('StartGroupGroupNav', array($this))) {
+            $this->out->menuItem(common_local_url('showgroup', array('nickname' =>
+                                                                     $nickname)),
+                                 _('Group'),
+                                 sprintf(_('%s group'), $nickname),
+                                 $action_name == 'showgroup',
+                                 'nav_group_group');
+            $this->out->menuItem(common_local_url('groupmembers', array('nickname' =>
+                                                                        $nickname)),
+                                 _('Members'),
+                                 sprintf(_('%s group members'), $nickname),
+                                 $action_name == 'groupmembers',
+                                 'nav_group_members');
 
-        $cur = common_current_user();
+            $cur = common_current_user();
 
-        if ($cur && $cur->isAdmin($this->group)) {
-            $this->out->menuItem(common_local_url('blockedfromgroup', array('nickname' =>
-                                                                            $nickname)),
-                                 _('Blocked'),
-                                 sprintf(_('%s blocked users'), $nickname),
-                                 $action_name == 'blockedfromgroup',
-                                 'nav_group_blocked');
-            $this->out->menuItem(common_local_url('editgroup', array('nickname' =>
-                                                                     $nickname)),
-                                 _('Admin'),
-                                 sprintf(_('Edit %s group properties'), $nickname),
-                                 $action_name == 'editgroup',
-                                 'nav_group_admin');
-            $this->out->menuItem(common_local_url('grouplogo', array('nickname' =>
-                                                                     $nickname)),
-                                 _('Logo'),
-                                 sprintf(_('Add or edit %s logo'), $nickname),
-                                 $action_name == 'grouplogo',
-                                 'nav_group_logo');
-            $this->out->menuItem(common_local_url('groupdesignsettings', array('nickname' =>
-                                                                  $nickname)),
-                                 _('Design'),
-                                 sprintf(_('Add or edit %s design'), $nickname),
-                                 $action_name == 'groupdesignsettings',
-                                 'nav_group_design');
+            if ($cur && $cur->isAdmin($this->group)) {
+                $this->out->menuItem(common_local_url('blockedfromgroup', array('nickname' =>
+                                                                                $nickname)),
+                                     _('Blocked'),
+                                     sprintf(_('%s blocked users'), $nickname),
+                                     $action_name == 'blockedfromgroup',
+                                     'nav_group_blocked');
+                $this->out->menuItem(common_local_url('editgroup', array('nickname' =>
+                                                                         $nickname)),
+                                     _('Admin'),
+                                     sprintf(_('Edit %s group properties'), $nickname),
+                                     $action_name == 'editgroup',
+                                     'nav_group_admin');
+                $this->out->menuItem(common_local_url('grouplogo', array('nickname' =>
+                                                                         $nickname)),
+                                     _('Logo'),
+                                     sprintf(_('Add or edit %s logo'), $nickname),
+                                     $action_name == 'grouplogo',
+                                     'nav_group_logo');
+                $this->out->menuItem(common_local_url('groupdesignsettings', array('nickname' =>
+                                                                      $nickname)),
+                                     _('Design'),
+                                     sprintf(_('Add or edit %s design'), $nickname),
+                                     $action_name == 'groupdesignsettings',
+                                     'nav_group_design');
+            }
+            Event::handle('EndGroupGroupNav', array($this));
         }
         $this->out->elementEnd('ul');
     }