4 * @addtogroup SpecialPage
10 function wfSpecialSpecialpages() {
11 global $wgOut, $wgUser, $wgMessageCache;
13 $wgMessageCache->loadAllMessages();
15 $wgOut->setRobotpolicy( 'index,nofollow' );
16 $sk = $wgUser->getSkin();
18 /** Pages available to all */
19 wfSpecialSpecialpages_gen( SpecialPage
::getRegularPages(), 'spheading', $sk, false );
21 /** Restricted special pages */
22 wfSpecialSpecialpages_gen( SpecialPage
::getRestrictedPages(), 'restrictedpheading', $sk, false );
24 /** Restricted logs */
25 wfSpecialSpecialpages_gen( SpecialPage
::getRestrictedLogs(), 'restrictedlheading', $sk, true );
29 * sub function generating the list of pages
30 * @param $pages the list of pages
31 * @param $heading header to be used
32 * @param $sk skin object ???
33 * @param $islog, is this for a list of log types?
35 function wfSpecialSpecialpages_gen( $pages, $heading, $sk, $islog=false ) {
36 global $wgOut, $wgUser, $wgSortSpecialPages;
38 if( count( $pages ) == 0 ) {
39 # Yeah, that was pointless. Thanks for coming.
43 /** Put them into a sortable array */
44 $sortedPages = array();
46 $sortedPages = $pages;
48 foreach ( $pages as $page ) {
49 if ( $page->isListed() ) {
50 $sortedPages[$page->getDescription()] = $page->getTitle();
56 if ( $wgSortSpecialPages ) {
57 ksort( $sortedPages );
60 /** Now output the HTML */
61 $wgOut->addHTML( '<h2>' . wfMsgHtml( $heading ) . "</h2>\n<ul>" );
62 foreach ( $sortedPages as $desc => $title ) {
63 $link = $sk->makeKnownLinkObj( $title , htmlspecialchars( $desc ) );
64 $wgOut->addHTML( "<li>{$link}</li>\n" );
66 $wgOut->addHTML( "</ul>\n" );