Revert r24105, r24106, r24107 'security fix' forbidden text/css and text/javascript...
[lhc/web/wiklou.git] / includes / Namespace.php
index c296de9..ebb2bce 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 /**
  * Provide things related to namespaces
- * @package MediaWiki
  */
 
 /**
@@ -41,7 +40,6 @@ if( is_array( $wgExtraNamespaces ) ) {
  * These are synonyms for the names given in the language file
  * Users and translators should not change them
  *
- * @package MediaWiki
  */
 class Namespace {
 
@@ -50,7 +48,7 @@ class Namespace {
         * @return bool
         */
        static function isMovable( $index ) {
-               return !( $index < NS_MAIN || $index == NS_IMAGE );
+               return !( $index < NS_MAIN || $index == NS_IMAGE  || $index == NS_CATEGORY );
        }
 
        /**
@@ -125,5 +123,29 @@ class Namespace {
         static function canTalk( $index ) {
                return( $index >= NS_MAIN );
         }
+        
+       /**
+        * Does this namespace contain content, for the purposes
+        * of calculating statistics, etc?
+        *
+        * @param $index Index to check
+        * @return bool
+        */
+       public static function isContent( $index ) {
+               global $wgContentNamespaces;
+               return $index == NS_MAIN || in_array( $index, $wgContentNamespaces );
+       }
+       
+       /**
+        * Can pages in a namespace be watched?
+        *
+        * @param int $index
+        * @return bool
+        */
+       public static function isWatchable( $index ) {
+               return $index >= NS_MAIN;
+       }
+        
 }
-?>
+
+