7693223fee88f403e676bac1efd178ac3fcb8b1f
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',
175 <td
class="mw-label"><label
for='wpPassword2'><?php
$this->msg('yourpassword') ?
></label
></td
>
176 <td
class="mw-input">
178 echo Html
::input( 'wpPassword', null, 'password', array(
179 'class' => 'loginPassword',
180 'id' => 'wpPassword2',
183 ) + User
::passwordChangeInputAttribs() ); ?
>
185 <td
><div id
="password-strength"></div
></td
>
187 <?php
if( $this->data
['usedomain'] ) {
189 foreach( $this->data
['domainnames'] as $dom ) {
190 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
194 <td
class="mw-label"><?php
$this->msg( 'yourdomainname' ) ?
></td
>
195 <td
class="mw-input">
196 <select name
="wpDomain" value
="<?php $this->text( 'domain' ) ?>"
205 <td
class="mw-label"><label
for='wpRetype'><?php
$this->msg('yourpasswordagain') ?
></label
></td
>
206 <td
class="mw-input">
208 echo Html
::input( 'wpRetype', null, 'password', array(
209 'class' => 'loginPassword',
213 ) + User
::passwordChangeInputAttribs() ); ?
>
215 <td
><div id
="password-retype"></div
></td
>
218 <?php
if( $this->data
['useemail'] ) { ?
>
219 <td
class="mw-label"><label
for='wpEmail'><?php
$this->msg('youremail') ?
></label
></td
>
220 <td
class="mw-input">
222 echo Html
::input( 'wpEmail', $this->data
['email'], 'email', array(
223 'class' => 'loginText',
228 <div
class="prefsectiontip">
229 <?php
if( $this->data
['emailrequired'] ) {
230 $this->msgWiki('prefs-help-email-required');
232 $this->msgWiki('prefs-help-email');
238 <?php
if( $this->data
['userealname'] ) { ?
>
241 <td
class="mw-label"><label
for='wpRealName'><?php
$this->msg('yourrealname') ?
></label
></td
>
242 <td
class="mw-input" colspan
="2">
243 <input type
='text' class='loginText' name
="wpRealName" id
="wpRealName"
245 value
="<?php $this->text('realname') ?>" size
='20' />
246 <div
class="prefsectiontip">
247 <?php
$this->msgWiki('prefs-help-realname'); ?
>
252 <?php
if( $this->data
['usereason'] ) { ?
>
255 <td
class="mw-label"><label
for='wpReason'><?php
$this->msg('createaccountreason') ?
></label
></td
>
256 <td
class="mw-input" colspan
="2">
257 <input type
='text' class='loginText' name
="wpReason" id
="wpReason"
259 value
="<?php $this->text('reason') ?>" size
='20' />
263 <?php
if( $this->data
['canremember'] ) { ?
>
266 <td
class="mw-input" colspan
="2">
268 global $wgCookieExpiration, $wgLang;
269 echo Xml
::checkLabel(
270 wfMsgExt( 'remembermypassword', 'parsemag', $wgLang->formatNum( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) ) ),
273 $this->data
['remember'],
274 array( 'tabindex' => '8' )
282 if ( isset( $this->data
['extraInput'] ) && is_array( $this->data
['extraInput'] ) ) {
283 foreach ( $this->data
['extraInput'] as $inputItem ) { ?
>
286 if ( !empty( $inputItem['msg'] ) && $inputItem['type'] != 'checkbox' ) {
287 ?
><td
class="mw-label"><label
for="<?php
288 echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
289 $this->msgWiki( $inputItem['msg'] ) ?
></label
><?php
294 <td
class="mw-input" colspan
="2">
295 <input type
="<?php echo htmlspecialchars( $inputItem['type'] ) ?>" name
="<?php
296 echo htmlspecialchars( $inputItem['name'] ); ?>"
297 tabindex
="<?php echo $tabIndex++; ?>"
299 if ( $inputItem['type'] != 'checkbox' ) {
300 echo htmlspecialchars( $inputItem['value'] );
304 ?>" id
="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
306 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['value'] ) )
307 echo 'checked="checked"';
309 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['msg'] ) ) {
311 <label
for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
312 $this->msgHtml( $inputItem['msg'] ) ?
></label
><?php
314 if( $inputItem['helptext'] !== false ) {
316 <div
class="prefsectiontip">
317 <?php
$this->msgWiki( $inputItem['helptext'] ); ?
>
329 <td
class="mw-submit" colspan
="2">
330 <input type
='submit' name
="wpCreateaccount" id
="wpCreateaccount"
331 tabindex
="<?php echo $tabIndex++; ?>"
332 value
="<?php $this->msg('createaccount') ?>" />
333 <?php
if( $this->data
['createemail'] ) { ?
>
334 <input type
='submit' name
="wpCreateaccountMail" id
="wpCreateaccountMail"
335 tabindex
="<?php echo $tabIndex++; ?>"
336 value
="<?php $this->msg('createaccountmail') ?>" />
341 <?php
if( @$this->haveData( 'uselang' ) ) { ?
><input type
="hidden" name
="uselang" value
="<?php $this->text( 'uselang' ); ?>" /><?php
} ?
>
342 <?php
if( @$this->haveData( 'token' ) ) { ?
><input type
="hidden" name
="wpCreateaccountToken" value
="<?php $this->text( 'token' ); ?>" /><?php
} ?
>
345 <div id
="signupend"><?php
$this->msgWiki( 'signupend' ); ?
></div
>