Implement ApiPageSet::setRedirectMergePolicy()
[lhc/web/wiklou.git] / includes / MWNamespace.php
index bd68551..0dd709f 100644 (file)
@@ -210,6 +210,8 @@ 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;
                        }
@@ -269,6 +271,8 @@ class MWNamespace {
                                        $mValidNamespaces[] = $ns;
                                }
                        }
+                       // T109137: sort numerically
+                       sort( $mValidNamespaces, SORT_NUMERIC );
                }
 
                return $mValidNamespaces;
@@ -296,6 +300,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?
         *