r42262 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42261‎ | r42262 | r42263 >
Date:11:51, 20 October 2008
Author:jojo
Status:old
Tags:
Comment:
Replace check for namespace NS_MAIN with $wgOut->isArticle().
Modified paths:
  • /trunk/extensions/Collection/Collection.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.body.php
@@ -1199,8 +1199,15 @@
12001200 $wgOut->enableClientCache( false );
12011201
12021202 if ( is_null( $wgArticle ) || !$wgArticle->exists() ) {
1203 - // no op
1204 - } else if ( $wgTitle->getNamespace() == NS_MAIN ) { // TODO: only NS_MAIN?
 1203+ return;
 1204+ } else if ( $wgTitle->getNamespace() == NS_CATEGORY ) {
 1205+ $params = "cattitle=" . $wgTitle->getPartialURL();
 1206+ $href = htmlspecialchars( wfAppendQuery( SkinTemplate::makeSpecialUrlSubpage(
 1207+ 'Collection',
 1208+ 'add_category/'
 1209+ ), $params ) );
 1210+ $out .= "<li><a href=\"$href\" rel=\"nofollow\">$addCategory</a></li>";
 1211+ } else if ( $wgOut->isArticle() ) {
12051212 $params = "arttitle=" . $wgTitle->getPrefixedUrl() . "&oldid=" . $wgArticle->getOldID();
12061213
12071214 if ( self::findArticle( $wgTitle->getPrefixedText(), $wgArticle->getOldID() ) == -1 ) {
@@ -1216,13 +1223,6 @@
12171224 ), $params ) );
12181225 $out .= "<li><a href=\"$href\" rel=\"nofollow\">$removeArticle</a></li>";
12191226 }
1220 - } else if ( $wgTitle->getNamespace() == NS_CATEGORY ) {
1221 - $params = "cattitle=" . $wgTitle->getPartialURL();
1222 - $href = htmlspecialchars( wfAppendQuery( SkinTemplate::makeSpecialUrlSubpage(
1223 - 'Collection',
1224 - 'add_category/'
1225 - ), $params ) );
1226 - $out .= "<li><a href=\"$href\" rel=\"nofollow\">$addCategory</a></li>";
12271227 }
12281228
12291229 $articles = wfMsgExt( 'coll-n_pages', array( 'parsemag' ), $numArticles );

Status & tagging log