Merge "Move HTMLForm-specific styles out of mediawiki.legacy.shared"
[lhc/web/wiklou.git] / includes / MWNamespace.php
index 392f558..8ca205a 100644 (file)
@@ -72,7 +72,7 @@ class MWNamespace {
                /**
                 * @since 1.20
                 */
-               wfRunHooks( 'NamespaceIsMovable', array( $index, &$result ) );
+               Hooks::run( 'NamespaceIsMovable', array( $index, &$result ) );
 
                return $result;
        }
@@ -210,10 +210,12 @@ class MWNamespace {
                if ( $namespaces === null || $rebuild ) {
                        global $wgExtraNamespaces, $wgCanonicalNamespaceNames;
                        $namespaces = array( NS_MAIN => '' ) + $wgCanonicalNamespaceNames;
+                       // Add extension namespaces
+                       $namespaces += ExtensionRegistry::getInstance()->getAttribute( 'ExtensionNamespaces' );
                        if ( is_array( $wgExtraNamespaces ) ) {
                                $namespaces += $wgExtraNamespaces;
                        }
-                       wfRunHooks( 'CanonicalNamespaces', array( &$namespaces ) );
+                       Hooks::run( 'CanonicalNamespaces', array( &$namespaces ) );
                }
                return $namespaces;
        }
@@ -296,6 +298,18 @@ class MWNamespace {
                return $index == NS_MAIN || in_array( $index, $wgContentNamespaces );
        }
 
+       /**
+        * Might pages in this namespace require the use of the Signature button on
+        * the edit toolbar?
+        *
+        * @param int $index Index to check
+        * @return bool
+        */
+       public static function wantSignatures( $index ) {
+               global $wgExtraSignatureNamespaces;
+               return self::isTalk( $index ) || in_array( $index, $wgExtraSignatureNamespaces );
+       }
+
        /**
         * Can pages in a namespace be watched?
         *