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/
48 class ConfirmRegistrationForm extends Form
54 function __construct($out, $nickname, $email, $code)
56 parent::__construct($out);
57 $this->nickname = $nickname;
58 $this->email = $email;
64 $this->out->element('p', 'instructions',
65 sprintf(_('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 $this->element('label', array('for' => 'nickname-ignore'), _('User name'));
75 $this->element('input', array('name' => 'nickname-ignore',
77 'id' => 'nickname-ignore',
79 'value' => $this->nickname));
81 $this->elementEnd('li');
83 $this->elementStart('li');
85 $this->element('label', array('for' => 'email-ignore'), _('Email'));
87 $this->element('input', array('name' => 'email-ignore',
89 'id' => 'email-ignore',
91 'value' => $this->email));
93 $this->elementEnd('li');
95 $this->elementStart('li');
96 // TRANS: Field label on account registration page.
97 $this->password('password', _('Password'),
98 // TRANS: Field title on account registration page.
99 _('6 or more characters.'));
100 $this->elementEnd('li');
101 $this->elementStart('li');
102 // TRANS: Field label on account registration page. In this field the password has to be entered a second time.
103 $this->password('confirm', _m('PASSWORD','Confirm'),
104 // TRANS: Field title on account registration page.
105 _('Same as password above.'));
106 $this->elementEnd('li');
108 $this->elementStart('li');
110 $this->element('input', array('name' => 'tos',
111 'type' => 'checkbox',
112 'class' => 'checkbox',
117 $this->elementStart('label', array('class' => 'checkbox',
121 $this->raw(sprintf(_('I agree to the <a href="%1$s">Terms of service</a> and '.
122 '<a href="%1$s">Privacy policy</a> of this site.'),
123 common_local_url('doc', array('title' => 'tos')),
124 common_local_url('doc', array('title' => 'privacy'))));
126 $this->elementEnd('label');
128 $this->elementEnd('li');
130 $this->out->elementEnd('ul');
139 * Buttons for form actions
141 * Submit and cancel buttons (or whatever)
142 * Sub-classes should overload this to show their own buttons.
147 function formActions()
149 // TRANS: Button text for action to save a new bookmark.
150 $this->out->submit('submit', _m('BUTTON', 'Register'));
156 * Should be unique on the page. Sub-classes should overload this
157 * to show their own IDs.
159 * @return int ID of the form
164 return 'form_email_registration';
168 * Action of the form.
170 * URL to post to. Should be overloaded by subclasses to give
171 * somewhere to post to.
173 * @return string URL to post to
178 return common_local_url('register');
183 return 'form_confirm_registration form_settings';