r84801 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84800‎ | r84801 | r84802 >
Date:15:37, 26 March 2011
Author:ashley
Status:deferred
Tags:
Comment:
SocialProfile: do not display the "Top by category" header in Special:TopUsers if the list definition message (MediaWiki:Topfans-by-category) is empty
Modified paths:
  • /trunk/extensions/SocialProfile/UserStats/TopUsers.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserStats/TopUsers.php
@@ -81,10 +81,16 @@
8282 // Build nav of stats by category based on MediaWiki:Topfans-by-category
8383 $by_category_title = SpecialPage::getTitleFor( 'TopFansByStatistic' );
8484
85 - $lines = explode( "\n", wfMsgForContent( 'topfans-by-category' ) );
 85+ $byCategoryMessage = wfMsgForContent( 'topfans-by-category' );
 86+ $lines = explode( "\n", $byCategoryMessage );
8687
87 - if ( count( $lines ) > 0 ) {
88 - $out .= '<h1 style="margin-top:15px !important;">' . wfMsg( 'top-fans-by-category-nav-header' ) . '</h1>';
 88+ if (
 89+ count( $lines ) > 0 &&
 90+ !wfEmptyMsg( 'topfans-by-category', $byCategoryMessage )
 91+ )
 92+ {
 93+ $out .= '<h1 style="margin-top:15px !important;">' .
 94+ wfMsg( 'top-fans-by-category-nav-header' ) . '</h1>';
8995 }
9096
9197 foreach ( $lines as $line ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r91841SocialProfile: remove some unused globals, shorten some lines and do not show...ashley18:03, 10 July 2011

Status & tagging log