Merge "Adding NamespaceIsMovable hook to isMovable in MWNamespace, much like done...
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 14 May 2012 22:23:46 +0000 (22:23 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 14 May 2012 22:23:46 +0000 (22:23 +0000)
1  2 
RELEASE-NOTES-1.20
includes/Namespace.php

diff --combined RELEASE-NOTES-1.20
@@@ -23,6 -23,8 +23,8 @@@ upgrade PHP if you have not done so pri
  
  === New features in 1.20 ===
  * Added TitleIsAlwaysKnown hook which gets called when determining if a page exists.
+ * Added NamespaceIsMovable hook which gets called when determining if pages in a
+   certain namespace can be moved.
  * (bug 32341) Add upload by URL domain limitation.
  * &useskin=default will now always display the default skin. Useful for users with a
    preference for the non-default skin to look at something using the default skin.
  * (bug 5445) Now remove autoblocks when a user is unblocked.
  * Added $wgLogExceptionBacktrace, on by default, to allow logging of exception
    backtraces.
 +* Added device detection for determining device capabilities.
 +* QUnit.newMwEnvironment now supports passing a custom setup and/or teardown function.
 +  Arguments signature has changed. First arguments is now an options object of which
 +  'config' can be a property. Previously 'config' itself was the first and only argument.
  
  === Bug fixes in 1.20 ===
  * (bug 30245) Use the correct way to construct a log page title.
diff --combined includes/Namespace.php
@@@ -1,22 -1,6 +1,22 @@@
  <?php
  /**
 - * Provide things related to namespaces
 + * Provide things related to namespaces.
 + *
 + * 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
   */
  
@@@ -30,6 -14,7 +30,6 @@@
   * Users and translators should not change them
   *
   */
 -
  class MWNamespace {
  
        /**
         */
        public static function isMovable( $index ) {
                global $wgAllowImageMoving;
-               return !( $index < NS_MAIN || ( $index == NS_FILE && !$wgAllowImageMoving )  || $index == NS_CATEGORY );
+               $result = !( $index < NS_MAIN || ( $index == NS_FILE && !$wgAllowImageMoving )  || $index == NS_CATEGORY );
+               /**
+                * @since 1.20
+                */
+               wfRunHooks( 'NamespaceIsMovable', array( $index, &$result ) );
+               return $result;
        }
  
        /**
         * @param $index int Index to check
         * @return bool
         */
 -      public static function isNonincludableNamespace( $index ) {
 +      public static function isNonincludable( $index ) {
                global $wgNonincludableNamespaces;
                return $wgNonincludableNamespaces && in_array( $index, $wgNonincludableNamespaces );
        }