From 37c91dbc0a809578062d61708a7918fbcc522169 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Thu, 9 Apr 2009 02:41:49 +0000 Subject: [PATCH] Cleanup, these can use mTitle rather than getting it from $wgOut. --- skins/CologneBlue.php | 6 +++--- skins/Standard.php | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 21bc1dc705..f78d8b27fa 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -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
"; @@ -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 ) ) { diff --git a/skins/Standard.php b/skins/Standard.php index 5c0cc5e727..69da703e48 100644 --- a/skins/Standard.php +++ b/skins/Standard.php @@ -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
"; $s .= "\n" . $this->logoText() . "\n
"; @@ -165,7 +165,7 @@ class SkinStandard extends Skin { } // only show watchlist link if logged in $s .= "\n
"; - $articleExists = $wgOut->getTitle()->getArticleId(); + $articleExists = $this->mTitle->getArticleId(); if ( $wgOut->isArticle() || $action == 'edit' || $action == 'history' || $wpPreview ) { if( $wgOut->isArticle() ) { $s .= '' . $this->editThisPage() . ''; @@ -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 .= '' . wfMsg( 'newpage' ) . ''; @@ -225,8 +225,8 @@ class SkinStandard extends Skin { } # "Post a comment" link - if( ( $wgOut->getTitle()->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview ) - $s .= '
' . $this->makeKnownLinkObj( $wgOut->getTitle(), wfMsg( 'postcomment' ), 'action=edit§ion=new' ); + if( ( $this->mTitle->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview ) + $s .= '
' . $this->makeKnownLinkObj( $this->mTitle, wfMsg( 'postcomment' ), 'action=edit§ion=new' ); #if( $tns%2 && $action!='edit' && !$wpPreview) { #$s.= '
'.$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg('postcomment'),'action=edit§ion=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(); -- 2.20.1