diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-01-15 22:57:15 +0000 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-01-15 22:57:15 +0000 |
commit | eaa81d25fa7bd954132ce7f901fae69b0d46ec1a (patch) | |
tree | 25ac22e73ca93935b2a27e1e91e485b04ec3e01d /actions/login.php | |
parent | 2b2fb276219f87cdc0430d91ac3695e098ae48f4 (diff) |
Convert all actions to use new UI functions
I did a massive search-and-replace to get all the action subclasses to
use the new output function (common_element() -> $this->element(), etc.)
There's still a lot to do, but it's a first step
Diffstat (limited to 'actions/login.php')
-rw-r--r-- | actions/login.php | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/actions/login.php b/actions/login.php index 8600d44fd..fd98e656d 100644 --- a/actions/login.php +++ b/actions/login.php @@ -106,22 +106,45 @@ class LoginAction extends Action function show_form($error=null) { - common_show_header(_('Login'), null, $error, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->error = $error; + $this->showPage(); + } + + function title() + { + return _('Login'); + } + + function showPageNotice() + { + if ($this->error) { + $this->element('p', 'error', $this->error); + } else { + $instr = $this->get_instructions(); + $output = common_markup_to_html($instr); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); + } + } + + function showContent() + { + $this->elementStart('form', array('method' => 'post', 'id' => 'login', 'action' => common_local_url('login'))); - common_input('nickname', _('Nickname')); - common_password('password', _('Password')); - common_checkbox('rememberme', _('Remember me'), false, + $this->input('nickname', _('Nickname')); + $this->password('password', _('Password')); + $this->checkbox('rememberme', _('Remember me'), false, _('Automatically login in the future; ' . 'not for shared computers!')); - common_submit('submit', _('Login')); - common_hidden('token', common_session_token()); - common_element_end('form'); - common_element_start('p'); - common_element('a', array('href' => common_local_url('recoverpassword')), + $this->submit('submit', _('Login')); + $this->hidden('token', common_session_token()); + $this->elementEnd('form'); + $this->elementStart('p'); + $this->element('a', array('href' => common_local_url('recoverpassword')), _('Lost or forgotten password?')); - common_element_end('p'); + $this->elementEnd('p'); common_show_footer(); } @@ -146,14 +169,5 @@ class LoginAction extends Action function show_top($error=null) { - if ($error) { - common_element('p', 'error', $error); - } else { - $instr = $this->get_instructions(); - $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); - } } } |