support for setting tab names of extra namespaces
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 27 Aug 2005 03:47:47 +0000 (03:47 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 27 Aug 2005 03:47:47 +0000 (03:47 +0000)
includes/SkinTemplate.php
includes/Title.php

index 732d38f..10e25e1 100644 (file)
@@ -502,9 +502,15 @@ class SkinTemplate extends Skin {
                        $classes[] = 'new';
                        $query = 'action=edit';
                }
+               
+               $text = wfMsg( $message );
+               if ( $text == "&lt;$message&gt;" ) {
+                       $text = wfMsg( 'nstab-main' );
+               }
+               
                return array(
                        'class' => implode( ' ', $classes ),
-                       'text' => wfMsg( $message ),
+                       'text' => $text,
                        'href' => $title->getLocalUrl( $query ) );
        }
 
@@ -858,7 +864,7 @@ class SkinTemplate extends Skin {
                        case NS_CATEGORY_TALK:
                                return 'nstab-category';
                        default:
-                               return 'nstab-main';
+                               return 'nstab-' . strtolower( $this->mTitle->getNsText() );
                }
        }
 
index 090dd90..0b58b60 100644 (file)
@@ -554,6 +554,15 @@ class Title {
         * @access public
         */
        function getNamespace() { return $this->mNamespace; }
+       /**
+        * Get the namespace text
+        * @return string
+        * @access public
+        */
+       function getNsText() { 
+               global $wgLang;
+               return $wgLang->getNsText( $this->mNamespace );
+       }
        /**
         * Get the interwiki prefix (or null string)
         * @return string