a36fa2c533ab1ac09218a3bda0854f94032d0390
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 <strong
><?php
$this->msg( 'loginerror' )?
></strong
><br
/>
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',
45 # Can't do + array( 'autofocus' ) because + for arrays in PHP
46 # only works right for associative arrays! Thanks, PHP.
47 ) +
( $this->data
['name'] ?
array() : array( 'autofocus' => '' ) ) ); ?
>
52 <td
class="mw-label"><label
for='wpPassword1'><?php
$this->msg('yourpassword') ?
></label
></td
>
55 echo Html
::input( 'wpPassword', null, 'password', array(
56 'class' => 'loginPassword',
57 'id' => 'wpPassword1',
60 ) +
( $this->data
['name'] ?
array( 'autofocus' ) : array() ) ); ?
>
64 <?php
if( $this->data
['usedomain'] ) {
66 foreach( $this->data
['domainnames'] as $dom ) {
67 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
70 <tr id
="mw-user-domain-section">
71 <td
class="mw-label"><?php
$this->msg( 'yourdomainname' ) ?
></td
>
73 <select name
="wpDomain" value
="<?php $this->text( 'domain' ) ?>"
80 if( $this->data
['canremember'] ) { ?
>
85 global $wgCookieExpiration, $wgLang;
87 wfMsgExt( 'remembermypassword', 'parsemag', $wgLang->formatNum( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) ) ),
90 $this->data
['remember'],
91 array( 'tabindex' => '4' )
99 <td
class="mw-submit">
101 echo Html
::input( 'wpLoginAttempt', wfMsg( 'login' ), 'submit', array(
102 'id' => 'wpLoginAttempt',
105 if ( $this->data
['useemail'] && $this->data
['canreset'] ) {
107 echo Html
::input( 'wpMailmypassword', wfMsg( 'mailmypassword' ), 'submit', array(
108 'id' => 'wpMailmypassword',
116 <?php
if( @$this->haveData( 'uselang' ) ) { ?
><input type
="hidden" name
="uselang" value
="<?php $this->text( 'uselang' ); ?>" /><?php
} ?
>
117 <?php
if( @$this->haveData( 'token' ) ) { ?
><input type
="hidden" name
="wpLoginToken" value
="<?php $this->text( 'token' ); ?>" /><?php
} ?
>
120 <div id
="loginend"><?php
$this->msgWiki( 'loginend' ); ?
></div
>
129 class UsercreateTemplate
extends QuickTemplate
{
130 function addInputItem( $name, $value, $type, $msg, $helptext = false ) {
131 $this->data
['extraInput'][] = array(
136 'helptext' => $helptext,
141 if( $this->data
['message'] ) {
143 <div
class="<?php $this->text('messagetype') ?>box">
144 <?php
if ( $this->data
['messagetype'] == 'error' ) { ?
>
145 <strong
><?php
$this->msg( 'loginerror' )?
></strong
><br
/>
147 <?php
$this->html('message') ?
>
149 <div
class="visualClear"></div
>
153 <form name
="userlogin2" id
="userlogin2" method
="post" action
="<?php $this->text('action') ?>">
154 <h2
><?php
$this->msg('createaccount') ?
></h2
>
155 <p id
="userloginlink"><?php
$this->html('link') ?
></p
>
156 <?php
$this->html('header'); /* pre-table point for form plugins... */ ?
>
157 <?php
if( @$this->haveData( 'languages' ) ) { ?
><div id
="languagelinks"><p
><?php
$this->html( 'languages' ); ?
></p
></div
><?php
} ?
>
160 <td
class="mw-label"><label
for='wpName2'><?php
$this->msg('yourname') ?
></label
></td
>
161 <td
class="mw-input">
163 echo Html
::input( 'wpName', $this->data
['name'], 'text', array(
164 'class' => 'loginText',
174 <td
class="mw-label"><label
for='wpPassword2'><?php
$this->msg('yourpassword') ?
></label
></td
>
175 <td
class="mw-input">
177 echo Html
::input( 'wpPassword', null, 'password', array(
178 'class' => 'loginPassword',
179 'id' => 'wpPassword2',
182 ) + User
::passwordChangeInputAttribs() ); ?
>
185 <?php
if( $this->data
['usedomain'] ) {
187 foreach( $this->data
['domainnames'] as $dom ) {
188 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
192 <td
class="mw-label"><?php
$this->msg( 'yourdomainname' ) ?
></td
>
193 <td
class="mw-input">
194 <select name
="wpDomain" value
="<?php $this->text( 'domain' ) ?>"
202 <td
class="mw-label"><label
for='wpRetype'><?php
$this->msg('yourpasswordagain') ?
></label
></td
>
203 <td
class="mw-input">
205 echo Html
::input( 'wpRetype', null, 'password', array(
206 'class' => 'loginPassword',
210 ) + User
::passwordChangeInputAttribs() ); ?
>
214 <?php
if( $this->data
['useemail'] ) { ?
>
215 <td
class="mw-label"><label
for='wpEmail'><?php
$this->msg('youremail') ?
></label
></td
>
216 <td
class="mw-input">
218 echo Html
::input( 'wpEmail', $this->data
['email'], 'email', array(
219 'class' => 'loginText',
224 <div
class="prefsectiontip">
225 <?php
if( $this->data
['emailrequired'] ) {
226 $this->msgWiki('prefs-help-email-required');
228 $this->msgWiki('prefs-help-email');
233 <?php
if( $this->data
['userealname'] ) { ?
>
236 <td
class="mw-label"><label
for='wpRealName'><?php
$this->msg('yourrealname') ?
></label
></td
>
237 <td
class="mw-input">
238 <input type
='text' class='loginText' name
="wpRealName" id
="wpRealName"
240 value
="<?php $this->text('realname') ?>" size
='20' />
241 <div
class="prefsectiontip">
242 <?php
$this->msgWiki('prefs-help-realname'); ?
>
246 <?php
if( $this->data
['usereason'] ) { ?
>
249 <td
class="mw-label"><label
for='wpReason'><?php
$this->msg('createaccountreason') ?
></label
></td
>
250 <td
class="mw-input">
251 <input type
='text' class='loginText' name
="wpReason" id
="wpReason"
253 value
="<?php $this->text('reason') ?>" size
='20' />
257 <?php
if( $this->data
['canremember'] ) { ?
>
260 <td
class="mw-input">
262 global $wgCookieExpiration, $wgLang;
263 echo Xml
::checkLabel(
264 wfMsgExt( 'remembermypassword', 'parsemag', $wgLang->formatNum( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) ) ),
267 $this->data
['remember'],
268 array( 'tabindex' => '8' )
276 if ( isset( $this->data
['extraInput'] ) && is_array( $this->data
['extraInput'] ) ) {
277 foreach ( $this->data
['extraInput'] as $inputItem ) { ?
>
280 if ( !empty( $inputItem['msg'] ) && $inputItem['type'] != 'checkbox' ) {
281 ?
><td
class="mw-label"><label
for="<?php
282 echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
283 $this->msgWiki( $inputItem['msg'] ) ?
></label
><?php
288 <td
class="mw-input">
289 <input type
="<?php echo htmlspecialchars( $inputItem['type'] ) ?>" name
="<?php
290 echo htmlspecialchars( $inputItem['name'] ); ?>"
291 tabindex
="<?php echo $tabIndex++; ?>"
293 if ( $inputItem['type'] != 'checkbox' ) {
294 echo htmlspecialchars( $inputItem['value'] );
298 ?>" id
="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
300 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['value'] ) )
301 echo 'checked="checked"';
303 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['msg'] ) ) {
305 <label
for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
306 $this->msgHtml( $inputItem['msg'] ) ?
></label
><?php
308 if( $inputItem['helptext'] !== false ) {
310 <div
class="prefsectiontip">
311 <?php
$this->msgWiki( $inputItem['helptext'] ); ?
>
323 <td
class="mw-submit">
324 <input type
='submit' name
="wpCreateaccount" id
="wpCreateaccount"
325 tabindex
="<?php echo $tabIndex++; ?>"
326 value
="<?php $this->msg('createaccount') ?>" />
327 <?php
if( $this->data
['createemail'] ) { ?
>
328 <input type
='submit' name
="wpCreateaccountMail" id
="wpCreateaccountMail"
329 tabindex
="<?php echo $tabIndex++; ?>"
330 value
="<?php $this->msg('createaccountmail') ?>" />
335 <?php
if( @$this->haveData( 'uselang' ) ) { ?
><input type
="hidden" name
="uselang" value
="<?php $this->text( 'uselang' ); ?>" /><?php
} ?
>
336 <?php
if( @$this->haveData( 'token' ) ) { ?
><input type
="hidden" name
="wpCreateaccountToken" value
="<?php $this->text( 'token' ); ?>" /><?php
} ?
>
339 <div id
="signupend"><?php
$this->msgWiki( 'signupend' ); ?
></div
>