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' ) ) die( -1 );
33 class UsercreateTemplate
extends QuickTemplate
{
34 function addInputItem( $name, $value, $type, $msg, $helptext = false ) {
35 $this->data
['extraInput'][] = array(
40 'helptext' => $helptext,
45 if( $this->data
['message'] ) {
47 <div
class="<?php $this->text('messagetype') ?>box">
48 <?php
if ( $this->data
['messagetype'] == 'error' ) { ?
>
49 <strong
><?php
$this->msg( 'loginerror' )?
></strong
><br
/>
51 <?php
$this->html('message') ?
>
53 <div
class="visualClear"></div
>
56 <div id
="signupstart"><?php
$this->msgWiki( 'signupstart' ); ?
></div
>
59 <form name
="userlogin2" id
="userlogin2" method
="post" action
="<?php $this->text('action') ?>">
60 <h2
><?php
$this->msg('createaccount') ?
></h2
>
61 <p id
="userloginlink"><?php
$this->html('link') ?
></p
>
62 <?php
$this->html('header'); /* pre-table point for form plugins... */ ?
>
63 <?php
if( $this->haveData( 'languages' ) ) { ?
><div id
="languagelinks"><p
><?php
$this->html( 'languages' ); ?
></p
></div
><?php
} ?
>
66 <td
class="mw-label"><label
for='wpName2'><?php
$this->msg('yourname') ?
></label
></td
>
69 echo Html
::input( 'wpName', $this->data
['name'], 'text', array(
70 'class' => 'loginText',
80 <td
class="mw-label"><label
for='wpPassword2'><?php
$this->msg('yourpassword') ?
></label
></td
>
83 echo Html
::input( 'wpPassword', null, 'password', array(
84 'class' => 'loginPassword',
85 'id' => 'wpPassword2',
88 ) + User
::passwordChangeInputAttribs() ); ?
>
91 <?php
if( $this->data
['usedomain'] ) {
93 foreach( $this->data
['domainnames'] as $dom ) {
94 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
98 <td
class="mw-label"><?php
$this->msg( 'yourdomainname' ) ?
></td
>
100 <select name
="wpDomain" value
="<?php $this->text( 'domain' ) ?>"
108 <td
class="mw-label"><label
for='wpRetype'><?php
$this->msg('yourpasswordagain') ?
></label
></td
>
109 <td
class="mw-input">
111 echo Html
::input( 'wpRetype', null, 'password', array(
112 'class' => 'loginPassword',
116 ) + User
::passwordChangeInputAttribs() ); ?
>
120 <?php
if( $this->data
['useemail'] ) { ?
>
121 <td
class="mw-label"><label
for='wpEmail'><?php
$this->msg('youremail') ?
></label
></td
>
122 <td
class="mw-input">
124 echo Html
::input( 'wpEmail', $this->data
['email'], 'email', array(
125 'class' => 'loginText',
130 <div
class="prefsectiontip">
131 <?php
// duplicated in Preferences.php profilePreferences()
132 if( $this->data
['emailrequired'] ) {
133 $this->msgWiki('prefs-help-email-required');
135 $this->msgWiki('prefs-help-email');
137 if( $this->data
['emailothers'] ) {
138 $this->msgWiki('prefs-help-email-others');
143 <?php
if( $this->data
['userealname'] ) { ?
>
146 <td
class="mw-label"><label
for='wpRealName'><?php
$this->msg('yourrealname') ?
></label
></td
>
147 <td
class="mw-input">
148 <input type
='text' class='loginText' name
="wpRealName" id
="wpRealName"
150 value
="<?php $this->text('realname') ?>" size
='20' />
151 <div
class="prefsectiontip">
152 <?php
$this->msgWiki('prefs-help-realname'); ?
>
156 <?php
if( $this->data
['usereason'] ) { ?
>
159 <td
class="mw-label"><label
for='wpReason'><?php
$this->msg('createaccountreason') ?
></label
></td
>
160 <td
class="mw-input">
161 <input type
='text' class='loginText' name
="wpReason" id
="wpReason"
163 value
="<?php $this->text('reason') ?>" size
='20' />
167 <?php
if( $this->data
['canremember'] ) { ?
>
170 <td
class="mw-input">
172 global $wgCookieExpiration, $wgLang;
173 echo Xml
::checkLabel(
174 wfMsgExt( 'remembermypassword', 'parsemag', $wgLang->formatNum( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) ) ),
177 $this->data
['remember'],
178 array( 'tabindex' => '8' )
186 if ( isset( $this->data
['extraInput'] ) && is_array( $this->data
['extraInput'] ) ) {
187 foreach ( $this->data
['extraInput'] as $inputItem ) { ?
>
190 if ( !empty( $inputItem['msg'] ) && $inputItem['type'] != 'checkbox' ) {
191 ?
><td
class="mw-label"><label
for="<?php
192 echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
193 $this->msgWiki( $inputItem['msg'] ) ?
></label
><?php
198 <td
class="mw-input">
199 <input type
="<?php echo htmlspecialchars( $inputItem['type'] ) ?>" name
="<?php
200 echo htmlspecialchars( $inputItem['name'] ); ?>"
201 tabindex
="<?php echo $tabIndex++; ?>"
203 if ( $inputItem['type'] != 'checkbox' ) {
204 echo htmlspecialchars( $inputItem['value'] );
208 ?>" id
="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
210 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['value'] ) )
211 echo 'checked="checked"';
213 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['msg'] ) ) {
215 <label
for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
216 $this->msgHtml( $inputItem['msg'] ) ?
></label
><?php
218 if( $inputItem['helptext'] !== false ) {
220 <div
class="prefsectiontip">
221 <?php
$this->msgWiki( $inputItem['helptext'] ); ?
>
233 <td
class="mw-submit">
234 <input type
='submit' name
="wpCreateaccount" id
="wpCreateaccount"
235 tabindex
="<?php echo $tabIndex++; ?>"
236 value
="<?php $this->msg('createaccount') ?>" />
237 <?php
if( $this->data
['createemail'] ) { ?
>
238 <input type
='submit' name
="wpCreateaccountMail" id
="wpCreateaccountMail"
239 tabindex
="<?php echo $tabIndex++; ?>"
240 value
="<?php $this->msg('createaccountmail') ?>" />
245 <?php
if( $this->haveData( 'uselang' ) ) { ?
><input type
="hidden" name
="uselang" value
="<?php $this->text( 'uselang' ); ?>" /><?php
} ?
>
246 <?php
if( $this->haveData( 'token' ) ) { ?
><input type
="hidden" name
="wpCreateaccountToken" value
="<?php $this->text( 'token' ); ?>" /><?php
} ?
>
249 <div id
="signupend"><?php
$this->html( 'signupend' ); ?
></div
>