r47562 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47561‎ | r47562 | r47563 >
Date:16:11, 20 February 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
* (bug 17585) Hide legend on Special:Specialpages from non-privileged users
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialSpecialpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialSpecialpages.php
@@ -48,19 +48,21 @@
4949 $groups['other'] = $other;
5050 }
5151
 52+ $includesRestrictedPages = false;
5253 /** Now output the HTML */
5354 foreach ( $groups as $group => $sortedPages ) {
5455 $middle = ceil( count($sortedPages)/2 );
5556 $total = count($sortedPages);
5657 $count = 0;
5758
58 - $wgOut->addHTML( "<h4 class='mw-specialpagesgroup'>".wfMsgHtml("specialpages-group-$group")."</h4>\n" );
 59+ $wgOut->wrapWikiMsg( "<h4 class='mw-specialpagesgroup'>$1</h4>\n", "specialpages-group-$group" );
5960 $wgOut->addHTML( "<table style='width: 100%;' class='mw-specialpages-table'><tr>" );
6061 $wgOut->addHTML( "<td width='30%' valign='top'><ul>\n" );
6162 foreach( $sortedPages as $desc => $specialpage ) {
6263 list( $title, $restricted ) = $specialpage;
6364 $link = $sk->makeKnownLinkObj( $title , htmlspecialchars( $desc ) );
6465 if( $restricted ) {
 66+ $includesRestrictedPages = true;
6567 $wgOut->addHTML( "<li class='mw-specialpages-page mw-specialpagerestricted'>{$link}</li>\n" );
6668 } else {
6769 $wgOut->addHTML( "<li>{$link}</li>\n" );
@@ -74,9 +76,8 @@
7577 }
7678 $wgOut->addHTML( "</ul></td><td width='30%' valign='top'></td></tr></table>\n" );
7779 }
78 - $wgOut->addHTML(
79 - Xml::openElement('div', array( 'class' => 'mw-specialpages-notes' )).
80 - wfMsgWikiHtml('specialpages-note').
81 - Xml::closeElement('div')
82 - );
 80+
 81+ if ( $includesRestrictedPages ) {
 82+ $wgOut->wrapWikiMsg( "<div class=\"mw-specialpages-notes\">\n$1\n</div>", 'specialpages-note' );
 83+ }
8384 }
Index: trunk/phase3/RELEASE-NOTES
@@ -112,6 +112,7 @@
113113 $wgForeignFileRepos
114114 * Special:ListUsers: Sort list of usergroups by alphabet
115115 * (bug 16762) Special:Movepage now shows a list of subpages when possible
 116+* (bug 17585) Hide legend on Special:Specialpages from non-privileged users
116117
117118 === Bug fixes in 1.15 ===
118119 * (bug 16968) Special:Upload no longer throws useless warnings.

Status & tagging log