r11904 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11903‎ | r11904 | r11905 >
Date:02:41, 2 December 2005
Author:tomgilder
Status:old
Tags:
Comment:
Make e-mail password message not display as error; new successbox class; kill off preferences-save-success class
Modified paths:
  • /trunk/phase3/includes/SpecialPreferences.php (modified) (history)
  • /trunk/phase3/includes/SpecialUserlogin.php (modified) (history)
  • /trunk/phase3/includes/templates/Userlogin.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)
  • /trunk/phase3/skins/monobook/main.css (modified) (history)
  • /trunk/phase3/skins/monobook/rtl.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/monobook/rtl.css
@@ -195,7 +195,7 @@
196196 margin-right: 1em;
197197 }
198198
199 -.preferences-save-success, #preftoc li, .prefsection fieldset {
 199+.errorbox, .successbox, #preftoc li, .prefsection fieldset {
200200 float: right;
201201 }
202202
Index: trunk/phase3/skins/monobook/main.css
@@ -271,21 +271,30 @@
272272 color: red;
273273 font-size: larger;
274274 }
275 -.errorbox {
 275+.errorbox, .successbox {
276276 font-size: larger;
277 - border: 2px solid red;
 277+ border: 2px solid;
278278 padding: .5em 1em;
279279 float: left;
280280 margin-bottom: 2em;
 281+ color: #000;
 282+}
 283+.errorbox {
 284+ border-color: red;
281285 background-color: #fff2f2;
282286 }
283 -.errorbox h2 {
 287+.successbox {
 288+ border-color: green;
 289+ background-color: #dfd;
 290+}
 291+.errorbox h2, .successbox h2 {
284292 font-size: 1em;
285293 font-weight: bold;
286294 display: inline;
287295 margin: 0 .5em 0 0;
288296 border: none;
289297 }
 298+
290299 #catlinks {
291300 border: 1px solid #aaa;
292301 background-color: #f9f9f9;
@@ -1046,15 +1055,6 @@
10471056 padding-right: .3em;
10481057 }
10491058
1050 -.preferences-save-success {
1051 - border: 2px solid green;
1052 - color: #000;
1053 - padding: .5em 1.2em;
1054 - background-color: #ddffdd;
1055 - float: left;
1056 - margin-bottom: 1em;
1057 -}
1058 -
10591059 .preferences-login {
10601060 clear: both;
10611061 margin-bottom: 1.5em;
Index: trunk/phase3/skins/MonoBook.php
@@ -56,7 +56,7 @@
5757 <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
5858 <?php $this->html('headlinks') ?>
5959 <title><?php $this->text('pagetitle') ?></title>
60 - <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css?4"; /*]]>*/</style>
 60+ <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css?5"; /*]]>*/</style>
6161 <link rel="stylesheet" type="text/css" <?php if(empty($this->data['printable']) ) { ?>media="print"<?php } ?> href="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
6262 <!--[if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style><![endif]-->
6363 <!--[if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style><![endif]-->
Index: trunk/phase3/includes/SpecialUserlogin.php
@@ -366,7 +366,7 @@
367367 if( WikiError::isError( $result ) ) {
368368 $this->mainLoginForm( wfMsg( 'mailerror', $result->getMessage() ) );
369369 } else {
370 - $this->mainLoginForm( wfMsg( 'passwordsent', $u->getName() ) );
 370+ $this->mainLoginForm( wfMsg( 'passwordsent', $u->getName() ), 'success' );
371371 }
372372 }
373373
@@ -435,7 +435,7 @@
436436 /**
437437 * @access private
438438 */
439 - function mainLoginForm( $err ) {
 439+ function mainLoginForm( $msg, $msgtype = 'error' ) {
440440 global $wgUser, $wgOut, $wgLang;
441441 global $wgDBname, $wgAllowRealName, $wgEnableEmail;
442442 global $wgAuth;
@@ -456,12 +456,12 @@
457457 $template =& new UsercreateTemplate();
458458 $q = 'action=submitlogin&type=signup';
459459 $linkq = 'type=login';
460 - $msg = 'gotaccount';
 460+ $linkmsg = 'gotaccount';
461461 } else {
462462 $template =& new UserloginTemplate();
463463 $q = 'action=submitlogin&type=login';
464464 $linkq = 'type=signup';
465 - $msg = 'nologin';
 465+ $linkmsg = 'nologin';
466466 }
467467
468468 if ( !empty( $this->mReturnto ) ) {
@@ -471,10 +471,10 @@
472472 }
473473
474474 $link = '<a href="' . htmlspecialchars ( $titleObj->getLocalUrl( $linkq ) ) . '">';
475 - $link .= wfMsgHtml( $msg . 'link' );
 475+ $link .= wfMsgHtml( $linkmsg . 'link' );
476476 $link .= '</a>';
477477
478 - $template->set( 'link', wfMsgHtml( $msg, $link ) );
 478+ $template->set( 'link', wfMsgHtml( $linkmsg, $link ) );
479479
480480 $template->set( 'name', $this->mName );
481481 $template->set( 'password', $this->mPassword );
@@ -484,7 +484,8 @@
485485 $template->set( 'domain', $this->mDomain );
486486
487487 $template->set( 'action', $titleObj->getLocalUrl( $q ) );
488 - $template->set( 'error', $err );
 488+ $template->set( 'message', $msg );
 489+ $template->set( 'messagetype', $msgtype );
489490 $template->set( 'create', $wgUser->isAllowedToCreateAccount() );
490491 $template->set( 'createemail', $wgEnableEmail && $wgUser->isLoggedIn() );
491492 $template->set( 'userealname', $wgAllowRealName );
Index: trunk/phase3/includes/SpecialPreferences.php
@@ -435,9 +435,9 @@
436436 $wgOut->setRobotpolicy( 'noindex,nofollow' );
437437
438438 if ( $this->mSuccess || 'success' == $status ) {
439 - $wgOut->addWikitext( '<div class="preferences-save-success"><strong>'. wfMsg( 'savedprefs' ) . '</strong></div>' );
 439+ $wgOut->addWikitext( '<div class="successbox"><strong>'. wfMsg( 'savedprefs' ) . '</strong></div>' );
440440 } else if ( 'error' == $status ) {
441 - $wgOut->addWikitext( '<div class="error"><strong>' . $message . '</strong></div>' );
 441+ $wgOut->addWikitext( '<div class="errorbox"><strong>' . $message . '</strong></div>' );
442442 } else if ( '' != $status ) {
443443 $wgOut->addWikitext( $message . "\n----" );
444444 }
Index: trunk/phase3/includes/templates/Userlogin.php
@@ -15,11 +15,13 @@
1616 */
1717 class UserloginTemplate extends QuickTemplate {
1818 function execute() {
19 - if( $this->data['error'] ) {
 19+ if( $this->data['message'] ) {
2020 ?>
21 - <div class="errorbox">
22 - <h2><?php $this->msg('loginerror') ?>:</h2>
23 - <?php $this->html('error') ?>
 21+ <div class="<?php $this->text('messagetype') ?>box">
 22+ <?php if ( $this->data['messagetype'] == 'error' ) { ?>
 23+ <h2><?php $this->msg('loginerror') ?>:</h2>
 24+ <?php } ?>
 25+ <?php $this->html('message') ?>
2426 </div>
2527 <div class="visualClear"></div>
2628 <?php } ?>
@@ -71,7 +73,7 @@
7274 <tr>
7375 <td></td>
7476 <td align='left' style="white-space:nowrap">
75 - <input type='submit' name="wpLoginattempt" id="wpLoginattempt" value="<?php $this->msg('login') ?>" />&nbsp;<?php if( $this->data['useemail'] ) { ?><input type='submit' name="wpMailmypassword"
 77+ <input type='submit' name="wpLoginattempt" id="wpLoginattempt" value="<?php $this->msg('login') ?>" />&nbsp;<?php if( $this->data['useemail'] ) { ?><input type='submit' name="wpMailmypassword" id="wpMailmypassword"
7678 value="<?php $this->msg('mailmypassword') ?>" />
7779 <?php } ?>
7880 </td>
@@ -87,11 +89,10 @@
8890
8991 class UsercreateTemplate extends QuickTemplate {
9092 function execute() {
91 - if( $this->data['error'] ) {
 93+ if( $this->data['message'] ) {
9294 ?>
93 - <div class="errorbox">
94 - <h2><?php $this->msg('loginerror') ?>:</h2>
95 - <?php $this->html('error') ?>
 95+ <div class="<?php $this->text('messageclass') ?>">
 96+ <?php $this->html('message') ?>
9697 </div>
9798 <div class="visualClear"></div>
9899 <?php } ?>

Status & tagging log