3 * Html form for account creation.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
25 * @defgroup Templates Templates
28 if ( !defined( 'MEDIAWIKI' ) ) {
35 class UsercreateTemplate
extends QuickTemplate
{
36 function addInputItem( $name, $value, $type, $msg, $helptext = false ) {
37 $this->data
['extraInput'][] = array(
42 'helptext' => $helptext,
47 if ( $this->data
['message'] ) {
49 <div
class="<?php $this->text( 'messagetype' ); ?>box">
51 if ( $this->data
['messagetype'] == 'error' ) {
52 ?
><strong
><?php
$this->msg( 'loginerror' ); ?
></strong
><br
/><?php
54 $this->html( 'message' );
57 <div
class="visualClear"></div
>
62 <div id
="signupstart"><?php
$this->msgWiki( 'signupstart' ); ?
></div
>
65 <form name
="userlogin2" id
="userlogin2" method
="post" action
="<?php $this->text( 'action' ); ?>">
66 <h2
><?php
$this->msg( 'createaccount' ); ?
></h2
>
67 <p id
="userloginlink"><?php
$this->html( 'link' ); ?
></p
>
68 <?php
$this->html( 'header' ); /* pre-table point for form plugins... */ ?
>
70 if ( $this->haveData( 'languages' ) ) {
71 ?
><div id
="languagelinks"><p
><?php
$this->html( 'languages' ); ?
></p
></div
><?php
76 <td
class="mw-label"><label
for='wpName2'><?php
$this->msg( 'yourname' ); ?
></label
></td
>
79 echo Html
::input( 'wpName', $this->data
['name'], 'text', array(
80 'class' => 'loginText',
93 if ( $this->data
['createemail'] ) {
95 wfMessage( 'createaccountmail' )->text(),
96 'wpCreateaccountMail',
97 'wpCreateaccountMail',
98 $this->data
['createemailset'],
99 array( 'tabindex' => '2' )
105 <tr
class="mw-row-password">
106 <td
class="mw-label"><label
for='wpPassword2'><?php
$this->msg( 'yourpassword' ); ?
></label
></td
>
107 <td
class="mw-input">
109 echo Html
::input( 'wpPassword', null, 'password', array(
110 'class' => 'loginPassword',
111 'id' => 'wpPassword2',
114 ) + User
::passwordChangeInputAttribs() ); ?
>
118 if ( $this->data
['usedomain'] ) {
120 foreach ( $this->data
['domainnames'] as $dom ) {
121 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
124 <tr id
="mw-user-domain-section">
125 <td
class="mw-label"><?php
$this->msg( 'yourdomainname' ); ?
></td
>
126 <td
class="mw-input">
127 <select name
="wpDomain" value
="<?php $this->text( 'domain' ); ?>"
136 <tr
class="mw-row-password">
137 <td
class="mw-label"><label
for='wpRetype'><?php
$this->msg( 'yourpasswordagain' ); ?
></label
></td
>
138 <td
class="mw-input">
140 echo Html
::input( 'wpRetype', null, 'password', array(
141 'class' => 'loginPassword',
145 ) + User
::passwordChangeInputAttribs() ); ?
>
150 if ( $this->data
['useemail'] ) {
152 <td
class="mw-label"><label
for='wpEmail'><?php
$this->msg( 'youremail' ); ?
></label
></td
>
153 <td
class="mw-input">
155 echo Html
::input( 'wpEmail', $this->data
['email'], 'email', array(
156 'class' => 'loginText',
161 <div
class="prefsectiontip">
162 <?php
// duplicated in Preferences.php profilePreferences()
163 if ( $this->data
['emailrequired'] ) {
164 $this->msgWiki( 'prefs-help-email-required' );
166 $this->msgWiki( 'prefs-help-email' );
168 if ( $this->data
['emailothers'] ) {
169 $this->msgWiki( 'prefs-help-email-others' );
176 if ( $this->data
['userealname'] ) {
180 <td
class="mw-label"><label
for='wpRealName'><?php
$this->msg( 'yourrealname' ); ?
></label
></td
>
181 <td
class="mw-input">
182 <input type
='text' class='loginText' name
="wpRealName" id
="wpRealName"
184 value
="<?php $this->text( 'realname' ); ?>" size
='20' />
185 <div
class="prefsectiontip">
186 <?php
$this->msgWiki( 'prefs-help-realname' ); ?
>
192 if ( $this->data
['usereason'] ) {
196 <td
class="mw-label"><label
for='wpReason'><?php
$this->msg( 'createaccountreason' ); ?
></label
></td
>
197 <td
class="mw-input">
198 <input type
='text' class='loginText' name
="wpReason" id
="wpReason"
200 value
="<?php $this->text( 'reason' ); ?>" size
='20' />
207 if ( $this->data
['canremember'] ) {
211 <td
class="mw-input">
213 global $wgCookieExpiration;
214 $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );
215 echo Xml
::checkLabel(
216 wfMessage( 'remembermypassword' )->numParams( $expirationDays )->text(),
219 $this->data
['remember'],
220 array( 'tabindex' => '9' )
229 if ( isset( $this->data
['extraInput'] ) && is_array( $this->data
['extraInput'] ) ) {
230 foreach ( $this->data
['extraInput'] as $inputItem ) { ?
>
233 if ( !empty( $inputItem['msg'] ) && $inputItem['type'] != 'checkbox' ) {
234 ?
><td
class="mw-label"><label
for="<?php
235 echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
236 $this->msgWiki( $inputItem['msg'] ); ?
></label
><?php
241 <td
class="mw-input">
242 <input type
="<?php echo htmlspecialchars( $inputItem['type'] ); ?>" name
="<?php
243 echo htmlspecialchars( $inputItem['name'] ); ?>"
244 tabindex
="<?php echo $tabIndex++; ?>"
246 if ( $inputItem['type'] != 'checkbox' ) {
247 echo htmlspecialchars( $inputItem['value'] );
251 ?>" id
="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
253 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['value'] ) ) {
254 echo 'checked="checked"';
257 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['msg'] ) ) {
259 <label
for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
260 $this->msgHtml( $inputItem['msg'] ); ?
></label
><?php
262 if ( $inputItem['helptext'] !== false ) {
264 <div
class="prefsectiontip">
265 <?php
$this->msgWiki( $inputItem['helptext'] ); ?
>
277 <td
class="mw-submit">
278 <input type
='submit' name
="wpCreateaccount" id
="wpCreateaccount"
279 tabindex
="<?php echo $tabIndex++; ?>"
280 value
="<?php $this->msg( 'createaccount' ); ?>" />
285 if ( $this->haveData( 'uselang' ) ) {
286 ?
><input type
="hidden" name
="uselang" value
="<?php $this->text( 'uselang' ); ?>" /><?php
288 if ( $this->haveData( 'token' ) ) {
289 ?
><input type
="hidden" name
="wpCreateaccountToken" value
="<?php $this->text( 'token' ); ?>" /><?php
294 <div id
="signupend"><?php
$this->html( 'signupend' ); ?
></div
>