X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSpecialSpecialpages.php;h=0b53db73c124382366f095d7486f4a1c6e6b59b9;hb=44d31b681fc83aecc819a78662a5d75a4a8655b7;hp=bc59328500685b8a9d313484d27335c531f12ff6;hpb=28ea816fbafe96825d3c35187a12cadafca6905f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialSpecialpages.php b/includes/SpecialSpecialpages.php index bc59328500..0b53db73c1 100644 --- a/includes/SpecialSpecialpages.php +++ b/includes/SpecialSpecialpages.php @@ -9,46 +9,29 @@ * */ function wfSpecialSpecialpages() { - global $wgLang, $wgOut, $wgUser, $wgAvailableRights; - + global $wgOut, $wgUser, $wgAvailableRights; + $wgOut->setRobotpolicy( 'index,nofollow' ); - $sk = $wgUser->getSkin(); - - # Get listable pages + $sk = $wgUser->getSkin(); + + # Get listable pages, in a 2-d array with the first dimension being user right $pages = SpecialPage::getPages(); - /** pages available to all */ + /** Pages available to all */ wfSpecialSpecialpages_gen($pages[''],'spheading',$sk); - /** show pages splitted by user rights */ + /** Restricted special pages */ + $rpages = array(); foreach($wgAvailableRights as $right) { /** only show pages a user can access */ if( $wgUser->isAllowed($right) ) { /** some rights might not have any special page associated */ if(isset($pages[$right])) { - wfSpecialSpecialpages_gen($pages[$right], $right.'pheading', $sk); + $rpages = array_merge( $rpages, $pages[$right] ); } } - - } - -/** FIXME : spheading, sysopspheading, developerspheading need to be removed -from language files [av] */ -/** - # all users special pages - wfSpecialSpecialpages_gen($pages[''],'spheading',$sk); - - # sysops only special pages - if ( $wgUser->isSysop() ) { - wfSpecialSpecialpages_gen($pages['sysop'],'sysopspheading',$sk); - } - - # developers only special pages - if ( $wgUser->isDeveloper() ) { - wfSpecialSpecialpages_gen($pages['developer'],'developerspheading',$sk); - } -*/ + wfSpecialSpecialpages_gen( $rpages, 'restrictedpheading', $sk ); } /** @@ -58,14 +41,30 @@ from language files [av] */ * @param $sk skin object ??? */ function wfSpecialSpecialpages_gen($pages,$heading,$sk) { - global $wgLang, $wgOut, $wgAllowSysopQueries; + global $wgOut, $wgSortSpecialPages; + + if( count( $pages ) == 0 ) { + # Yeah, that was pointless. Thanks for coming. + return; + } - $wgOut->addHTML( '

' . wfMsg( $heading ) . "

\n