Tweak for r39314: don't add a line break before the "Go" button on the watchlist...
[lhc/web/wiklou.git] / includes / Namespace.php
index 6797425..7c7b7de 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 /**
  * Provide things related to namespaces
+ * @file
  */
 
 /**
@@ -47,7 +48,7 @@ class MWNamespace {
        /**
         * Can pages in the given namespace be moved?
         *
-        * @param int $index Namespace index
+        * @param $index Int: namespace index
         * @return bool
         */
        public static function isMovable( $index ) {
@@ -58,7 +59,7 @@ class MWNamespace {
        /**
         * Is the given namespace is a subject (non-talk) namespace?
         *
-        * @param int $index Namespace index
+        * @param $index Int: namespace index
         * @return bool
         */
        public static function isMain( $index ) {
@@ -68,7 +69,7 @@ class MWNamespace {
        /**
         * Is the given namespace a talk namespace?
         *
-        * @param int $index Namespace index
+        * @param $index Int: namespace index
         * @return bool
         */
        public static function isTalk( $index ) {
@@ -79,7 +80,7 @@ class MWNamespace {
        /**
         * Get the talk namespace index for a given namespace
         *
-        * @param int $index Namespace index
+        * @param $index Int: namespace index
         * @return int
         */
        public static function getTalk( $index ) {
@@ -91,7 +92,7 @@ class MWNamespace {
        /**
         * Get the subject namespace index for a given namespace
         *
-        * @param int $index Namespace index
+        * @param $index Int: Namespace index
         * @return int
         */
        public static function getSubject( $index ) {
@@ -103,7 +104,7 @@ class MWNamespace {
        /**
         * Returns the canonical (English Wikipedia) name for a given index
         *
-        * @param int $index Namespace index
+        * @param $index Int: namespace index
         * @return string
         */
        public static function getCanonicalName( $index ) {
@@ -115,7 +116,7 @@ class MWNamespace {
         * Returns the index for a given canonical name, or NULL
         * The input *must* be converted to lower case first
         *
-        * @param string $name Namespace name
+        * @param $name String: namespace name
         * @return int
         */
        public static function getCanonicalIndex( $name ) {
@@ -137,7 +138,7 @@ class MWNamespace {
        /**
         * Can this namespace ever have a talk namespace?
         *
-        * @param $index Namespace index
+        * @param $index Int: namespace index
         * @return bool
         */
         public static function canTalk( $index ) {
@@ -145,10 +146,10 @@ class MWNamespace {
         }
 
        /**
-        * Does this namespace contain content, for the purposes
-        * of calculating statistics, etc?
+        * Does this namespace contain content, for the purposes of calculating
+        * statistics, etc?
         *
-        * @param $index Index to check
+        * @param $index Int: index to check
         * @return bool
         */
        public static function isContent( $index ) {
@@ -159,11 +160,22 @@ class MWNamespace {
        /**
         * Can pages in a namespace be watched?
         *
-        * @param int $index
+        * @param $index Int
         * @return bool
         */
        public static function isWatchable( $index ) {
                return $index >= NS_MAIN;
        }
 
+       /**
+        * Does the namespace allow subpages?
+        *
+        * @param $index int Index to check
+        * @return bool
+        */
+       public static function hasSubpages( $index ) {
+               global $wgNamespacesWithSubpages;
+               return !empty( $wgNamespacesWithSubpages[$index] );
+       }
+
 }