]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add hooks for subgroupnav showing
authorEvan Prodromou <evan@controlyourself.ca>
Fri, 15 May 2009 18:22:49 +0000 (14:22 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Fri, 15 May 2009 18:22:49 +0000 (14:22 -0400)
EVENTS.txt
lib/subgroupnav.php

index 5edf59245a5595710497350ad7d2c913cc4481bb..07fc446c34dcc37f6546a079bf7c4b515dc20e0d 100644 (file)
@@ -100,6 +100,12 @@ StartPublicGroupNav: Showing the public group nav menu
 EndPublicGroupNav: At the end of the public group nav menu
 - $action: the current action
 
+StartSubGroupNav: Showing the subscriptions group nav menu
+- $action: the current action
+
+EndSubGroupNav: At the end of the subscriptions group nav menu
+- $action: the current action
+
 RouterInitialized: After the router instance has been initialized
 - $m: the Net_URL_Mapper that has just been set up
 
index 31c3ea0b568e8ed62b1e0524cec920ba621ef958..4a9b36ae8fa1a198c7d2cb7d2be8f8732c4b62cb 100644 (file)
@@ -74,38 +74,44 @@ class SubGroupNav extends Widget
 
         $this->out->elementStart('ul', array('class' => 'nav'));
 
-        $this->out->menuItem(common_local_url('subscriptions',
-                                              array('nickname' =>
-                                                    $this->user->nickname)),
-                             _('Subscriptions'),
-                             sprintf(_('People %s subscribes to'),
-                                     $this->user->nickname),
-                             $action == 'subscriptions',
-                             'nav_subscriptions');
-        $this->out->menuItem(common_local_url('subscribers',
-                                              array('nickname' =>
-                                                    $this->user->nickname)),
-                             _('Subscribers'),
-                             sprintf(_('People subscribed to %s'),
-                                     $this->user->nickname),
-                             $action == 'subscribers',
-                             'nav_subscribers');
-        $this->out->menuItem(common_local_url('usergroups',
-                                              array('nickname' =>
-                                                    $this->user->nickname)),
-                             _('Groups'),
-                             sprintf(_('Groups %s is a member of'),
-                                     $this->user->nickname),
-                             $action == 'usergroups',
-                             'nav_usergroups');
-        if (!is_null($cur) && $this->user->id === $cur->id) {
-            $this->out->menuItem(common_local_url('invite'),
-                                 _('Invite'),
-                                 sprintf(_('Invite friends and colleagues to join you on %s'),
-                                         common_config('site', 'name')),
-                                 $action == 'invite',
-                                 'nav_invite');
+        if (Event::handle('StartSubGroupNav', array($this))) {
+
+            $this->out->menuItem(common_local_url('subscriptions',
+                                                  array('nickname' =>
+                                                        $this->user->nickname)),
+                                 _('Subscriptions'),
+                                 sprintf(_('People %s subscribes to'),
+                                         $this->user->nickname),
+                                 $action == 'subscriptions',
+                                 'nav_subscriptions');
+            $this->out->menuItem(common_local_url('subscribers',
+                                                  array('nickname' =>
+                                                        $this->user->nickname)),
+                                 _('Subscribers'),
+                                 sprintf(_('People subscribed to %s'),
+                                         $this->user->nickname),
+                                 $action == 'subscribers',
+                                 'nav_subscribers');
+            $this->out->menuItem(common_local_url('usergroups',
+                                                  array('nickname' =>
+                                                        $this->user->nickname)),
+                                 _('Groups'),
+                                 sprintf(_('Groups %s is a member of'),
+                                         $this->user->nickname),
+                                 $action == 'usergroups',
+                                 'nav_usergroups');
+            if (!is_null($cur) && $this->user->id === $cur->id) {
+                $this->out->menuItem(common_local_url('invite'),
+                                     _('Invite'),
+                                     sprintf(_('Invite friends and colleagues to join you on %s'),
+                                             common_config('site', 'name')),
+                                     $action == 'invite',
+                                     'nav_invite');
+            }
+
+            Event::handle('EndSubGroupNav', array($this));
         }
+
         $this->out->elementEnd('ul');
     }
 }