initPage() is far too late to be setting a title, so we'll do it right after newFromK...
authorChad Horohoe <demon@users.mediawiki.org>
Wed, 15 Apr 2009 04:43:06 +0000 (04:43 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Wed, 15 Apr 2009 04:43:06 +0000 (04:43 +0000)
includes/Skin.php
includes/User.php

index f2305a5..cbab61c 100644 (file)
@@ -176,8 +176,6 @@ class Skin extends Linker {
 
                wfProfileIn( __METHOD__ );
 
-               $this->mTitle = $out->getTitle();
-
                # Generally the order of the favicon and apple-touch-icon links
                # should not matter, but Konqueror (3.5.9 at least) incorrectly
                # uses whichever one appears later in the HTML source.  Make sure
@@ -268,12 +266,23 @@ class Skin extends Linker {
                }
        }
 
-       function setMembers(){
+       /**
+        * Set some local globals
+        */
+       protected function setMembers(){
                global $wgUser;
                $this->mUser = $wgUser;
                $this->userpage = $wgUser->getUserPage()->getPrefixedText();
                $this->usercss = false;
        }
+       
+       /**
+        * Set the title
+        * @param Title $t The title to use
+        */
+       public function setTitle( $t ) {
+               $this->mTitle = $t;
+       }
 
        function outputPage( OutputPage $out ) {
                global $wgDebugComments;
index 4798294..8ab9b40 100644 (file)
@@ -2144,11 +2144,12 @@ class User {
        }
 
        /**
-        * Get the current skin, loading it if required
-        * @return \type{Skin} Current skin
+        * Get the current skin, loading it if required, and setting a title
+        * @param Title $t The title to use in the skin
+        * @return Skin The current skin
         * @todo FIXME : need to check the old failback system [AV]
         */
-       function &getSkin() {
+       function &getSkin( $t = null ) {
                global $wgRequest, $wgAllowUserSkin, $wgDefaultSkin;
                if ( ! isset( $this->mSkin ) ) {
                        wfProfileIn( __METHOD__ );
@@ -2165,6 +2166,11 @@ class User {
                        $this->mSkin =& Skin::newFromKey( $userSkin );
                        wfProfileOut( __METHOD__ );
                }
+               if ( !$t ) {
+                       global $wgOut;
+                       $t = $wgOut->getTitle();
+               }
+               $this->mSkin->setTitle( $t );
                return $this->mSkin;
        }