From 5dc1291b59a1079cbe9bab05d12dae06b8e4c96d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 4 Aug 2009 13:27:22 -0400 Subject: [PATCH] move openid instructions to OpenIDPlugin --- actions/login.php | 3 +-- actions/register.php | 5 +---- plugins/OpenID/OpenIDPlugin.php | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/actions/login.php b/actions/login.php index 50de83f6fb..f5a658bf50 100644 --- a/actions/login.php +++ b/actions/login.php @@ -250,8 +250,7 @@ class LoginAction extends Action } else { return _('Login with your username and password. ' . 'Don\'t have a username yet? ' . - '[Register](%%action.register%%) a new account, or ' . - 'try [OpenID](%%action.openidlogin%%). '); + '[Register](%%action.register%%) a new account.'); } } diff --git a/actions/register.php b/actions/register.php index dcbbbdb6a6..dd3edc4ed3 100644 --- a/actions/register.php +++ b/actions/register.php @@ -329,10 +329,7 @@ class RegisterAction extends Action common_markup_to_html(_('With this form you can create '. ' a new account. ' . 'You can then post notices and '. - 'link up to friends and colleagues. '. - '(Have an [OpenID](http://openid.net/)? ' . - 'Try our [OpenID registration]'. - '(%%action.openidlogin%%)!)')); + 'link up to friends and colleagues. ')); $this->elementStart('div', 'instructions'); $this->raw($instr); diff --git a/plugins/OpenID/OpenIDPlugin.php b/plugins/OpenID/OpenIDPlugin.php index ec261d7f7f..87b25d42a5 100644 --- a/plugins/OpenID/OpenIDPlugin.php +++ b/plugins/OpenID/OpenIDPlugin.php @@ -171,4 +171,29 @@ class OpenIDPlugin extends Plugin } return true; } + + function onEndShowPageNotice($action) + { + $name = $action->trimmed('action'); + + switch ($name) + { + case 'register': + $instr = '(Have an [OpenID](http://openid.net/)? ' . + 'Try our [OpenID registration]'. + '(%%action.openidlogin%%)!)'; + break; + case 'login': + $instr = '(Have an [OpenID](http://openid.net/)? ' . + 'Try our [OpenID login]'. + '(%%action.openidlogin%%)!)'; + break; + default: + return true; + } + + $output = common_markup_to_html($instr); + $action->raw($output); + return true; + } }