00001 <?php
00007 if( !defined( 'MEDIAWIKI' ) ) die( -1 );
00008
00013 class UserloginTemplate extends QuickTemplate {
00014 function execute() {
00015 if( $this->data['message'] ) {
00016 ?>
00017 <div class="<?php $this->text('messagetype') ?>box">
00018 <?php if ( $this->data['messagetype'] == 'error' ) { ?>
00019 <strong><?php $this->msg( 'loginerror' )?></strong><br />
00020 <?php } ?>
00021 <?php $this->html('message') ?>
00022 </div>
00023 <div class="visualClear"></div>
00024 <?php } ?>
00025
00026 <div id="loginstart"><?php $this->msgWiki( 'loginstart' ); ?></div>
00027 <div id="userloginForm">
00028 <form name="userlogin" method="post" action="<?php $this->text('action') ?>">
00029 <h2><?php $this->msg('login') ?></h2>
00030 <p id="userloginlink"><?php $this->html('link') ?></p>
00031 <?php $this->html('header'); ?>
00032 <div id="userloginprompt"><?php $this->msgWiki('loginprompt') ?></div>
00033 <?php if( @$this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
00034 <table>
00035 <tr>
00036 <td class="mw-label"><label for='wpName1'><?php $this->msg('yourname') ?></label></td>
00037 <td class="mw-input">
00038 <?php
00039 echo Html::input( 'wpName', $this->data['name'], 'text', array(
00040 'class' => 'loginText',
00041 'id' => 'wpName1',
00042 'tabindex' => '1',
00043 'size' => '20',
00044 'required'
00045 # Can't do + array( 'autofocus' ) because + for arrays in PHP
00046 # only works right for associative arrays! Thanks, PHP.
00047 ) + ( $this->data['name'] ? array() : array( 'autofocus' => '' ) ) ); ?>
00048
00049 </td>
00050 </tr>
00051 <tr>
00052 <td class="mw-label"><label for='wpPassword1'><?php $this->msg('yourpassword') ?></label></td>
00053 <td class="mw-input">
00054 <?php
00055 echo Html::input( 'wpPassword', null, 'password', array(
00056 'class' => 'loginPassword',
00057 'id' => 'wpPassword1',
00058 'tabindex' => '2',
00059 'size' => '20'
00060 ) + ( $this->data['name'] ? array( 'autofocus' ) : array() ) ); ?>
00061
00062 </td>
00063 </tr>
00064 <?php if( $this->data['usedomain'] ) {
00065 $doms = "";
00066 foreach( $this->data['domainnames'] as $dom ) {
00067 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
00068 }
00069 ?>
00070 <tr id="mw-user-domain-section">
00071 <td class="mw-label"><?php $this->msg( 'yourdomainname' ) ?></td>
00072 <td class="mw-input">
00073 <select name="wpDomain" value="<?php $this->text( 'domain' ) ?>"
00074 tabindex="3">
00075 <?php echo $doms ?>
00076 </select>
00077 </td>
00078 </tr>
00079 <?php }
00080 if( $this->data['canremember'] ) { ?>
00081 <tr>
00082 <td></td>
00083 <td class="mw-input">
00084 <?php
00085 echo Html::input( 'wpRemember', '1', 'checkbox', array(
00086 'tabindex' => '4',
00087 'id' => 'wpRemember'
00088 ) + ( $this->data['remember'] ? array( 'checked' ) : array() ) ); ?>
00089
00090 <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label>
00091 </td>
00092 </tr>
00093 <?php } ?>
00094 <tr>
00095 <td></td>
00096 <td class="mw-submit">
00097 <?php
00098 echo Html::input( 'wpLoginAttempt', wfMsg( 'login' ), 'submit', array(
00099 'id' => 'wpLoginAttempt',
00100 'tabindex' => '5'
00101 ) );
00102 if ( $this->data['useemail'] && $this->data['canreset'] ) {
00103 echo ' ';
00104 echo Html::input( 'wpMailmypassword', wfMsg( 'mailmypassword' ), 'submit', array(
00105 'id' => 'wpMailmypassword',
00106 'tabindex' => '6'
00107 ) );
00108 } ?>
00109
00110 </td>
00111 </tr>
00112 </table>
00113 <?php if( @$this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
00114 <?php if( @$this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
00115 </form>
00116 </div>
00117 <div id="loginend"><?php $this->msgWiki( 'loginend' ); ?></div>
00118 <?php
00119
00120 }
00121 }
00122
00126 class UsercreateTemplate extends QuickTemplate {
00127 function addInputItem( $name, $value, $type, $msg, $helptext = false ) {
00128 $this->data['extraInput'][] = array(
00129 'name' => $name,
00130 'value' => $value,
00131 'type' => $type,
00132 'msg' => $msg,
00133 'helptext' => $helptext,
00134 );
00135 }
00136
00137 function execute() {
00138 if( $this->data['message'] ) {
00139 ?>
00140 <div class="<?php $this->text('messagetype') ?>box">
00141 <?php if ( $this->data['messagetype'] == 'error' ) { ?>
00142 <strong><?php $this->msg( 'loginerror' )?></strong><br />
00143 <?php } ?>
00144 <?php $this->html('message') ?>
00145 </div>
00146 <div class="visualClear"></div>
00147 <?php } ?>
00148 <div id="userlogin">
00149
00150 <form name="userlogin2" id="userlogin2" method="post" action="<?php $this->text('action') ?>">
00151 <h2><?php $this->msg('createaccount') ?></h2>
00152 <p id="userloginlink"><?php $this->html('link') ?></p>
00153 <?php $this->html('header'); /* pre-table point for form plugins... */ ?>
00154 <?php if( @$this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?>
00155 <table>
00156 <tr>
00157 <td class="mw-label"><label for='wpName2'><?php $this->msg('yourname') ?></label></td>
00158 <td class="mw-input">
00159 <?php
00160 echo Html::input( 'wpName', $this->data['name'], 'text', array(
00161 'class' => 'loginText',
00162 'id' => 'wpName2',
00163 'tabindex' => '1',
00164 'size' => '20',
00165 'required',
00166 'autofocus'
00167 ) ); ?>
00168 </td>
00169 </tr>
00170 <tr>
00171 <td class="mw-label"><label for='wpPassword2'><?php $this->msg('yourpassword') ?></label></td>
00172 <td class="mw-input">
00173 <?php
00174 echo Html::input( 'wpPassword', null, 'password', array(
00175 'class' => 'loginPassword',
00176 'id' => 'wpPassword2',
00177 'tabindex' => '2',
00178 'size' => '20'
00179 ) + User::passwordChangeInputAttribs() ); ?>
00180 </td>
00181 </tr>
00182 <?php if( $this->data['usedomain'] ) {
00183 $doms = "";
00184 foreach( $this->data['domainnames'] as $dom ) {
00185 $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>";
00186 }
00187 ?>
00188 <tr>
00189 <td class="mw-label"><?php $this->msg( 'yourdomainname' ) ?></td>
00190 <td class="mw-input">
00191 <select name="wpDomain" value="<?php $this->text( 'domain' ) ?>"
00192 tabindex="3">
00193 <?php echo $doms ?>
00194 </select>
00195 </td>
00196 </tr>
00197 <?php } ?>
00198 <tr>
00199 <td class="mw-label"><label for='wpRetype'><?php $this->msg('yourpasswordagain') ?></label></td>
00200 <td class="mw-input">
00201 <?php
00202 echo Html::input( 'wpRetype', null, 'password', array(
00203 'class' => 'loginPassword',
00204 'id' => 'wpRetype',
00205 'tabindex' => '4',
00206 'size' => '20'
00207 ) + User::passwordChangeInputAttribs() ); ?>
00208 </td>
00209 </tr>
00210 <tr>
00211 <?php if( $this->data['useemail'] ) { ?>
00212 <td class="mw-label"><label for='wpEmail'><?php $this->msg('youremail') ?></label></td>
00213 <td class="mw-input">
00214 <?php
00215 echo Html::input( 'wpEmail', $this->data['email'], 'email', array(
00216 'class' => 'loginText',
00217 'id' => 'wpEmail',
00218 'tabindex' => '5',
00219 'size' => '20'
00220 ) ); ?>
00221 <div class="prefsectiontip">
00222 <?php if( $this->data['emailrequired'] ) {
00223 $this->msgWiki('prefs-help-email-required');
00224 } else {
00225 $this->msgWiki('prefs-help-email');
00226 } ?>
00227 </div>
00228 </td>
00229 <?php } ?>
00230 <?php if( $this->data['userealname'] ) { ?>
00231 </tr>
00232 <tr>
00233 <td class="mw-label"><label for='wpRealName'><?php $this->msg('yourrealname') ?></label></td>
00234 <td class="mw-input">
00235 <input type='text' class='loginText' name="wpRealName" id="wpRealName"
00236 tabindex="6"
00237 value="<?php $this->text('realname') ?>" size='20' />
00238 <div class="prefsectiontip">
00239 <?php $this->msgWiki('prefs-help-realname'); ?>
00240 </div>
00241 </td>
00242 <?php } ?>
00243 </tr>
00244 <?php if( $this->data['canremember'] ) { ?>
00245 <tr>
00246 <td></td>
00247 <td class="mw-input">
00248 <input type='checkbox' name="wpRemember"
00249 tabindex="7"
00250 value="1" id="wpRemember"
00251 <?php if( $this->data['remember'] ) { ?>checked="checked"<?php } ?>
00252 /> <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label>
00253 </td>
00254 </tr>
00255 <?php }
00256
00257 $tabIndex = 8;
00258 if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) {
00259 foreach ( $this->data['extraInput'] as $inputItem ) { ?>
00260 <tr>
00261 <?php
00262 if ( !empty( $inputItem['msg'] ) && $inputItem['type'] != 'checkbox' ) {
00263 ?><td class="mw-label"><label for="<?php
00264 echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
00265 $this->msgWiki( $inputItem['msg'] ) ?></label><?php
00266 } else {
00267 ?><td><?php
00268 }
00269 ?></td>
00270 <td class="mw-input">
00271 <input type="<?php echo htmlspecialchars( $inputItem['type'] ) ?>" name="<?php
00272 echo htmlspecialchars( $inputItem['name'] ); ?>"
00273 tabindex="<?php echo $tabIndex++; ?>"
00274 value="<?php
00275 if ( $inputItem['type'] != 'checkbox' ) {
00276 echo htmlspecialchars( $inputItem['value'] );
00277 } else {
00278 echo '1';
00279 }
00280 ?>" id="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"
00281 <?php
00282 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['value'] ) )
00283 echo 'checked="checked"';
00284 ?> /> <?php
00285 if ( $inputItem['type'] == 'checkbox' && !empty( $inputItem['msg'] ) ) {
00286 ?>
00287 <label for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php
00288 $this->msgHtml( $inputItem['msg'] ) ?></label><?php
00289 }
00290 if( $inputItem['helptext'] !== false ) {
00291 ?>
00292 <div class="prefsectiontip">
00293 <?php $this->msgWiki( $inputItem['helptext'] ); ?>
00294 </div>
00295 <?php } ?>
00296 </td>
00297 </tr>
00298 <?php
00299
00300 }
00301 }
00302 ?>
00303 <tr>
00304 <td></td>
00305 <td class="mw-submit">
00306 <input type='submit' name="wpCreateaccount" id="wpCreateaccount"
00307 tabindex="<?php echo $tabIndex++; ?>"
00308 value="<?php $this->msg('createaccount') ?>" />
00309 <?php if( $this->data['createemail'] ) { ?>
00310 <input type='submit' name="wpCreateaccountMail" id="wpCreateaccountMail"
00311 tabindex="<?php echo $tabIndex++; ?>"
00312 value="<?php $this->msg('createaccountmail') ?>" />
00313 <?php } ?>
00314 </td>
00315 </tr>
00316 </table>
00317 <?php if( @$this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
00318 <?php if( @$this->haveData( 'token' ) ) { ?><input type="hidden" name="wpCreateaccountToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?>
00319 </form>
00320 </div>
00321 <div id="signupend"><?php $this->msgWiki( 'signupend' ); ?></div>
00322 <?php
00323
00324 }
00325 }