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>
38 <input type='text' class='loginText' name="wpName" id="wpName1"
40 value="<?php $this->text('name') ?>" size='20' />
44 <td class="mw-label"><label for='wpPassword1'><?php $this->msg('yourpassword') ?></label></td>
46 <input type='password' class='loginPassword' name="wpPassword" id="wpPassword1"
51 <?php if( $this->data['usedomain'] ) {
53 foreach( $this->data['domainnames'] as $dom ) {
54 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
57 <tr id="mw-user-domain-section">
58 <td class="mw-label"><?php $this->msg( 'yourdomainname' ) ?></td>
60 <select name="wpDomain" value="<?php $this->text( 'domain' ) ?>"
67 if( $this->data['canremember'] ) { ?>
71 <input type='checkbox' name="wpRemember"
73 value="1" id="wpRemember"
74 <?php if( $this->data['remember'] ) { ?>checked="checked"<?php } ?>
75 /> <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label>
81 <td class="mw-submit">
82 <input type='submit' name="wpLoginattempt" id="wpLoginattempt" tabindex="5" value="<?php $this->msg('login') ?>" /> <?php if( $this->data['useemail'] && $this->data['canreset']) { ?><input type='submit' name="wpMailmypassword" id="wpMailmypassword"
84 value="<?php $this->msg('mailmypassword') ?>" />
89 <?php if( @$this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
90 <?php if( @$this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
93 <div id="loginend"><?php $this->msgWiki( 'loginend' ); ?></div>
102 class UsercreateTemplate extends QuickTemplate {
103 function addInputItem( $name, $value, $type, $msg ) {
104 $this->data['extraInput'][] = array(
113 if( $this->data['message'] ) {
115 <div class="<?php $this->text('messagetype') ?>box">
116 <?php if ( $this->data['messagetype'] == 'error' ) { ?>
117 <h2><?php $this->msg('loginerror') ?></h2>
119 <?php $this->html('message') ?>
121 <div class="visualClear"></div>
125 <form name="userlogin2" id="userlogin2" method="post" action="<?php $this->text('action') ?>">
126 <h2><?php $this->msg('createaccount') ?></h2>
127 <p id="userloginlink"><?php $this->html('link') ?></p>
128 <?php $this->html('header'); /* pre-table point for form plugins... */ ?>
129 <?php if( @$this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
132 <td class="mw-label"><label for='wpName2'><?php $this->msg('yourname') ?></label></td>
133 <td class="mw-input">
134 <input type='text' class='loginText' name="wpName" id="wpName2"
136 value="<?php $this->text('name') ?>" size='20' />
140 <td class="mw-label"><label for='wpPassword2'><?php $this->msg('yourpassword') ?></label></td>
141 <td class="mw-input">
142 <input type='password' class='loginPassword' name="wpPassword" id="wpPassword2"
144 value="" size='20' />
147 <?php if( $this->data['usedomain'] ) {
149 foreach( $this->data['domainnames'] as $dom ) {
150 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
154 <td class="mw-label"><?php $this->msg( 'yourdomainname' ) ?></td>
155 <td class="mw-input">
156 <select name="wpDomain" value="<?php $this->text( 'domain' ) ?>"
164 <td class="mw-label"><label for='wpRetype'><?php $this->msg('yourpasswordagain') ?></label></td>
165 <td class="mw-input">
166 <input type='password' class='loginPassword' name="wpRetype" id="wpRetype"
173 <?php if( $this->data['useemail'] ) { ?>
174 <td class="mw-label"><label for='wpEmail'><?php $this->msg('youremail') ?></label></td>
175 <td class="mw-input">
176 <input type='text' class='loginText' name="wpEmail" id="wpEmail"
178 value="<?php $this->text('email') ?>" size='20' />
179 <div class="prefsectiontip">
180 <?php if( $this->data['emailrequired'] ) {
181 $this->msgWiki('prefs-help-email-required');
183 $this->msgWiki('prefs-help-email');
188 <?php if( $this->data['userealname'] ) { ?>
191 <td class="mw-label"><label for='wpRealName'><?php $this->msg('yourrealname') ?></label></td>
192 <td class="mw-input">
193 <input type='text' class='loginText' name="wpRealName" id="wpRealName"
195 value="<?php $this->text('realname') ?>" size='20' />
196 <div class="prefsectiontip">
197 <?php $this->msgWiki('prefs-help-realname'); ?>
202 <?php if( $this->data['canremember'] ) { ?>
205 <td class="mw-input">
206 <input type='checkbox' name="wpRemember"
208 value="1" id="wpRemember"
209 <?php if( $this->data['remember'] ) { ?>checked="checked"<?php } ?>
210 /> <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label>
216 if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) {
217 foreach ( $this->data['extraInput'] as $inputItem ) { ?>
220 if ( !empty( $inputItem['msg'] ) && $inputItem['type'] != 'checkbox' ) {
221 ?><td class="mw-label"><label for="<?php
222 echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
223 $this->msgWiki( $inputItem['msg'] ) ?></label><?php
228 <td class="mw-input">
229 <input type="<?php echo htmlspecialchars( $inputItem['type'] ) ?>" name="<?php
230 echo htmlspecialchars( $inputItem['name'] ); ?>"
231 tabindex="<?php echo $tabIndex++; ?>"
233 if ( $inputItem['type'] != 'checkbox' ) {
234 echo htmlspecialchars( $inputItem['value'] );
238 ?>" id="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
240 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['value'] ) )
241 echo 'checked="checked"';
243 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['msg'] ) ) {
245 <label for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
246 $this->msgHtml( $inputItem['msg'] ) ?></label><?php
258 <td class="mw-submit">
259 <input type='submit' name="wpCreateaccount" id="wpCreateaccount"
260 tabindex="<?php echo $tabIndex++; ?>"
261 value="<?php $this->msg('createaccount') ?>" />
262 <?php if( $this->data['createemail'] ) { ?>
263 <input type='submit' name="wpCreateaccountMail" id="wpCreateaccountMail"
264 tabindex="<?php echo $tabIndex++; ?>"
265 value="<?php $this->msg('createaccountmail') ?>" />
270 <?php if( @$this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
273 <div id="signupend"><?php $this->msgWiki( 'signupend' ); ?></div>