Merge "pass codesniffer on tests/"
[lhc/web/wiklou.git] / includes / Namespace.php
index e8d5632..46af002 100644 (file)
@@ -419,4 +419,18 @@ class MWNamespace {
                return $wgNonincludableNamespaces && in_array( $index, $wgNonincludableNamespaces );
        }
 
+       /**
+        * Get the default content model for a namespace
+        * This does not mean that all pages in that namespace have the model
+        *
+        * @since 1.21
+        * @param $index int Index to check
+        * @return null|string default model name for the given namespace, if set
+        */
+       public static function getNamespaceContentModel( $index ) {
+               global $wgNamespaceContentModels;
+               return isset( $wgNamespaceContentModels[$index] )
+                       ? $wgNamespaceContentModels[$index]
+                       : null;
+       }
 }