From 66091e9765f09fa964d3536986fe40f7731889bc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Fri, 20 Feb 2009 16:11:36 +0000 Subject: [PATCH] * (bug 17585) Hide legend on Special:Specialpages from non-privileged users --- RELEASE-NOTES | 1 + includes/specials/SpecialSpecialpages.php | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f8d90810f0..a6d1e2cf65 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -112,6 +112,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN $wgForeignFileRepos * Special:ListUsers: Sort list of usergroups by alphabet * (bug 16762) Special:Movepage now shows a list of subpages when possible +* (bug 17585) Hide legend on Special:Specialpages from non-privileged users === Bug fixes in 1.15 === * (bug 16968) Special:Upload no longer throws useless warnings. diff --git a/includes/specials/SpecialSpecialpages.php b/includes/specials/SpecialSpecialpages.php index 560ba445c8..4959f107eb 100644 --- a/includes/specials/SpecialSpecialpages.php +++ b/includes/specials/SpecialSpecialpages.php @@ -48,19 +48,21 @@ function wfSpecialSpecialpages() { $groups['other'] = $other; } + $includesRestrictedPages = false; /** Now output the HTML */ foreach ( $groups as $group => $sortedPages ) { $middle = ceil( count($sortedPages)/2 ); $total = count($sortedPages); $count = 0; - $wgOut->addHTML( "

".wfMsgHtml("specialpages-group-$group")."

\n" ); + $wgOut->wrapWikiMsg( "

$1

\n", "specialpages-group-$group" ); $wgOut->addHTML( "" ); $wgOut->addHTML( "
    \n" ); foreach( $sortedPages as $desc => $specialpage ) { list( $title, $restricted ) = $specialpage; $link = $sk->makeKnownLinkObj( $title , htmlspecialchars( $desc ) ); if( $restricted ) { + $includesRestrictedPages = true; $wgOut->addHTML( "
  • {$link}
  • \n" ); } else { $wgOut->addHTML( "
  • {$link}
  • \n" ); @@ -74,9 +76,8 @@ function wfSpecialSpecialpages() { } $wgOut->addHTML( "
\n" ); } - $wgOut->addHTML( - Xml::openElement('div', array( 'class' => 'mw-specialpages-notes' )). - wfMsgWikiHtml('specialpages-note'). - Xml::closeElement('div') - ); + + if ( $includesRestrictedPages ) { + $wgOut->wrapWikiMsg( "
\n$1\n
", 'specialpages-note' ); + } } -- 2.20.1