http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99336
Revision: 99336 Author: aaron Date: 2011-10-09 05:51:56 +0000 (Sun, 09 Oct 2011) Log Message: ----------- * Don't add the pending account notice to the site notice (which is broken wrt to collapsing it) * Fixed nonsensically named CSS "confirmaccount-time-" classes Modified Paths: -------------- trunk/extensions/ConfirmAccount/ConfirmAccount.php trunk/extensions/ConfirmAccount/presentation/ConfirmAccount.i18n.php trunk/extensions/ConfirmAccount/presentation/ConfirmAccountUI.hooks.php trunk/extensions/ConfirmAccount/presentation/modules/confirmaccount.css trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php Modified: trunk/extensions/ConfirmAccount/ConfirmAccount.php =================================================================== --- trunk/extensions/ConfirmAccount/ConfirmAccount.php 2011-10-09 05:44:18 UTC (rev 99335) +++ trunk/extensions/ConfirmAccount/ConfirmAccount.php 2011-10-09 05:51:56 UTC (rev 99336) @@ -92,7 +92,7 @@ # Check for collisions $wgHooks['AbortNewAccount'][] = 'ConfirmAccountUIHooks::checkIfAccountNameIsPending'; # Status header like "new messages" bar -$wgHooks['SiteNoticeAfter'][] = 'ConfirmAccountUIHooks::confirmAccountsNotice'; +$wgHooks['BeforePageDisplay'][] = 'ConfirmAccountUIHooks::confirmAccountsNotice'; # Register admin pages for AdminLinks extension. $wgHooks['AdminLinks'][] = 'ConfirmAccountUIHooks::confirmAccountAdminLinks'; Modified: trunk/extensions/ConfirmAccount/presentation/ConfirmAccount.i18n.php =================================================================== --- trunk/extensions/ConfirmAccount/presentation/ConfirmAccount.i18n.php 2011-10-09 05:44:18 UTC (rev 99335) +++ trunk/extensions/ConfirmAccount/presentation/ConfirmAccount.i18n.php 2011-10-09 05:51:56 UTC (rev 99336) @@ -80,7 +80,7 @@ 'requestaccount-loginnotice' => 'To obtain a user account, you must \'\'\'[[Special:RequestAccount|request one]]\'\'\'.', # Site message for admins - 'confirmaccount-newrequests' => '\'\'\'$1\'\'\' open e-mail-confirmed [[Special:ConfirmAccounts|account {{PLURAL:$1|request|requests}}]] pending', + 'confirmaccount-newrequests' => '\'\'\'$1\'\'\' open e-mail-confirmed [[Special:ConfirmAccounts|account {{PLURAL:$1|request|requests}}]] {{PLURAL:$1|is|are}} pending. \'\'\'Your attention is needed!\'\'\'', # Confirm account page 'confirmaccounts' => 'Confirm account requests', Modified: trunk/extensions/ConfirmAccount/presentation/ConfirmAccountUI.hooks.php =================================================================== --- trunk/extensions/ConfirmAccount/presentation/ConfirmAccountUI.hooks.php 2011-10-09 05:44:18 UTC (rev 99335) +++ trunk/extensions/ConfirmAccount/presentation/ConfirmAccountUI.hooks.php 2011-10-09 05:51:56 UTC (rev 99336) @@ -48,15 +48,14 @@ } /** - * FIXME: don't just tack on to general site notice - * + * Add "x email-confirmed open account requests" notice * @param $notice * @return bool */ - public static function confirmAccountsNotice( &$notice ) { + public static function confirmAccountsNotice( OutputPage &$out, Skin &$skin ) { global $wgConfirmAccountNotice; - $context = RequestContext::getMain(); + $context = $out->getContext(); if ( !$wgConfirmAccountNotice || !$context->getUser()->isAllowed( 'confirmaccount' ) ) { return true; } @@ -67,11 +66,13 @@ } $count = ConfirmAccount::getOpenEmailConfirmedCount( '*' ); if ( $count > 0 ) { - $message = wfMsgExt( 'confirmaccount-newrequests', 'parsemag', $count ); - $notice .= '<div id="mw-confirmaccount-msg" class="mw-confirmaccount-bar">' . - $context->getOutput()->parse( $message ) . '</div>'; + $out->prependHtml( + '<div id="mw-confirmaccount-msg" class="plainlinks mw-confirmaccount-bar">' . + $out->parse( wfMsg( 'confirmaccount-newrequests', $count ), false ) . + '</div>' + ); - $context->getOutput()->addModules( 'ext.confirmAccount' ); // CSS + $out->addModules( 'ext.confirmAccount' ); // CSS } return true; } Modified: trunk/extensions/ConfirmAccount/presentation/modules/confirmaccount.css =================================================================== --- trunk/extensions/ConfirmAccount/presentation/modules/confirmaccount.css 2011-10-09 05:44:18 UTC (rev 99335) +++ trunk/extensions/ConfirmAccount/presentation/modules/confirmaccount.css 2011-10-09 05:51:56 UTC (rev 99336) @@ -1,14 +1,12 @@ +/* RC pending account request notice */ .mw-confirmaccount-bar { + padding: 3px; + margin: 5px; + border: 1px solid #990000; background-color: #f9f9f9; - padding: 0px; - font-size: 80%; - margin-left: 10px; - margin-right: 10px; - text-align: center; - float: right; } -.mw-confirmaccount-time-0 { +.mw-confirmaccount-type-0 { background-color: #f0fff0; } @@ -16,7 +14,7 @@ background-color: #f9f9f9; } -.mw-confirmaccount-time-1 { +.mw-confirmaccount-type-1 { background-color: #f0ffff; } Modified: trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php =================================================================== --- trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php 2011-10-09 05:44:18 UTC (rev 99335) +++ trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php 2011-10-09 05:51:56 UTC (rev 99336) @@ -919,7 +919,7 @@ } $time = $this->getLang()->timeanddate( wfTimestamp(TS_MW, $row->acr_registration), true ); - $r = "<li class='mw-confirmaccount-time-{$this->queueType}'>"; + $r = "<li class='mw-confirmaccount-type-{$this->queueType}'>"; $r .= $time." (<strong>{$link}</strong>)"; # Auto-rejected accounts have a user ID of zero _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs