class QueryPage {
# Subclasses return their name here. Make sure the name is also
- # specified in Language.php, both in the $wgValidSpecialPagesEn
- # variable, and as a language message param.
+ # specified in SpecialPage.php and in Language.php as a language message param.
function getName() {
return "";
function feedTitle() {
global $wgLanguageCode, $wgSitename, $wgLang;
- $pages = $wgLang->getValidSpecialPages();
- $title = $pages[$this->getName()];
- return "$wgSitename - $title [$wgLanguageCode]";
+ $page = SpecialPage::getPage( $this->getName() );
+ $desc = $page->getDescription();
+ return "$wgSitename - $desc [$wgLanguageCode]";
}
function feedDesc() {
{
global $wgUser, $wgOut, $wgLang, $wgServer, $wgRedirectScript;
$a = array();
-
- $validSP = $wgLang->getValidSpecialPages();
-
- foreach ( $validSP as $name => $desc ) {
- if ( "" == $desc ) { continue; }
- $a[$name] = $desc;
+ $pages = SpecialPage::getPages();
+
+ foreach ( $pages[""] as $name => $page ) {
+ $a[$name] = $page->getDescription();
}
if ( $wgUser->isSysop() )
{
- $sysopSP = $wgLang->getSysopSpecialPages();
-
- foreach ( $sysopSP as $name => $desc ) {
- if ( "" == $desc ) { continue; }
- $a[$name] = $desc ;
+ foreach ( $pages["sysop"] as $name => $page ) {
+ $a[$name] = $page->getDescription();
}
}
if ( $wgUser->isDeveloper() )
{
- $devSP = $wgLang->getDeveloperSpecialPages();
-
- foreach ( $devSP as $name => $desc ) {
- if ( "" == $desc ) { continue; }
- $a[$name] = $desc ;
+ foreach ( $pages["developer"] as $name => $page ) {
+ $a[$name] = $page->getDescription() ;
}
}
$go = wfMsg( "go" );
}
}
+ # Return categorised listable special pages
+ /* static */ function getPages() {
+ global $wgSpecialPages;
+ $pages = array(
+ "" => array(),
+ "sysop" => array(),
+ "developer" => array()
+ );
+
+ foreach ( $wgSpecialPages as $name => $page ) {
+ if ( $page->isListed() ) {
+ $pages[$page->getRestriction()][$page->getName()] =& $wgSpecialPages[$name];
+ }
+ }
+ return $pages;
+ }
+
# Execute a special page path, which may contain slashes
/* static */ function executePath( &$title ) {
global $wgSpecialPages, $wgOut, $wgTitle;
function wfSpecialSpecialpages()
{
- global $wgLang, $wgOut, $wgUser, $wgSpecialPages;
+ global $wgLang, $wgOut, $wgUser;
$wgOut->setRobotpolicy( "index,nofollow" );
$sk = $wgUser->getSkin();
-
- # Categorise special pages
-
- $pages = array(
- "" => array(),
- "sysop" => array(),
- "developer" => array()
- );
-
- foreach ( $wgSpecialPages as $page ) {
- $pages[$page->getRestriction()][$page->getName()] = $page;
- }
-
+
+ # Get listable pages
+ $pages = SpecialPage::getPages();
# all users special pages
wfSpecialSpecialpages_gen($pages[""],"spheading",$sk);