3 * Html form for account creation
10 * @defgroup Templates Templates
13 if( !defined( 'MEDIAWIKI' ) ) die( -1 );
18 class UsercreateTemplate
extends QuickTemplate
{
19 function addInputItem( $name, $value, $type, $msg, $helptext = false ) {
20 $this->data
['extraInput'][] = array(
25 'helptext' => $helptext,
30 if( $this->data
['message'] ) {
32 <div
class="<?php $this->text('messagetype') ?>box">
33 <?php
if ( $this->data
['messagetype'] == 'error' ) { ?
>
34 <strong
><?php
$this->msg( 'loginerror' )?
></strong
><br
/>
36 <?php
$this->html('message') ?
>
38 <div
class="visualClear"></div
>
41 <div id
="signupstart"><?php
$this->msgWiki( 'signupstart' ); ?
></div
>
44 <form name
="userlogin2" id
="userlogin2" method
="post" action
="<?php $this->text('action') ?>">
45 <h2
><?php
$this->msg('createaccount') ?
></h2
>
46 <p id
="userloginlink"><?php
$this->html('link') ?
></p
>
47 <?php
$this->html('header'); /* pre-table point for form plugins... */ ?
>
48 <?php
if( $this->haveData( 'languages' ) ) { ?
><div id
="languagelinks"><p
><?php
$this->html( 'languages' ); ?
></p
></div
><?php
} ?
>
51 <td
class="mw-label"><label
for='wpName2'><?php
$this->msg('yourname') ?
></label
></td
>
54 echo Html
::input( 'wpName', $this->data
['name'], 'text', array(
55 'class' => 'loginText',
65 <td
class="mw-label"><label
for='wpPassword2'><?php
$this->msg('yourpassword') ?
></label
></td
>
68 echo Html
::input( 'wpPassword', null, 'password', array(
69 'class' => 'loginPassword',
70 'id' => 'wpPassword2',
73 ) + User
::passwordChangeInputAttribs() ); ?
>
76 <?php
if( $this->data
['usedomain'] ) {
78 foreach( $this->data
['domainnames'] as $dom ) {
79 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
83 <td
class="mw-label"><?php
$this->msg( 'yourdomainname' ) ?
></td
>
85 <select name
="wpDomain" value
="<?php $this->text( 'domain' ) ?>"
93 <td
class="mw-label"><label
for='wpRetype'><?php
$this->msg('yourpasswordagain') ?
></label
></td
>
96 echo Html
::input( 'wpRetype', null, 'password', array(
97 'class' => 'loginPassword',
101 ) + User
::passwordChangeInputAttribs() ); ?
>
105 <?php
if( $this->data
['useemail'] ) { ?
>
106 <td
class="mw-label"><label
for='wpEmail'><?php
$this->msg('youremail') ?
></label
></td
>
107 <td
class="mw-input">
109 echo Html
::input( 'wpEmail', $this->data
['email'], 'email', array(
110 'class' => 'loginText',
115 <div
class="prefsectiontip">
116 <?php
// duplicated in Preferences.php profilePreferences()
117 if( $this->data
['emailrequired'] ) {
118 $this->msgWiki('prefs-help-email-required');
120 $this->msgWiki('prefs-help-email');
122 if( $this->data
['emailothers'] ) {
123 $this->msgWiki('prefs-help-email-others');
128 <?php
if( $this->data
['userealname'] ) { ?
>
131 <td
class="mw-label"><label
for='wpRealName'><?php
$this->msg('yourrealname') ?
></label
></td
>
132 <td
class="mw-input">
133 <input type
='text' class='loginText' name
="wpRealName" id
="wpRealName"
135 value
="<?php $this->text('realname') ?>" size
='20' />
136 <div
class="prefsectiontip">
137 <?php
$this->msgWiki('prefs-help-realname'); ?
>
141 <?php
if( $this->data
['usereason'] ) { ?
>
144 <td
class="mw-label"><label
for='wpReason'><?php
$this->msg('createaccountreason') ?
></label
></td
>
145 <td
class="mw-input">
146 <input type
='text' class='loginText' name
="wpReason" id
="wpReason"
148 value
="<?php $this->text('reason') ?>" size
='20' />
152 <?php
if( $this->data
['canremember'] ) { ?
>
155 <td
class="mw-input">
157 global $wgCookieExpiration, $wgLang;
158 echo Xml
::checkLabel(
159 wfMsgExt( 'remembermypassword', 'parsemag', $wgLang->formatNum( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) ) ),
162 $this->data
['remember'],
163 array( 'tabindex' => '8' )
171 if ( isset( $this->data
['extraInput'] ) && is_array( $this->data
['extraInput'] ) ) {
172 foreach ( $this->data
['extraInput'] as $inputItem ) { ?
>
175 if ( !empty( $inputItem['msg'] ) && $inputItem['type'] != 'checkbox' ) {
176 ?
><td
class="mw-label"><label
for="<?php
177 echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
178 $this->msgWiki( $inputItem['msg'] ) ?
></label
><?php
183 <td
class="mw-input">
184 <input type
="<?php echo htmlspecialchars( $inputItem['type'] ) ?>" name
="<?php
185 echo htmlspecialchars( $inputItem['name'] ); ?>"
186 tabindex
="<?php echo $tabIndex++; ?>"
188 if ( $inputItem['type'] != 'checkbox' ) {
189 echo htmlspecialchars( $inputItem['value'] );
193 ?>" id
="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
195 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['value'] ) )
196 echo 'checked="checked"';
198 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['msg'] ) ) {
200 <label
for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
201 $this->msgHtml( $inputItem['msg'] ) ?
></label
><?php
203 if( $inputItem['helptext'] !== false ) {
205 <div
class="prefsectiontip">
206 <?php
$this->msgWiki( $inputItem['helptext'] ); ?
>
218 <td
class="mw-submit">
219 <input type
='submit' name
="wpCreateaccount" id
="wpCreateaccount"
220 tabindex
="<?php echo $tabIndex++; ?>"
221 value
="<?php $this->msg('createaccount') ?>" />
222 <?php
if( $this->data
['createemail'] ) { ?
>
223 <input type
='submit' name
="wpCreateaccountMail" id
="wpCreateaccountMail"
224 tabindex
="<?php echo $tabIndex++; ?>"
225 value
="<?php $this->msg('createaccountmail') ?>" />
230 <?php
if( $this->haveData( 'uselang' ) ) { ?
><input type
="hidden" name
="uselang" value
="<?php $this->text( 'uselang' ); ?>" /><?php
} ?
>
231 <?php
if( $this->haveData( 'token' ) ) { ?
><input type
="hidden" name
="wpCreateaccountToken" value
="<?php $this->text( 'token' ); ?>" /><?php
} ?
>
234 <div id
="signupend"><?php
$this->html( 'signupend' ); ?
></div
>