<?php
/**
* Provide things related to namespaces
- * @package MediaWiki
*/
/**
* These are synonyms for the names given in the language file
* Users and translators should not change them
*
- * @package MediaWiki
*/
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 );
}
/**
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;
+ }
+
}
-?>
+
+