3 * StatusNet - the distributed open-source microblogging tool
4 * Copyright (C) 2011, StatusNet, Inc.
6 * Registration confirmation form
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU Affero General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Affero General Public License for more details.
20 * You should have received a copy of the GNU Affero General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 * @category Email registration
25 * @author Evan Prodromou <evan@status.net>
26 * @copyright 2011 StatusNet, Inc.
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
28 * @link http://status.net/
31 if (!defined('STATUSNET')) {
32 // This check helps protect against security problems;
33 // your code file can't be executed directly from the web.
38 * Registration confirmation form
40 * @category Email registration
42 * @author Evan Prodromou <evan@status.net>
43 * @copyright 2011 StatusNet, Inc.
44 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
45 * @link http://status.net/
47 class ConfirmRegistrationForm extends Form
53 function __construct($out, $nickname, $email, $code)
55 parent::__construct($out);
56 $this->nickname = $nickname;
57 $this->email = $email;
63 $this->out->element('p', 'instructions',
64 // TRANS: Form instructions.
65 sprintf(_m('Enter a password to confirm your new account.')));
67 $this->hidden('code', $this->code);
69 $this->out->elementStart('ul', 'form_data');
71 $this->elementStart('li');
73 // TRANS: Field label in e-mail registration form.
74 $this->element('label', array('for' => 'nickname-ignore'), _m('LABEL','User name'));
76 $this->element('input', array('name' => 'nickname-ignore',
78 'id' => 'nickname-ignore',
80 'value' => $this->nickname));
82 $this->elementEnd('li');
84 $this->elementStart('li');
86 // TRANS: Field label.
87 $this->element('label', array('for' => 'email-ignore'), _m('Email address'));
89 $this->element('input', array('name' => 'email-ignore',
91 'id' => 'email-ignore',
93 'value' => $this->email));
95 $this->elementEnd('li');
97 $this->elementStart('li');
98 // TRANS: Field label on account registration page.
99 $this->password('password1', _m('Password'),
100 // TRANS: Field title on account registration page.
101 _m('6 or more characters.'));
102 $this->elementEnd('li');
103 $this->elementStart('li');
104 // TRANS: Field label on account registration page. In this field the password has to be entered a second time.
105 $this->password('password2', _m('PASSWORD','Confirm'),
106 // TRANS: Field title on account registration page.
107 _m('Same as password above.'));
108 $this->elementEnd('li');
110 $this->elementStart('li');
112 $this->element('input', array('name' => 'tos',
113 'type' => 'checkbox',
114 'class' => 'checkbox',
119 $this->elementStart('label', array('class' => 'checkbox',
122 // TRANS: Checkbox title for terms of service and privacy policy.
123 $this->raw(sprintf(_m('I agree to the <a href="%1$s">Terms of service</a> and '.
124 '<a href="%1$s">Privacy policy</a> of this site.'),
125 common_local_url('doc', array('title' => 'tos')),
126 common_local_url('doc', array('title' => 'privacy'))));
128 $this->elementEnd('label');
130 $this->elementEnd('li');
132 $this->out->elementEnd('ul');
141 * Buttons for form actions
143 * Submit and cancel buttons (or whatever)
144 * Sub-classes should overload this to show their own buttons.
149 function formActions()
151 // TRANS: Button text for action to register.
152 $this->out->submit('submit', _m('BUTTON', 'Register'));
158 * Should be unique on the page. Sub-classes should overload this
159 * to show their own IDs.
161 * @return int ID of the form
166 return 'form_email_registration';
170 * Action of the form.
172 * URL to post to. Should be overloaded by subclasses to give
173 * somewhere to post to.
175 * @return string URL to post to
180 return common_local_url('register');
185 return 'form_confirm_registration form_settings';