diff options
Diffstat (limited to 'includes/templates')
-rw-r--r-- | includes/templates/NoLocalSettings.php | 4 | ||||
-rw-r--r-- | includes/templates/PHP4.php | 4 | ||||
-rw-r--r-- | includes/templates/Userlogin.php | 111 |
3 files changed, 83 insertions, 36 deletions
diff --git a/includes/templates/NoLocalSettings.php b/includes/templates/NoLocalSettings.php index 42682d60..45b758a9 100644 --- a/includes/templates/NoLocalSettings.php +++ b/includes/templates/NoLocalSettings.php @@ -35,11 +35,11 @@ foreach( $topdirs as $dir ){ } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'> +<html xmlns='http://www.w3.org/1999/xhtml' lang='en'> <head> <title>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></title> <meta http-equiv='Content-Type' content='text/html; charset=utf-8' /> - <style type='text/css' media='screen, projection'> + <style type='text/css' media='screen'> html, body { color: #000; background-color: #fff; diff --git a/includes/templates/PHP4.php b/includes/templates/PHP4.php index 058351a0..b071ebd5 100644 --- a/includes/templates/PHP4.php +++ b/includes/templates/PHP4.php @@ -27,11 +27,11 @@ if ( preg_match( '!^(.*)/config/[^/]*.php$!', $scriptUrl, $m ) ) { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'> +<html xmlns='http://www.w3.org/1999/xhtml' lang='en'> <head> <title>MediaWiki <?php echo htmlspecialchars( $wgVersion ); ?></title> <meta http-equiv='Content-Type' content='text/html; charset=utf-8' /> - <style type='text/css' media='screen, projection'> + <style type='text/css' media='screen'> html, body { color: #000; background-color: #fff; diff --git a/includes/templates/Userlogin.php b/includes/templates/Userlogin.php index 2ca9c3c4..60f33767 100644 --- a/includes/templates/Userlogin.php +++ b/includes/templates/Userlogin.php @@ -16,7 +16,7 @@ class UserloginTemplate extends QuickTemplate { ?> <div class="<?php $this->text('messagetype') ?>box"> <?php if ( $this->data['messagetype'] == 'error' ) { ?> - <h2><?php $this->msg('loginerror') ?></h2> + <strong><?php $this->msg( 'loginerror' )?></strong><br /> <?php } ?> <?php $this->html('message') ?> </div> @@ -35,17 +35,30 @@ class UserloginTemplate extends QuickTemplate { <tr> <td class="mw-label"><label for='wpName1'><?php $this->msg('yourname') ?></label></td> <td class="mw-input"> - <input type='text' class='loginText' name="wpName" id="wpName1" - tabindex="1" - value="<?php $this->text('name') ?>" size='20' /> + <?php + echo Html::input( 'wpName', $this->data['name'], 'text', array( + 'class' => 'loginText', + 'id' => 'wpName1', + 'tabindex' => '1', + 'size' => '20', + 'required' + # Can't do + array( 'autofocus' ) because + for arrays in PHP + # only works right for associative arrays! Thanks, PHP. + ) + ( $this->data['name'] ? array() : array( 'autofocus' => '' ) ) ); ?> + </td> </tr> <tr> <td class="mw-label"><label for='wpPassword1'><?php $this->msg('yourpassword') ?></label></td> <td class="mw-input"> - <input type='password' class='loginPassword' name="wpPassword" id="wpPassword1" - tabindex="2" - value="" size='20' /> + <?php + echo Html::input( 'wpPassword', null, 'password', array( + 'class' => 'loginPassword', + 'id' => 'wpPassword1', + 'tabindex' => '2', + 'size' => '20' + ) + ( $this->data['name'] ? array( 'autofocus' ) : array() ) ); ?> + </td> </tr> <?php if( $this->data['usedomain'] ) { @@ -68,21 +81,32 @@ class UserloginTemplate extends QuickTemplate { <tr> <td></td> <td class="mw-input"> - <input type='checkbox' name="wpRemember" - tabindex="4" - value="1" id="wpRemember" - <?php if( $this->data['remember'] ) { ?>checked="checked"<?php } ?> - /> <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label> + <?php + echo Html::input( 'wpRemember', '1', 'checkbox', array( + 'tabindex' => '4', + 'id' => 'wpRemember' + ) + ( $this->data['remember'] ? array( 'checked' ) : array() ) ); ?> + + <label for="wpRemember"><?php $this->msg('remembermypassword') ?></label> </td> </tr> - <?php } ?> +<?php } ?> <tr> <td></td> <td class="mw-submit"> - <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" - tabindex="6" - value="<?php $this->msg('mailmypassword') ?>" /> - <?php } ?> + <?php + echo Html::input( 'wpLoginAttempt', wfMsg( 'login' ), 'submit', array( + 'id' => 'wpLoginAttempt', + 'tabindex' => '5' + ) ); + if ( $this->data['useemail'] && $this->data['canreset'] ) { + echo ' '; + echo Html::input( 'wpMailmypassword', wfMsg( 'mailmypassword' ), 'submit', array( + 'id' => 'wpMailmypassword', + 'tabindex' => '6' + ) ); + } ?> + </td> </tr> </table> @@ -100,12 +124,13 @@ class UserloginTemplate extends QuickTemplate { * @ingroup Templates */ class UsercreateTemplate extends QuickTemplate { - function addInputItem( $name, $value, $type, $msg ) { + function addInputItem( $name, $value, $type, $msg, $helptext = false ) { $this->data['extraInput'][] = array( 'name' => $name, 'value' => $value, 'type' => $type, 'msg' => $msg, + 'helptext' => $helptext, ); } @@ -114,7 +139,7 @@ class UsercreateTemplate extends QuickTemplate { ?> <div class="<?php $this->text('messagetype') ?>box"> <?php if ( $this->data['messagetype'] == 'error' ) { ?> - <h2><?php $this->msg('loginerror') ?></h2> + <strong><?php $this->msg( 'loginerror' )?></strong><br /> <?php } ?> <?php $this->html('message') ?> </div> @@ -131,17 +156,27 @@ class UsercreateTemplate extends QuickTemplate { <tr> <td class="mw-label"><label for='wpName2'><?php $this->msg('yourname') ?></label></td> <td class="mw-input"> - <input type='text' class='loginText' name="wpName" id="wpName2" - tabindex="1" - value="<?php $this->text('name') ?>" size='20' /> + <?php + echo Html::input( 'wpName', $this->data['name'], 'text', array( + 'class' => 'loginText', + 'id' => 'wpName2', + 'tabindex' => '1', + 'size' => '20', + 'required', + 'autofocus' + ) ); ?> </td> </tr> <tr> <td class="mw-label"><label for='wpPassword2'><?php $this->msg('yourpassword') ?></label></td> <td class="mw-input"> - <input type='password' class='loginPassword' name="wpPassword" id="wpPassword2" - tabindex="2" - value="" size='20' /> +<?php + echo Html::input( 'wpPassword', null, 'password', array( + 'class' => 'loginPassword', + 'id' => 'wpPassword2', + 'tabindex' => '2', + 'size' => '20' + ) + User::passwordChangeInputAttribs() ); ?> </td> </tr> <?php if( $this->data['usedomain'] ) { @@ -163,19 +198,26 @@ class UsercreateTemplate extends QuickTemplate { <tr> <td class="mw-label"><label for='wpRetype'><?php $this->msg('yourpasswordagain') ?></label></td> <td class="mw-input"> - <input type='password' class='loginPassword' name="wpRetype" id="wpRetype" - tabindex="4" - value="" - size='20' /> + <?php + echo Html::input( 'wpRetype', null, 'password', array( + 'class' => 'loginPassword', + 'id' => 'wpRetype', + 'tabindex' => '4', + 'size' => '20' + ) + User::passwordChangeInputAttribs() ); ?> </td> </tr> <tr> <?php if( $this->data['useemail'] ) { ?> <td class="mw-label"><label for='wpEmail'><?php $this->msg('youremail') ?></label></td> <td class="mw-input"> - <input type='text' class='loginText' name="wpEmail" id="wpEmail" - tabindex="5" - value="<?php $this->text('email') ?>" size='20' /> + <?php + echo Html::input( 'wpEmail', $this->data['email'], 'email', array( + 'class' => 'loginText', + 'id' => 'wpEmail', + 'tabindex' => '5', + 'size' => '20' + ) ); ?> <div class="prefsectiontip"> <?php if( $this->data['emailrequired'] ) { $this->msgWiki('prefs-help-email-required'); @@ -245,7 +287,12 @@ class UsercreateTemplate extends QuickTemplate { <label for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"><?php $this->msgHtml( $inputItem['msg'] ) ?></label><?php } + if( $inputItem['helptext'] !== false ) { ?> + <div class="prefsectiontip"> + <?php $this->msgWiki( $inputItem['helptext'] ); ?> + </div> + <?php } ?> </td> </tr> <?php |