From: Tom Gilder Date: Fri, 2 Dec 2005 02:41:48 +0000 (+0000) Subject: Make e-mail password message not display as error; new successbox class; kill off... X-Git-Tag: 1.6.0~1072 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=1d238e416852229028df7a42571056a240e6e6a9;p=lhc%2Fweb%2Fwiklou.git Make e-mail password message not display as error; new successbox class; kill off preferences-save-success class --- diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index fd51c36374..ebbb6da704 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -435,9 +435,9 @@ class PreferencesForm { $wgOut->setRobotpolicy( 'noindex,nofollow' ); if ( $this->mSuccess || 'success' == $status ) { - $wgOut->addWikitext( '
'. wfMsg( 'savedprefs' ) . '
' ); + $wgOut->addWikitext( '
'. wfMsg( 'savedprefs' ) . '
' ); } else if ( 'error' == $status ) { - $wgOut->addWikitext( '
' . $message . '
' ); + $wgOut->addWikitext( '
' . $message . '
' ); } else if ( '' != $status ) { $wgOut->addWikitext( $message . "\n----" ); } diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 416703e5f2..f304ac0c4d 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -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 = ''; - $link .= wfMsgHtml( $msg . 'link' ); + $link .= wfMsgHtml( $linkmsg . 'link' ); $link .= ''; - $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 ); diff --git a/includes/templates/Userlogin.php b/includes/templates/Userlogin.php index 7a6f03a12c..d00851e0f7 100644 --- a/includes/templates/Userlogin.php +++ b/includes/templates/Userlogin.php @@ -15,11 +15,13 @@ require_once( 'includes/SkinTemplate.php' ); */ class UserloginTemplate extends QuickTemplate { function execute() { - if( $this->data['error'] ) { + if( $this->data['message'] ) { ?> -
-

msg('loginerror') ?>:

- html('error') ?> +
+ data['messagetype'] == 'error' ) { ?> +

msg('loginerror') ?>:

+ + html('message') ?>
@@ -71,7 +73,7 @@ class UserloginTemplate extends QuickTemplate { -  data['useemail'] ) { ?> data['useemail'] ) { ?> @@ -87,11 +89,10 @@ class UserloginTemplate extends QuickTemplate { class UsercreateTemplate extends QuickTemplate { function execute() { - if( $this->data['error'] ) { + if( $this->data['message'] ) { ?> -
-

msg('loginerror') ?>:

- html('error') ?> +
+ html('message') ?>
diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 2886f65f55..3c890f3f15 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -56,7 +56,7 @@ class MonoBookTemplate extends QuickTemplate { html('headlinks') ?> <?php $this->text('pagetitle') ?> - + data['printable']) ) { ?>media="print" href="text('stylepath') ?>/common/commonPrint.css" /> diff --git a/skins/monobook/main.css b/skins/monobook/main.css index c28f2897bf..a2b52cc4f0 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -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; diff --git a/skins/monobook/rtl.css b/skins/monobook/rtl.css index 7da860a8fb..13930dc86d 100644 --- a/skins/monobook/rtl.css +++ b/skins/monobook/rtl.css @@ -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; }