summaryrefslogtreecommitdiff
path: root/lib/logingroupnav.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-08-04 06:52:57 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-08-04 06:52:57 -0400
commitb3ba7669df1d26b552dcd2fb2fc84afb1d73f983 (patch)
tree5639e4e3849ab300e30933c501d467bc3d30f030 /lib/logingroupnav.php
parent9e078c28b6d1642f4b85c86a33fdd4fc66ed2d3d (diff)
Add hooks for Start/End LoginGroupNav
Diffstat (limited to 'lib/logingroupnav.php')
-rw-r--r--lib/logingroupnav.php38
1 files changed, 21 insertions, 17 deletions
diff --git a/lib/logingroupnav.php b/lib/logingroupnav.php
index f23985f3a..538643d7e 100644
--- a/lib/logingroupnav.php
+++ b/lib/logingroupnav.php
@@ -69,26 +69,30 @@ class LoginGroupNav extends Widget
function show()
{
- // action => array('prompt', 'title')
- $menu = array();
-
- $menu['login'] = array(_('Login'),
- _('Login with a username and password'));
- if (!(common_config('site','closed') || common_config('site','inviteonly'))) {
- $menu['register'] = array(_('Register'),
- _('Sign up for a new account'));
- }
- $menu['openidlogin'] = array(_('OpenID'),
- _('Login or register with OpenID'));
-
$action_name = $this->action->trimmed('action');
+
$this->action->elementStart('ul', array('class' => 'nav'));
- foreach ($menu as $menuaction => $menudesc) {
- $this->action->menuItem(common_local_url($menuaction),
- $menudesc[0],
- $menudesc[1],
- $action_name === $menuaction);
+ if (Event::handle('StartLoginGroupNav', array(&$this->action))) {
+
+ $this->action->menuItem(common_local_url('login'),
+ _('Login'),
+ _('Login with a username and password'),
+ $action_name === 'login');
+
+ if (!(common_config('site','closed') || common_config('site','inviteonly'))) {
+ $this->action->menuItem(common_local_url('register'),
+ _('Register'),
+ _('Sign up for a new account'),
+ $action_name === 'register');
+ }
+
+ $this->action->menuItem(common_local_url('openidlogin'),
+ _('OpenID'),
+ _('Login or register with OpenID'),
+ $action_name === 'openidlogin');
+
+ Event::handle('EndLoginGroupNav', array(&$menu));
}
$this->action->elementEnd('ul');