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 echo Html
::input( 'wpRemember', '1', 'checkbox', array(
88 ) +
( $this->data
['remember'] ?
array( 'checked' ) : array() ) ); ?
>
90 <label
for="wpRemember"><?php
$this->msg('remembermypassword') ?
></label
>
96 <td
class="mw-submit">
98 echo Html
::input( 'wpLoginAttempt', wfMsg( 'login' ), 'submit', array(
99 'id' => 'wpLoginAttempt',
102 if ( $this->data
['useemail'] && $this->data
['canreset'] ) {
104 echo Html
::input( 'wpMailmypassword', wfMsg( 'mailmypassword' ), 'submit', array(
105 'id' => 'wpMailmypassword',
113 <?php
if( @$this->haveData( 'uselang' ) ) { ?
><input type
="hidden" name
="uselang" value
="<?php $this->text( 'uselang' ); ?>" /><?php
} ?
>
116 <div id
="loginend"><?php
$this->msgWiki( 'loginend' ); ?
></div
>
125 class UsercreateTemplate
extends QuickTemplate
{
126 function addInputItem( $name, $value, $type, $msg, $helptext = false ) {
127 $this->data
['extraInput'][] = array(
132 'helptext' => $helptext,
137 if( $this->data
['message'] ) {
139 <div
class="<?php $this->text('messagetype') ?>box">
140 <?php
if ( $this->data
['messagetype'] == 'error' ) { ?
>
141 <strong
><?php
$this->msg( 'loginerror' )?
></strong
><br
/>
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',
170 <td
class="mw-label"><label
for='wpPassword2'><?php
$this->msg('yourpassword') ?
></label
></td
>
171 <td
class="mw-input">
173 echo Html
::input( 'wpPassword', null, 'password', array(
174 'class' => 'loginPassword',
175 'id' => 'wpPassword2',
178 ) + User
::passwordChangeInputAttribs() ); ?
>
181 <?php
if( $this->data
['usedomain'] ) {
183 foreach( $this->data
['domainnames'] as $dom ) {
184 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
188 <td
class="mw-label"><?php
$this->msg( 'yourdomainname' ) ?
></td
>
189 <td
class="mw-input">
190 <select name
="wpDomain" value
="<?php $this->text( 'domain' ) ?>"
198 <td
class="mw-label"><label
for='wpRetype'><?php
$this->msg('yourpasswordagain') ?
></label
></td
>
199 <td
class="mw-input">
201 echo Html
::input( 'wpRetype', null, 'password', array(
202 'class' => 'loginPassword',
206 ) + User
::passwordChangeInputAttribs() ); ?
>
210 <?php
if( $this->data
['useemail'] ) { ?
>
211 <td
class="mw-label"><label
for='wpEmail'><?php
$this->msg('youremail') ?
></label
></td
>
212 <td
class="mw-input">
214 echo Html
::input( 'wpEmail', $this->data
['email'], 'email', array(
215 'class' => 'loginText',
220 <div
class="prefsectiontip">
221 <?php
if( $this->data
['emailrequired'] ) {
222 $this->msgWiki('prefs-help-email-required');
224 $this->msgWiki('prefs-help-email');
229 <?php
if( $this->data
['userealname'] ) { ?
>
232 <td
class="mw-label"><label
for='wpRealName'><?php
$this->msg('yourrealname') ?
></label
></td
>
233 <td
class="mw-input">
234 <input type
='text' class='loginText' name
="wpRealName" id
="wpRealName"
236 value
="<?php $this->text('realname') ?>" size
='20' />
237 <div
class="prefsectiontip">
238 <?php
$this->msgWiki('prefs-help-realname'); ?
>
243 <?php
if( $this->data
['canremember'] ) { ?
>
246 <td
class="mw-input">
247 <input type
='checkbox' name
="wpRemember"
249 value
="1" id
="wpRemember"
250 <?php
if( $this->data
['remember'] ) { ?
>checked
="checked"<?php
} ?
>
251 /> <label
for="wpRemember"><?php
$this->msg('remembermypassword') ?
></label
>
257 if ( isset( $this->data
['extraInput'] ) && is_array( $this->data
['extraInput'] ) ) {
258 foreach ( $this->data
['extraInput'] as $inputItem ) { ?
>
261 if ( !empty( $inputItem['msg'] ) && $inputItem['type'] != 'checkbox' ) {
262 ?
><td
class="mw-label"><label
for="<?php
263 echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
264 $this->msgWiki( $inputItem['msg'] ) ?
></label
><?php
269 <td
class="mw-input">
270 <input type
="<?php echo htmlspecialchars( $inputItem['type'] ) ?>" name
="<?php
271 echo htmlspecialchars( $inputItem['name'] ); ?>"
272 tabindex
="<?php echo $tabIndex++; ?>"
274 if ( $inputItem['type'] != 'checkbox' ) {
275 echo htmlspecialchars( $inputItem['value'] );
279 ?>" id
="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
281 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['value'] ) )
282 echo 'checked="checked"';
284 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['msg'] ) ) {
286 <label
for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
287 $this->msgHtml( $inputItem['msg'] ) ?
></label
><?php
289 if( $inputItem['helptext'] !== false ) {
291 <div
class="prefsectiontip">
292 <?php
$this->msgWiki( $inputItem['helptext'] ); ?
>
304 <td
class="mw-submit">
305 <input type
='submit' name
="wpCreateaccount" id
="wpCreateaccount"
306 tabindex
="<?php echo $tabIndex++; ?>"
307 value
="<?php $this->msg('createaccount') ?>" />
308 <?php
if( $this->data
['createemail'] ) { ?
>
309 <input type
='submit' name
="wpCreateaccountMail" id
="wpCreateaccountMail"
310 tabindex
="<?php echo $tabIndex++; ?>"
311 value
="<?php $this->msg('createaccountmail') ?>" />
316 <?php
if( @$this->haveData( 'uselang' ) ) { ?
><input type
="hidden" name
="uselang" value
="<?php $this->text( 'uselang' ); ?>" /><?php
} ?
>
319 <div id
="signupend"><?php
$this->msgWiki( 'signupend' ); ?
></div
>