Cleanup, these can use mTitle rather than getting it from $wgOut.
authorChad Horohoe <demon@users.mediawiki.org>
Thu, 9 Apr 2009 02:41:49 +0000 (02:41 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Thu, 9 Apr 2009 02:41:49 +0000 (02:41 +0000)
skins/CologneBlue.php
skins/Standard.php

index 21bc1dc..f78d8b2 100644 (file)
@@ -127,7 +127,7 @@ class SkinCologneBlue extends Skin {
                $li = $wgContLang->specialPage( 'Userlogin' );
                $lo = $wgContLang->specialPage( 'Userlogout' );
 
-               $rt = $wgOut->getTitle()->getPrefixedURL();
+               $rt = $this->mTitle->getPrefixedURL();
                if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
                        $q = '';
                } else {
@@ -165,7 +165,7 @@ class SkinCologneBlue extends Skin {
        function quickBar(){
                global $wgOut, $wgUser, $wgEnableUploads;
 
-               $tns = $wgOut->getTitle()->getNamespace();
+               $tns = $this->mTitle->getNamespace();
 
                $s = "\n<div id='quickbar'>";
 
@@ -228,7 +228,7 @@ class SkinCologneBlue extends Skin {
                          . $sep . $this->watchPageLinksLink();
 
                        if( $tns == NS_USER || $tns == NS_USER_TALK ) {
-                               $id = User::idFromName( $wgOut->getTitle()->getText() );
+                               $id = User::idFromName( $this->mTitle->getText() );
                                if( $id != 0 ) {
                                        $s .= $sep . $this->userContribsLink();
                                        if( $this->showEmailUser( $id ) ) {
index 5c0cc5e..69da703 100644 (file)
@@ -137,7 +137,7 @@ class SkinStandard extends Skin {
 
                $action = $wgRequest->getText( 'action' );
                $wpPreview = $wgRequest->getBool( 'wpPreview' );
-               $tns = $wgOut->getTitle()->getNamespace();
+               $tns = $this->mTitle->getNamespace();
 
                $s = "\n<div id='quickbar'>";
                $s .= "\n" . $this->logoText() . "\n<hr class='sep' />";
@@ -165,7 +165,7 @@ class SkinStandard extends Skin {
                }
                // only show watchlist link if logged in
                $s .= "\n<hr class='sep' />";
-               $articleExists = $wgOut->getTitle()->getArticleId();
+               $articleExists = $this->mTitle->getArticleId();
                if ( $wgOut->isArticle() || $action == 'edit' || $action == 'history' || $wpPreview ) {
                        if( $wgOut->isArticle() ) {
                                $s .= '<strong>' . $this->editThisPage() . '</strong>';
@@ -210,13 +210,13 @@ class SkinStandard extends Skin {
                                                        $text = wfMsg( 'articlepage' );
                                        }
 
-                                       $link = $wgOut->getTitle()->getText();
+                                       $link = $this->mTitle->getText();
                                        if( $nstext = $wgContLang->getNsText( $tns ) ) { # add namespace if necessary
                                                $link = $nstext . ':' . $link;
                                        }
 
                                        $s .= $this->makeLink( $link, $text );
-                               } elseif( $wgOut->getTitle()->getNamespace() != NS_SPECIAL ) {
+                               } elseif( $this->mTitle->getNamespace() != NS_SPECIAL ) {
                                        # we just throw in a "New page" text to tell the user that he's in edit mode,
                                        # and to avoid messing with the separator that is prepended to the next item
                                        $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
@@ -225,8 +225,8 @@ class SkinStandard extends Skin {
                        }
 
                        # "Post a comment" link
-                       if( ( $wgOut->getTitle()->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
-                               $s .= '<br />' . $this->makeKnownLinkObj( $wgOut->getTitle(), wfMsg( 'postcomment' ), 'action=edit&section=new' );
+                       if( ( $this->mTitle->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
+                               $s .= '<br />' . $this->makeKnownLinkObj( $this->mTitle, wfMsg( 'postcomment' ), 'action=edit&section=new' );
                        
                        #if( $tns%2 && $action!='edit' && !$wpPreview) {
                                #$s.= '<br />'.$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg('postcomment'),'action=edit&section=new');
@@ -242,7 +242,7 @@ class SkinStandard extends Skin {
                                if( $action != 'edit' && $action != 'submit' ){
                                        $s .= $sep . $this->watchThisPage();
                                }
-                               if ( $wgOut->getTitle()->userCan( 'edit' ) )
+                               if ( $this->mTitle->userCan( 'edit' ) )
                                        $s .= $sep . $this->moveThisPage();
                        }
                        if ( $wgUser->isAllowed( 'delete' ) and $articleExists ) {
@@ -259,11 +259,11 @@ class SkinStandard extends Skin {
                                $s .= $sep . $this->watchPageLinksLink();
                        }
 
-                       if ( NS_USER == $wgOut->getTitle()->getNamespace()
-                               || $wgOut->getTitle()->getNamespace() == NS_USER_TALK ) {
+                       if ( NS_USER == $this->mTitle->getNamespace()
+                               || $this->mTitle->getNamespace() == NS_USER_TALK ) {
 
-                               $id = User::idFromName( $wgOut->getTitle()->getText() );
-                               $ip = User::isIP( $wgOut->getTitle()->getText() );
+                               $id = User::idFromName( $this->mTitle->getText() );
+                               $ip = User::isIP( $this->mTitle->getText() );
 
                                if( $id || $ip ){
                                        $s .= $sep . $this->userContribsLink();