4 * @addtogroup SpecialPage
10 function wfSpecialSpecialpages() {
11 global $wgOut, $wgUser;
13 $wgOut->setRobotpolicy( 'index,nofollow' );
14 $sk = $wgUser->getSkin();
16 /** Pages available to all */
17 wfSpecialSpecialpages_gen( SpecialPage
::getRegularPages(), 'spheading', $sk );
19 /** Restricted special pages */
20 wfSpecialSpecialpages_gen( SpecialPage
::getRestrictedPages(), 'restrictedpheading', $sk );
24 * sub function generating the list of pages
25 * @param $pages the list of pages
26 * @param $heading header to be used
27 * @param $sk skin object ???
29 function wfSpecialSpecialpages_gen($pages,$heading,$sk) {
30 global $wgOut, $wgSortSpecialPages;
32 if( count( $pages ) == 0 ) {
33 # Yeah, that was pointless. Thanks for coming.
37 /** Put them into a sortable array */
38 $sortedPages = array();
39 foreach ( $pages as $page ) {
40 if ( $page->isListed() ) {
41 $sortedPages[$page->getDescription()] = $page->getTitle();
46 if ( $wgSortSpecialPages ) {
47 ksort( $sortedPages );
50 /** Now output the HTML */
51 $wgOut->addHTML( '<h2>' . wfMsgHtml( $heading ) . "</h2>\n<ul>" );
52 foreach ( $sortedPages as $desc => $title ) {
53 $link = $sk->makeKnownLinkObj( $title , htmlspecialchars( $desc ) );
54 $wgOut->addHTML( "<li>{$link}</li>\n" );
56 $wgOut->addHTML( "</ul>\n" );