Make e-mail password message not display as error; new successbox class; kill off...
authorTom Gilder <tomgilder@users.mediawiki.org>
Fri, 2 Dec 2005 02:41:48 +0000 (02:41 +0000)
committerTom Gilder <tomgilder@users.mediawiki.org>
Fri, 2 Dec 2005 02:41:48 +0000 (02:41 +0000)
includes/SpecialPreferences.php
includes/SpecialUserlogin.php
includes/templates/Userlogin.php
skins/MonoBook.php
skins/monobook/main.css
skins/monobook/rtl.css

index fd51c36..ebbb6da 100644 (file)
@@ -435,9 +435,9 @@ class PreferencesForm {
                $wgOut->setRobotpolicy( 'noindex,nofollow' );
 
                if ( $this->mSuccess || 'success' == $status ) {
-                       $wgOut->addWikitext( '<div class="preferences-save-success"><strong>'. wfMsg( 'savedprefs' ) . '</strong></div>' );
+                       $wgOut->addWikitext( '<div class="successbox"><strong>'. wfMsg( 'savedprefs' ) . '</strong></div>' );
                } else  if ( 'error' == $status ) {
-                       $wgOut->addWikitext( '<div class="error"><strong>' . $message  . '</strong></div>' );
+                       $wgOut->addWikitext( '<div class="errorbox"><strong>' . $message  . '</strong></div>' );
                } else if ( '' != $status ) {
                        $wgOut->addWikitext( $message . "\n----" );
                }
index 416703e..f304ac0 100644 (file)
@@ -366,7 +366,7 @@ class LoginForm {
                if( WikiError::isError( $result ) ) {
                        $this->mainLoginForm( wfMsg( 'mailerror', $result->getMessage() ) );
                } else {
-                       $this->mainLoginForm( wfMsg( 'passwordsent', $u->getName() ) );
+                       $this->mainLoginForm( wfMsg( 'passwordsent', $u->getName() ), 'success' );
                }
        }
 
@@ -435,7 +435,7 @@ class LoginForm {
        /**
         * @access private
         */
-       function mainLoginForm( $err ) {
+       function mainLoginForm( $msg, $msgtype = 'error' ) {
                global $wgUser, $wgOut, $wgLang;
                global $wgDBname, $wgAllowRealName, $wgEnableEmail;
                global $wgAuth;
@@ -456,12 +456,12 @@ class LoginForm {
                        $template =& new UsercreateTemplate();
                        $q = 'action=submitlogin&type=signup';
                        $linkq = 'type=login';
-                       $msg = 'gotaccount';
+                       $linkmsg = 'gotaccount';
                } else {
                        $template =& new UserloginTemplate();
                        $q = 'action=submitlogin&type=login';
                        $linkq = 'type=signup';
-                       $msg = 'nologin';
+                       $linkmsg = 'nologin';
                }
 
                if ( !empty( $this->mReturnto ) ) {
@@ -471,10 +471,10 @@ class LoginForm {
                }
 
                $link = '<a href="' . htmlspecialchars ( $titleObj->getLocalUrl( $linkq ) ) . '">';
-               $link .= wfMsgHtml( $msg . 'link' );
+               $link .= wfMsgHtml( $linkmsg . 'link' );
                $link .= '</a>';
 
-               $template->set( 'link', wfMsgHtml( $msg, $link ) );
+               $template->set( 'link', wfMsgHtml( $linkmsg, $link ) );
                
                $template->set( 'name', $this->mName );
                $template->set( 'password', $this->mPassword );
@@ -484,7 +484,8 @@ class LoginForm {
                $template->set( 'domain', $this->mDomain );
 
                $template->set( 'action', $titleObj->getLocalUrl( $q ) );
-               $template->set( 'error', $err );
+               $template->set( 'message', $msg );
+               $template->set( 'messagetype', $msgtype );
                $template->set( 'create', $wgUser->isAllowedToCreateAccount() );
                $template->set( 'createemail', $wgEnableEmail && $wgUser->isLoggedIn() );
                $template->set( 'userealname', $wgAllowRealName );
index 7a6f03a..d00851e 100644 (file)
@@ -15,11 +15,13 @@ require_once( 'includes/SkinTemplate.php' );
  */
 class UserloginTemplate extends QuickTemplate {
        function execute() {
-               if( $this->data['error'] ) {
+               if( $this->data['message'] ) {
 ?>
-       <div class="errorbox">
-               <h2><?php $this->msg('loginerror') ?>:</h2>
-               <?php $this->html('error') ?>
+       <div class="<?php $this->text('messagetype') ?>box">
+               <?php if ( $this->data['messagetype'] == 'error' ) { ?>
+                       <h2><?php $this->msg('loginerror') ?>:</h2>
+               <?php } ?>
+               <?php $this->html('message') ?>
        </div>
        <div class="visualClear"></div>
 <?php } ?>
@@ -71,7 +73,7 @@ class UserloginTemplate extends QuickTemplate {
                <tr>
                        <td></td>
                        <td align='left' style="white-space:nowrap">
-                               <input type='submit' name="wpLoginattempt" id="wpLoginattempt" value="<?php $this->msg('login') ?>" />&nbsp;<?php if( $this->data['useemail'] ) { ?><input type='submit' name="wpMailmypassword"
+                               <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"
                                                                        value="<?php $this->msg('mailmypassword') ?>" />
                                <?php } ?>
                        </td>
@@ -87,11 +89,10 @@ class UserloginTemplate extends QuickTemplate {
 
 class UsercreateTemplate extends QuickTemplate {
        function execute() {
-               if( $this->data['error'] ) {
+               if( $this->data['message'] ) {
 ?>
-       <div class="errorbox">
-               <h2><?php $this->msg('loginerror') ?>:</h2>
-               <?php $this->html('error') ?>
+       <div class="<?php $this->text('messageclass') ?>">
+               <?php $this->html('message') ?>
        </div>
        <div class="visualClear"></div>
 <?php } ?>
index 2886f65..3c890f3 100644 (file)
@@ -56,7 +56,7 @@ class MonoBookTemplate extends QuickTemplate {
                <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
                <?php $this->html('headlinks') ?>
                <title><?php $this->text('pagetitle') ?></title>
-               <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css?4"; /*]]>*/</style>
+               <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css?5"; /*]]>*/</style>
                <link rel="stylesheet" type="text/css" <?php if(empty($this->data['printable']) ) { ?>media="print"<?php } ?> href="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
                <!--[if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style><![endif]-->
                <!--[if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style><![endif]-->
index c28f289..a2b52cc 100644 (file)
@@ -271,21 +271,30 @@ span.subpages {
        color: red;
        font-size: larger;
 }
-.errorbox {
+.errorbox, .successbox {
        font-size: larger;
-       border: 2px solid red;
+       border: 2px solid;
        padding: .5em 1em;
        float: left;
        margin-bottom: 2em;
+       color: #000;
+}
+.errorbox {
+       border-color: red;
        background-color: #fff2f2;
 }
-.errorbox h2 {
+.successbox {
+       border-color: green;
+       background-color: #dfd;
+}
+.errorbox h2, .successbox h2 {
        font-size: 1em;
        font-weight: bold;
        display: inline;
        margin: 0 .5em 0 0;
        border: none;
 }
+
 #catlinks {
        border: 1px solid #aaa;
        background-color: #f9f9f9;
@@ -1046,15 +1055,6 @@ div.prefsectiontip {
        padding-right: .3em;
 }
 
-.preferences-save-success {
-       border: 2px solid green;
-       color: #000;
-       padding: .5em 1.2em;
-       background-color: #ddffdd;
-       float: left;
-       margin-bottom: 1em;
-}
-
 .preferences-login {
        clear: both;
        margin-bottom: 1.5em;
index 7da860a..13930dc 100644 (file)
@@ -195,7 +195,7 @@ li#pt-login {
        margin-right: 1em;
 }
 
-.preferences-save-success, #preftoc li, .prefsection fieldset {
+.errorbox, .successbox, #preftoc li, .prefsection fieldset {
        float: right;
 }