Do not register Special:JavaScriptTest, if disabled
[lhc/web/wiklou.git] / includes / SpecialPageFactory.php
index 6610451..8ed5264 100644 (file)
@@ -1,6 +1,29 @@
 <?php
 /**
- * SpecialPage: handling special pages and lists thereof.
+ * Factory for handling the special page list and generating SpecialPage objects.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup SpecialPage
+ * @defgroup SpecialPage SpecialPage
+ */
+
+/**
+ * Factory for handling the special page list and generating SpecialPage objects.
  *
  * To add a special page in an extension, add to $wgSpecialPages either
  * an object instance or an array containing the name and constructor
  * SpecialPage::$mList. To remove a core static special page at runtime, use
  * a SpecialPage_initList hook.
  *
- * @file
- * @ingroup SpecialPage
- * @defgroup SpecialPage SpecialPage
- */
-
-/**
- * Factory for handling the special page list and generating SpecialPage objects
  * @ingroup SpecialPage
  * @since 1.17
  */
@@ -118,6 +134,7 @@ class SpecialPageFactory {
                // High use pages
                'Mostlinkedcategories'      => 'MostlinkedCategoriesPage',
                'Mostimages'                => 'MostimagesPage',
+               'Mostinterwikis'            => 'MostinterwikisPage',
                'Mostlinked'                => 'MostlinkedPage',
                'Mostlinkedtemplates'       => 'MostlinkedTemplatesPage',
                'Mostcategories'            => 'MostcategoriesPage',
@@ -138,7 +155,6 @@ class SpecialPageFactory {
                'Blankpage'                 => 'SpecialBlankpage',
                'Blockme'                   => 'SpecialBlockme',
                'Emailuser'                 => 'SpecialEmailUser',
-               'JavaScriptTest'            => 'SpecialJavaScriptTest',
                'Movepage'                  => 'MovePageForm',
                'Mycontributions'           => 'SpecialMycontributions',
                'Mypage'                    => 'SpecialMypage',
@@ -161,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__ );
@@ -183,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 );
 
@@ -474,7 +494,7 @@ class SpecialPageFactory {
                // Execute special page
                $profName = 'Special:' . $page->getName();
                wfProfileIn( $profName );
-               $page->execute( $par );
+               $page->run( $par );
                wfProfileOut( $profName );
                wfProfileOut( __METHOD__ );
                return true;