'Upload' => 'SpecialUpload',
'UploadStash' => 'SpecialUploadStash',
- // Wiki data and tools
+ // Data and tools
'Statistics' => 'SpecialStatistics',
'Allmessages' => 'SpecialAllmessages',
'Version' => 'SpecialVersion',
'Blankpage' => 'SpecialBlankpage',
'Blockme' => 'SpecialBlockme',
'Emailuser' => 'SpecialEmailUser',
- 'JavaScriptTest' => 'SpecialJavaScriptTest',
'Movepage' => 'MovePageForm',
'Mycontributions' => 'SpecialMycontributions',
'Mypage' => 'SpecialMypage',
static function getList() {
global $wgSpecialPages;
global $wgDisableCounters, $wgDisableInternalSearch, $wgEmailAuthentication;
- global $wgEnableEmail;
+ global $wgEnableEmail, $wgEnableJavaScriptTest;
if ( !is_object( self::$mList ) ) {
wfProfileIn( __METHOD__ );
self::$mList['ChangeEmail'] = 'SpecialChangeEmail';
}
+ if( $wgEnableJavaScriptTest ) {
+ self::$mList['JavaScriptTest'] = 'SpecialJavaScriptTest';
+ }
+
// Add extension special pages
self::$mList = array_merge( self::$mList, $wgSpecialPages );
* Find the object with a given name and return it (or NULL)
*
* @param $name String Special page name, may be localised and/or an alias
- * @return SpecialPage object or null if the page doesn't exist
+ * @return SpecialPage|null SpecialPage object or null if the page doesn't exist
*/
public static function getPage( $name ) {
list( $realName, /*...*/ ) = self::resolveAlias( $name );
}
foreach ( self::getList() as $name => $rec ) {
$page = self::getPage( $name );
- if ( $page // not null
- && $page->isListed()
- && ( !$page->isRestricted() || $page->userCanExecute( $user ) )
- ) {
- $pages[$name] = $page;
+ if ( $page ) { // not null
+ $page->setContext( RequestContext::getMain() );
+ if ( $page->isListed()
+ && ( !$page->isRestricted() || $page->userCanExecute( $user ) )
+ ) {
+ $pages[$name] = $page;
+ }
}
}
return $pages;