r98209 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98208‎ | r98209 | r98210 >
Date:04:42, 27 September 2011
Author:aaron
Status:deferred
Tags:
Comment:
Hide "pending accounts" notice from all but a few key special pages to avoid clutter and UI collisions.
Modified paths:
  • /trunk/extensions/ConfirmAccount/presentation/ConfirmAccountUI.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmAccount/presentation/ConfirmAccountUI.hooks.php
@@ -38,11 +38,20 @@
3939
4040 // FIXME: don't just take on to general site notice
4141 public static function confirmAccountsNotice( $notice ) {
42 - global $wgConfirmAccountNotice, $wgUser;
 42+ global $wgConfirmAccountNotice, $wgUser, $wgMemc, $wgOut;
4343 if ( !$wgConfirmAccountNotice || !$wgUser->isAllowed( 'confirmaccount' ) ) {
4444 return true;
4545 }
46 - global $wgMemc, $wgOut;
 46+ # Only show on some special pages
 47+ $title = RequestContext::getMain()->getTitle();
 48+ if ( !$title->isSpecialPage() ) {
 49+ return true;
 50+ } elseif (
 51+ !$title->equals( SpecialPage::getTitleFor( 'Recentchanges' ) ) &&
 52+ !$title->equals( SpecialPage::getTitleFor( 'Watchlist' ) ) )
 53+ {
 54+ return true;
 55+ }
4756 # Check cached results
4857 $key = wfMemcKey( 'confirmaccount', 'noticecount' );
4958 $count = $wgMemc->get( $key );

Status & tagging log