Use Doxygen @addtogroup instead of phpdoc @package && @subpackage
[lhc/web/wiklou.git] / includes / SpecialSpecialpages.php
1 <?php
2 /**
3 *
4 * @addtogroup SpecialPage
5 */
6
7 /**
8 *
9 */
10 function wfSpecialSpecialpages() {
11 global $wgOut, $wgUser;
12
13 $wgOut->setRobotpolicy( 'index,nofollow' );
14 $sk = $wgUser->getSkin();
15
16 /** Pages available to all */
17 wfSpecialSpecialpages_gen( SpecialPage::getRegularPages(), 'spheading', $sk );
18
19 /** Restricted special pages */
20 wfSpecialSpecialpages_gen( SpecialPage::getRestrictedPages(), 'restrictedpheading', $sk );
21 }
22
23 /**
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 ???
28 */
29 function wfSpecialSpecialpages_gen($pages,$heading,$sk) {
30 global $wgOut, $wgSortSpecialPages;
31
32 if( count( $pages ) == 0 ) {
33 # Yeah, that was pointless. Thanks for coming.
34 return;
35 }
36
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();
42 }
43 }
44
45 /** Sort */
46 if ( $wgSortSpecialPages ) {
47 ksort( $sortedPages );
48 }
49
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" );
55 }
56 $wgOut->addHTML( "</ul>\n" );
57 }
58
59 ?>