r49326 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49325‎ | r49326 | r49327 >
Date:02:41, 9 April 2009
Author:demon
Status:ok
Tags:
Comment:
Cleanup, these can use mTitle rather than getting it from $wgOut.
Modified paths:
  • /trunk/phase3/skins/CologneBlue.php (modified) (history)
  • /trunk/phase3/skins/Standard.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/CologneBlue.php
@@ -127,7 +127,7 @@
128128 $li = $wgContLang->specialPage( 'Userlogin' );
129129 $lo = $wgContLang->specialPage( 'Userlogout' );
130130
131 - $rt = $wgOut->getTitle()->getPrefixedURL();
 131+ $rt = $this->mTitle->getPrefixedURL();
132132 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
133133 $q = '';
134134 } else {
@@ -165,7 +165,7 @@
166166 function quickBar(){
167167 global $wgOut, $wgUser, $wgEnableUploads;
168168
169 - $tns = $wgOut->getTitle()->getNamespace();
 169+ $tns = $this->mTitle->getNamespace();
170170
171171 $s = "\n<div id='quickbar'>";
172172
@@ -228,7 +228,7 @@
229229 . $sep . $this->watchPageLinksLink();
230230
231231 if( $tns == NS_USER || $tns == NS_USER_TALK ) {
232 - $id = User::idFromName( $wgOut->getTitle()->getText() );
 232+ $id = User::idFromName( $this->mTitle->getText() );
233233 if( $id != 0 ) {
234234 $s .= $sep . $this->userContribsLink();
235235 if( $this->showEmailUser( $id ) ) {
Index: trunk/phase3/skins/Standard.php
@@ -137,7 +137,7 @@
138138
139139 $action = $wgRequest->getText( 'action' );
140140 $wpPreview = $wgRequest->getBool( 'wpPreview' );
141 - $tns = $wgOut->getTitle()->getNamespace();
 141+ $tns = $this->mTitle->getNamespace();
142142
143143 $s = "\n<div id='quickbar'>";
144144 $s .= "\n" . $this->logoText() . "\n<hr class='sep' />";
@@ -165,7 +165,7 @@
166166 }
167167 // only show watchlist link if logged in
168168 $s .= "\n<hr class='sep' />";
169 - $articleExists = $wgOut->getTitle()->getArticleId();
 169+ $articleExists = $this->mTitle->getArticleId();
170170 if ( $wgOut->isArticle() || $action == 'edit' || $action == 'history' || $wpPreview ) {
171171 if( $wgOut->isArticle() ) {
172172 $s .= '<strong>' . $this->editThisPage() . '</strong>';
@@ -210,13 +210,13 @@
211211 $text = wfMsg( 'articlepage' );
212212 }
213213
214 - $link = $wgOut->getTitle()->getText();
 214+ $link = $this->mTitle->getText();
215215 if( $nstext = $wgContLang->getNsText( $tns ) ) { # add namespace if necessary
216216 $link = $nstext . ':' . $link;
217217 }
218218
219219 $s .= $this->makeLink( $link, $text );
220 - } elseif( $wgOut->getTitle()->getNamespace() != NS_SPECIAL ) {
 220+ } elseif( $this->mTitle->getNamespace() != NS_SPECIAL ) {
221221 # we just throw in a "New page" text to tell the user that he's in edit mode,
222222 # and to avoid messing with the separator that is prepended to the next item
223223 $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
@@ -225,8 +225,8 @@
226226 }
227227
228228 # "Post a comment" link
229 - if( ( $wgOut->getTitle()->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
230 - $s .= '<br />' . $this->makeKnownLinkObj( $wgOut->getTitle(), wfMsg( 'postcomment' ), 'action=edit&section=new' );
 229+ if( ( $this->mTitle->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
 230+ $s .= '<br />' . $this->makeKnownLinkObj( $this->mTitle, wfMsg( 'postcomment' ), 'action=edit&section=new' );
231231
232232 #if( $tns%2 && $action!='edit' && !$wpPreview) {
233233 #$s.= '<br />'.$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg('postcomment'),'action=edit&section=new');
@@ -242,7 +242,7 @@
243243 if( $action != 'edit' && $action != 'submit' ){
244244 $s .= $sep . $this->watchThisPage();
245245 }
246 - if ( $wgOut->getTitle()->userCan( 'edit' ) )
 246+ if ( $this->mTitle->userCan( 'edit' ) )
247247 $s .= $sep . $this->moveThisPage();
248248 }
249249 if ( $wgUser->isAllowed( 'delete' ) and $articleExists ) {
@@ -259,11 +259,11 @@
260260 $s .= $sep . $this->watchPageLinksLink();
261261 }
262262
263 - if ( NS_USER == $wgOut->getTitle()->getNamespace()
264 - || $wgOut->getTitle()->getNamespace() == NS_USER_TALK ) {
 263+ if ( NS_USER == $this->mTitle->getNamespace()
 264+ || $this->mTitle->getNamespace() == NS_USER_TALK ) {
265265
266 - $id = User::idFromName( $wgOut->getTitle()->getText() );
267 - $ip = User::isIP( $wgOut->getTitle()->getText() );
 266+ $id = User::idFromName( $this->mTitle->getText() );
 267+ $ip = User::isIP( $this->mTitle->getText() );
268268
269269 if( $id || $ip ){
270270 $s .= $sep . $this->userContribsLink();

Status & tagging log