Index: trunk/extensions/Collection/Collection.body.php |
— | — | @@ -1199,8 +1199,15 @@ |
1200 | 1200 | $wgOut->enableClientCache( false ); |
1201 | 1201 | |
1202 | 1202 | 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() ) { |
1205 | 1212 | $params = "arttitle=" . $wgTitle->getPrefixedUrl() . "&oldid=" . $wgArticle->getOldID(); |
1206 | 1213 | |
1207 | 1214 | if ( self::findArticle( $wgTitle->getPrefixedText(), $wgArticle->getOldID() ) == -1 ) { |
— | — | @@ -1216,13 +1223,6 @@ |
1217 | 1224 | ), $params ) ); |
1218 | 1225 | $out .= "<li><a href=\"$href\" rel=\"nofollow\">$removeArticle</a></li>"; |
1219 | 1226 | } |
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>"; |
1227 | 1227 | } |
1228 | 1228 | |
1229 | 1229 | $articles = wfMsgExt( 'coll-n_pages', array( 'parsemag' ), $numArticles ); |