123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- <?php
- if (!defined('STATUSNET')) {
-
-
- exit(1);
- }
- class ConfirmRegistrationForm extends Form
- {
- protected $action;
- protected $code;
- protected $nickname;
- protected $email;
- public function __construct($out, $nickname, $email, $code)
- {
- parent::__construct($out);
- $this->action = $out;
- $this->nickname = $nickname;
- $this->email = $email;
- $this->code = $code;
- }
- public function formData()
- {
- $this->out->element('p', 'instructions',
-
- sprintf(_m('Enter a password to confirm your new account.'))
- );
- $this->hidden('code', $this->code);
- $this->out->elementStart('ul', 'form_data');
-
- Event::handle('StartRegistrationFormData', array($this->action));
- $this->elementStart('li');
-
- $this->element('label', array('for' => 'nickname'), _m('LABEL', 'User name'));
- $this->element('input', array('name' => 'nickname',
- 'type' => 'text',
- 'id' => 'nickname',
- 'value' => $this->nickname));
- $this->elementEnd('li');
- $this->elementStart('li');
-
- $this->element('label', array('for' => 'email-ignore'), _m('Email address'));
- $this->element('input', array('name' => 'email-ignore',
- 'type' => 'text',
- 'id' => 'email-ignore',
- 'disabled' => 'true',
- 'value' => $this->email));
- $this->elementEnd('li');
- $this->elementStart('li');
-
- $this->password('password1', _m('Password'),
-
- _m('6 or more characters.')
- );
- $this->elementEnd('li');
- $this->elementStart('li');
-
- $this->password('password2', _m('PASSWORD', 'Confirm'),
-
- _m('Same as password above.')
- );
- $this->elementEnd('li');
-
- Event::handle('EndRegistrationFormData', array($this->action));
- $this->elementStart('li');
- $this->element('input', array('name' => 'tos',
- 'type' => 'checkbox',
- 'class' => 'checkbox',
- 'id' => 'tos',
- 'value' => 'true'));
- $this->text(' ');
- $this->elementStart('label', array('class' => 'checkbox',
- 'for' => 'tos'));
-
- $this->raw(sprintf(
- _m('I agree to the <a href="%1$s">Terms of service</a> and '.
- '<a href="%1$s">Privacy policy</a> of this site.'),
- common_local_url('doc', array('title' => 'tos')),
- common_local_url('doc', array('title' => 'privacy'))
- ));
- $this->elementEnd('label');
- $this->elementEnd('li');
- $this->out->elementEnd('ul');
- }
- public function method()
- {
- return 'post';
- }
-
- public function formActions()
- {
-
- $this->out->submit('submit', _m('BUTTON', 'Register'));
- }
-
- public function id()
- {
- return 'form_email_registration';
- }
-
- public function action()
- {
- return common_local_url('register');
- }
- public function formClass()
- {
- return 'form_confirm_registration form_settings';
- }
- }
|