3 * @defgroup Templates Templates
7 if( !defined( 'MEDIAWIKI' ) ) die( -1 );
10 * HTML template for Special:Userlogin form
13 class UserloginTemplate
extends QuickTemplate
{
15 if( $this->data
['message'] ) {
17 <div
class="<?php $this->text('messagetype') ?>box">
18 <?php
if ( $this->data
['messagetype'] == 'error' ) { ?
>
19 <h2
><?php
$this->msg('loginerror') ?
></h2
>
21 <?php
$this->html('message') ?
>
23 <div
class="visualClear"></div
>
26 <div id
="loginstart"><?php
$this->msgWiki( 'loginstart' ); ?
></div
>
27 <div id
="userloginForm">
28 <form name
="userlogin" method
="post" action
="<?php $this->text('action') ?>">
29 <h2
><?php
$this->msg('login') ?
></h2
>
30 <p id
="userloginlink"><?php
$this->html('link') ?
></p
>
31 <?php
$this->html('header'); /* pre-table point for form plugins... */ ?
>
32 <div id
="userloginprompt"><?php
$this->msgWiki('loginprompt') ?
></div
>
33 <?php
if( @$this->haveData( 'languages' ) ) { ?
><div id
="languagelinks"><p
><?php
$this->html( 'languages' ); ?
></p
></div
><?php
} ?
>
36 <td
class="mw-label"><label
for='wpName1'><?php
$this->msg('yourname') ?
></label
></td
>
39 echo Html
::input( 'wpName', $this->data
['name'], 'text', array(
40 'class' => 'loginText',
51 <td
class="mw-label"><label
for='wpPassword1'><?php
$this->msg('yourpassword') ?
></label
></td
>
54 echo Html
::input( 'wpPassword', null, 'password', array(
55 'class' => 'loginPassword',
56 'id' => 'wpPassword1',
63 <?php
if( $this->data
['usedomain'] ) {
65 foreach( $this->data
['domainnames'] as $dom ) {
66 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
69 <tr id
="mw-user-domain-section">
70 <td
class="mw-label"><?php
$this->msg( 'yourdomainname' ) ?
></td
>
72 <select name
="wpDomain" value
="<?php $this->text( 'domain' ) ?>"
79 if( $this->data
['canremember'] ) { ?
>
84 echo Html
::input( 'wpRemember', '1', 'checkbox', array(
87 ) +
( $this->data
['remember'] ?
array( 'checked' ) : array() ) ); ?
>
89 <label
for="wpRemember"><?php
$this->msg('remembermypassword') ?
></label
>
95 <td
class="mw-submit">
97 echo Html
::input( 'wpLoginAttempt', wfMsg( 'login' ), 'submit', array(
98 'id' => 'wpLoginAttempt',
101 if ( $this->data
['useemail'] && $this->data
['canreset'] ) {
103 echo Html
::input( 'wpMailmypassword', wfMsg( 'mailmypassword' ), 'submit', array(
104 'id' => 'wpMailmypassword',
112 <?php
if( @$this->haveData( 'uselang' ) ) { ?
><input type
="hidden" name
="uselang" value
="<?php $this->text( 'uselang' ); ?>" /><?php
} ?
>
115 <div id
="loginend"><?php
$this->msgWiki( 'loginend' ); ?
></div
>
124 class UsercreateTemplate
extends QuickTemplate
{
125 function addInputItem( $name, $value, $type, $msg ) {
126 $this->data
['extraInput'][] = array(
135 global $wgMinimalPasswordLength;
137 if( $this->data
['message'] ) {
139 <div
class="<?php $this->text('messagetype') ?>box">
140 <?php
if ( $this->data
['messagetype'] == 'error' ) { ?
>
141 <h2
><?php
$this->msg('loginerror') ?
></h2
>
143 <?php
$this->html('message') ?
>
145 <div
class="visualClear"></div
>
149 <form name
="userlogin2" id
="userlogin2" method
="post" action
="<?php $this->text('action') ?>">
150 <h2
><?php
$this->msg('createaccount') ?
></h2
>
151 <p id
="userloginlink"><?php
$this->html('link') ?
></p
>
152 <?php
$this->html('header'); /* pre-table point for form plugins... */ ?
>
153 <?php
if( @$this->haveData( 'languages' ) ) { ?
><div id
="languagelinks"><p
><?php
$this->html( 'languages' ); ?
></p
></div
><?php
} ?
>
156 <td
class="mw-label"><label
for='wpName2'><?php
$this->msg('yourname') ?
></label
></td
>
157 <td
class="mw-input">
159 echo Html
::input( 'wpName', $this->data
['name'], 'text', array(
160 'class' => 'loginText',
169 <td
class="mw-label"><label
for='wpPassword2'><?php
$this->msg('yourpassword') ?
></label
></td
>
170 <td
class="mw-input">
172 echo Html
::input( 'wpPassword', null, 'password', array(
173 'class' => 'loginPassword',
174 'id' => 'wpPassword2',
177 ) +
( $wgMinimalPasswordLength > 0 ?
array( 'required' ) : array() ) ); ?
>
180 <?php
if( $this->data
['usedomain'] ) {
182 foreach( $this->data
['domainnames'] as $dom ) {
183 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
187 <td
class="mw-label"><?php
$this->msg( 'yourdomainname' ) ?
></td
>
188 <td
class="mw-input">
189 <select name
="wpDomain" value
="<?php $this->text( 'domain' ) ?>"
197 <td
class="mw-label"><label
for='wpRetype'><?php
$this->msg('yourpasswordagain') ?
></label
></td
>
198 <td
class="mw-input">
200 echo Html
::input( 'wpRetype', null, 'password', array(
201 'class' => 'loginPassword',
205 ) +
( $wgMinimalPasswordLength > 0 ?
array( 'required' ) : array() ) ); ?
>
209 <?php
if( $this->data
['useemail'] ) { ?
>
210 <td
class="mw-label"><label
for='wpEmail'><?php
$this->msg('youremail') ?
></label
></td
>
211 <td
class="mw-input">
213 echo Html
::input( 'wpEmail', $this->data
['email'], 'email', array(
214 'class' => 'loginText',
219 <div
class="prefsectiontip">
220 <?php
if( $this->data
['emailrequired'] ) {
221 $this->msgWiki('prefs-help-email-required');
223 $this->msgWiki('prefs-help-email');
228 <?php
if( $this->data
['userealname'] ) { ?
>
231 <td
class="mw-label"><label
for='wpRealName'><?php
$this->msg('yourrealname') ?
></label
></td
>
232 <td
class="mw-input">
233 <input type
='text' class='loginText' name
="wpRealName" id
="wpRealName"
235 value
="<?php $this->text('realname') ?>" size
='20' />
236 <div
class="prefsectiontip">
237 <?php
$this->msgWiki('prefs-help-realname'); ?
>
242 <?php
if( $this->data
['canremember'] ) { ?
>
245 <td
class="mw-input">
246 <input type
='checkbox' name
="wpRemember"
248 value
="1" id
="wpRemember"
249 <?php
if( $this->data
['remember'] ) { ?
>checked
="checked"<?php
} ?
>
250 /> <label
for="wpRemember"><?php
$this->msg('remembermypassword') ?
></label
>
256 if ( isset( $this->data
['extraInput'] ) && is_array( $this->data
['extraInput'] ) ) {
257 foreach ( $this->data
['extraInput'] as $inputItem ) { ?
>
260 if ( !empty( $inputItem['msg'] ) && $inputItem['type'] != 'checkbox' ) {
261 ?
><td
class="mw-label"><label
for="<?php
262 echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
263 $this->msgWiki( $inputItem['msg'] ) ?
></label
><?php
268 <td
class="mw-input">
269 <input type
="<?php echo htmlspecialchars( $inputItem['type'] ) ?>" name
="<?php
270 echo htmlspecialchars( $inputItem['name'] ); ?>"
271 tabindex
="<?php echo $tabIndex++; ?>"
273 if ( $inputItem['type'] != 'checkbox' ) {
274 echo htmlspecialchars( $inputItem['value'] );
278 ?>" id
="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
280 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['value'] ) )
281 echo 'checked="checked"';
283 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['msg'] ) ) {
285 <label
for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
286 $this->msgHtml( $inputItem['msg'] ) ?
></label
><?php
298 <td
class="mw-submit">
299 <input type
='submit' name
="wpCreateaccount" id
="wpCreateaccount"
300 tabindex
="<?php echo $tabIndex++; ?>"
301 value
="<?php $this->msg('createaccount') ?>" />
302 <?php
if( $this->data
['createemail'] ) { ?
>
303 <input type
='submit' name
="wpCreateaccountMail" id
="wpCreateaccountMail"
304 tabindex
="<?php echo $tabIndex++; ?>"
305 value
="<?php $this->msg('createaccountmail') ?>" />
310 <?php
if( @$this->haveData( 'uselang' ) ) { ?
><input type
="hidden" name
="uselang" value
="<?php $this->text( 'uselang' ); ?>" /><?php
} ?
>
313 <div id
="signupend"><?php
$this->msgWiki( 'signupend' ); ?
></div
>