Merge "Update docs"
[lhc/web/wiklou.git] / includes / SpecialPageFactory.php
index 1d62e8b..0e0fb33 100644 (file)
@@ -134,6 +134,7 @@ class SpecialPageFactory {
                // High use pages
                'Mostlinkedcategories'      => 'MostlinkedCategoriesPage',
                'Mostimages'                => 'MostimagesPage',
+               'Mostinterwikis'            => 'MostinterwikisPage',
                'Mostlinked'                => 'MostlinkedPage',
                'Mostlinkedtemplates'       => 'MostlinkedTemplatesPage',
                'Mostcategories'            => 'MostcategoriesPage',
@@ -154,7 +155,6 @@ class SpecialPageFactory {
                'Blankpage'                 => 'SpecialBlankpage',
                'Blockme'                   => 'SpecialBlockme',
                'Emailuser'                 => 'SpecialEmailUser',
-               'JavaScriptTest'            => 'SpecialJavaScriptTest',
                'Movepage'                  => 'MovePageForm',
                'Mycontributions'           => 'SpecialMycontributions',
                'Mypage'                    => 'SpecialMypage',
@@ -177,7 +177,7 @@ class SpecialPageFactory {
        static function getList() {
                global $wgSpecialPages;
                global $wgDisableCounters, $wgDisableInternalSearch, $wgEmailAuthentication;
-               global $wgEnableEmail;
+               global $wgEnableEmail, $wgEnableJavaScriptTest;
 
                if ( !is_object( self::$mList ) ) {
                        wfProfileIn( __METHOD__ );
@@ -199,6 +199,10 @@ class SpecialPageFactory {
                                self::$mList['ChangeEmail'] = 'SpecialChangeEmail';
                        }
 
+                       if( $wgEnableJavaScriptTest ) {
+                               self::$mList['JavaScriptTest'] = 'SpecialJavaScriptTest';
+                       }
+
                        // Add extension special pages
                        self::$mList = array_merge( self::$mList, $wgSpecialPages );
 
@@ -369,11 +373,13 @@ class SpecialPageFactory {
                }
                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;