Index: trunk/phase3/includes/SpecialSpecialpages.php |
— | — | @@ -14,10 +14,10 @@ |
15 | 15 | $sk = $wgUser->getSkin(); |
16 | 16 | |
17 | 17 | /** Pages available to all */ |
18 | | - wfSpecialSpecialpages_gen( SpecialPage::getRegularPages(), 'spheading', $sk ); |
| 18 | + wfSpecialSpecialpages_gen( SpecialPage::getRegularPages(), 'spheading', $sk, false ); |
19 | 19 | |
20 | 20 | /** Restricted special pages */ |
21 | | - wfSpecialSpecialpages_gen( SpecialPage::getRestrictedPages(), 'restrictedpheading', $sk ); |
| 21 | + wfSpecialSpecialpages_gen( SpecialPage::getRestrictedPages(), 'restrictedpheading', $sk, true ); |
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
— | — | @@ -25,9 +25,10 @@ |
26 | 26 | * @param $pages the list of pages |
27 | 27 | * @param $heading header to be used |
28 | 28 | * @param $sk skin object ??? |
| 29 | + * @param $restricted, restricted pages or not |
29 | 30 | */ |
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; |
32 | 33 | |
33 | 34 | if( count( $pages ) == 0 ) { |
34 | 35 | # Yeah, that was pointless. Thanks for coming. |
— | — | @@ -41,6 +42,17 @@ |
42 | 43 | $sortedPages[$page->getDescription()] = $page->getTitle(); |
43 | 44 | } |
44 | 45 | } |
| 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 | + } |
45 | 57 | |
46 | 58 | /** Sort */ |
47 | 59 | if ( $wgSortSpecialPages ) { |