Remove Special:Asksql; moving it out to an extension.
[lhc/web/wiklou.git] / includes / SpecialSpecialpages.php
1 <?php
2 /**
3 *
4 * @package MediaWiki
5 * @subpackage SpecialPage
6 */
7
8 /**
9 *
10 */
11 function wfSpecialSpecialpages() {
12 global $wgLang, $wgOut, $wgUser, $wgAvailableRights;
13
14 $wgOut->setRobotpolicy( 'index,nofollow' );
15 $sk = $wgUser->getSkin();
16
17 # Get listable pages
18 $pages = SpecialPage::getPages();
19
20 /** pages available to all */
21 wfSpecialSpecialpages_gen($pages[''],'spheading',$sk);
22
23 /** show pages splitted by user rights */
24 foreach($wgAvailableRights as $right) {
25 /** only show pages a user can access */
26 if( $wgUser->isAllowed($right) ) {
27 /** some rights might not have any special page associated */
28 if(isset($pages[$right])) {
29 wfSpecialSpecialpages_gen($pages[$right], $right.'pheading', $sk);
30 }
31 }
32
33 }
34
35 /** FIXME : spheading, sysopspheading, developerspheading need to be removed
36 from language files [av] */
37 /**
38 # all users special pages
39 wfSpecialSpecialpages_gen($pages[''],'spheading',$sk);
40
41 # sysops only special pages
42 if ( $wgUser->isSysop() ) {
43 wfSpecialSpecialpages_gen($pages['sysop'],'sysopspheading',$sk);
44 }
45
46 # developers only special pages
47 if ( $wgUser->isDeveloper() ) {
48 wfSpecialSpecialpages_gen($pages['developer'],'developerspheading',$sk);
49
50 }
51 */
52 }
53
54 /**
55 * sub function generating the list of pages
56 * @param $pages the list of pages
57 * @param $heading header to be used
58 * @param $sk skin object ???
59 */
60 function wfSpecialSpecialpages_gen($pages,$heading,$sk) {
61 global $wgLang, $wgOut;
62
63 $wgOut->addHTML( '<h2>' . wfMsg( $heading ) . "</h2>\n<ul>" );
64 foreach ( $pages as $name => $page ) {
65 if( !$page->isListed() ) {
66 continue;
67 }
68 $link = $sk->makeKnownLinkObj( $page->getTitle(), $page->getDescription() );
69 $wgOut->addHTML( "<li>{$link}</li>\n" );
70 }
71 $wgOut->addHTML( "</ul>\n" );
72 }
73
74 ?>