add hooks for subgroupnav showing

This commit is contained in:
Evan Prodromou 2009-05-15 14:22:49 -04:00
parent c6816c163e
commit 14662354dc
2 changed files with 43 additions and 31 deletions

View File

@ -100,6 +100,12 @@ StartPublicGroupNav: Showing the public group nav menu
EndPublicGroupNav: At the end of the public group nav menu EndPublicGroupNav: At the end of the public group nav menu
- $action: the current action - $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 RouterInitialized: After the router instance has been initialized
- $m: the Net_URL_Mapper that has just been set up - $m: the Net_URL_Mapper that has just been set up

View File

@ -74,38 +74,44 @@ class SubGroupNav extends Widget
$this->out->elementStart('ul', array('class' => 'nav')); $this->out->elementStart('ul', array('class' => 'nav'));
$this->out->menuItem(common_local_url('subscriptions', if (Event::handle('StartSubGroupNav', array($this))) {
array('nickname' =>
$this->user->nickname)), $this->out->menuItem(common_local_url('subscriptions',
_('Subscriptions'), array('nickname' =>
sprintf(_('People %s subscribes to'), $this->user->nickname)),
$this->user->nickname), _('Subscriptions'),
$action == 'subscriptions', sprintf(_('People %s subscribes to'),
'nav_subscriptions'); $this->user->nickname),
$this->out->menuItem(common_local_url('subscribers', $action == 'subscriptions',
array('nickname' => 'nav_subscriptions');
$this->user->nickname)), $this->out->menuItem(common_local_url('subscribers',
_('Subscribers'), array('nickname' =>
sprintf(_('People subscribed to %s'), $this->user->nickname)),
$this->user->nickname), _('Subscribers'),
$action == 'subscribers', sprintf(_('People subscribed to %s'),
'nav_subscribers'); $this->user->nickname),
$this->out->menuItem(common_local_url('usergroups', $action == 'subscribers',
array('nickname' => 'nav_subscribers');
$this->user->nickname)), $this->out->menuItem(common_local_url('usergroups',
_('Groups'), array('nickname' =>
sprintf(_('Groups %s is a member of'), $this->user->nickname)),
$this->user->nickname), _('Groups'),
$action == 'usergroups', sprintf(_('Groups %s is a member of'),
'nav_usergroups'); $this->user->nickname),
if (!is_null($cur) && $this->user->id === $cur->id) { $action == 'usergroups',
$this->out->menuItem(common_local_url('invite'), 'nav_usergroups');
_('Invite'), if (!is_null($cur) && $this->user->id === $cur->id) {
sprintf(_('Invite friends and colleagues to join you on %s'), $this->out->menuItem(common_local_url('invite'),
common_config('site', 'name')), _('Invite'),
$action == 'invite', sprintf(_('Invite friends and colleagues to join you on %s'),
'nav_invite'); common_config('site', 'name')),
$action == 'invite',
'nav_invite');
}
Event::handle('EndSubGroupNav', array($this));
} }
$this->out->elementEnd('ul'); $this->out->elementEnd('ul');
} }
} }