r20430 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20429‎ | r20430 | r20431 >
Date:01:55, 14 March 2007
Author:aaron
Status:old
Tags:
Comment:
*List restricted logs if $wgLogRestrictions is set
Modified paths:
  • /trunk/phase3/includes/SpecialSpecialpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialSpecialpages.php
@@ -14,10 +14,10 @@
1515 $sk = $wgUser->getSkin();
1616
1717 /** Pages available to all */
18 - wfSpecialSpecialpages_gen( SpecialPage::getRegularPages(), 'spheading', $sk );
 18+ wfSpecialSpecialpages_gen( SpecialPage::getRegularPages(), 'spheading', $sk, false );
1919
2020 /** Restricted special pages */
21 - wfSpecialSpecialpages_gen( SpecialPage::getRestrictedPages(), 'restrictedpheading', $sk );
 21+ wfSpecialSpecialpages_gen( SpecialPage::getRestrictedPages(), 'restrictedpheading', $sk, true );
2222 }
2323
2424 /**
@@ -25,9 +25,10 @@
2626 * @param $pages the list of pages
2727 * @param $heading header to be used
2828 * @param $sk skin object ???
 29+ * @param $restricted, restricted pages or not
2930 */
30 -function wfSpecialSpecialpages_gen($pages,$heading,$sk) {
31 - global $wgOut, $wgSortSpecialPages;
 31+function wfSpecialSpecialpages_gen($pages,$heading,$sk,$restricted) {
 32+ global $wgOut, $wgUser, $wgSortSpecialPages, $wgLogRestrictions, $wgLogNames;
3233
3334 if( count( $pages ) == 0 ) {
3435 # Yeah, that was pointless. Thanks for coming.
@@ -41,6 +42,17 @@
4243 $sortedPages[$page->getDescription()] = $page->getTitle();
4344 }
4445 }
 46+
 47+ # Add private logs
 48+ if ( $restricted && isset($wgLogRestrictions) ) {
 49+ foreach ( $wgLogRestrictions as $type => $restriction ) {
 50+ $page = SpecialPage::getTitleFor( 'Log', $type );
 51+ if ( $restriction != '' && $wgUser->isAllowed( $restriction ) ) {
 52+ $name = wfMsgHtml( $wgLogNames[$type] );
 53+ $sortedPages[$name] = $page;
 54+ }
 55+ }
 56+ }
4557
4658 /** Sort */
4759 if ( $wgSortSpecialPages ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r20781revert r20430; seems to have been tied into a reverted branch merge, uses con...brion18:10, 28 March 2007