r41852 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41851‎ | r41852 | r41853 >
Date:20:55, 8 October 2008
Author:aaron
Status:old (Comments)
Tags:
Comment:
Show contribs link only if it applies
Modified paths:
  • /trunk/phase3/includes/specials/SpecialBlockip.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialBlockip.php
@@ -479,13 +479,25 @@
480480 private function getConvenienceLinks() {
481481 global $wgUser;
482482 $skin = $wgUser->getSkin();
483 - $contribsPage = SpecialPage::getTitleFor( 'Contributions', $this->BlockAddress );
484 - $links[] = $skin->link( $contribsPage, wfMsgHtml( 'ipb-blocklist-contribs', $this->BlockAddress ) );
 483+ if( $this->BlockAddress )
 484+ $links[] = $this->getContribsLink( $skin );
485485 $links[] = $this->getUnblockLink( $skin );
486486 $links[] = $this->getBlockListLink( $skin );
487487 $links[] = $skin->makeLink ( 'MediaWiki:Ipbreason-dropdown', wfMsgHtml( 'ipb-edit-dropdown' ) );
488488 return '<p class="mw-ipb-conveniencelinks">' . implode( ' | ', $links ) . '</p>';
489489 }
 490+
 491+ /**
 492+ * Build a convenient link to a user or IP's contribs
 493+ * form
 494+ *
 495+ * @param $skin Skin to use
 496+ * @return string
 497+ */
 498+ private function getContribsLink( $skin ) {
 499+ $contribsPage = SpecialPage::getTitleFor( 'Contributions', $this->BlockAddress );
 500+ return $skin->link( $contribsPage, wfMsgHtml( 'ipb-blocklist-contribs', $this->BlockAddress ) );
 501+ }
490502
491503 /**
492504 * Build a convenient link to unblock the given username or IP

Comments

#Comment by Brion VIBBER (talk | contribs)   21:27, 8 October 2008

looks good, thanks!

#Comment by Brion VIBBER (talk | contribs)   21:28, 8 October 2008

fix to r41831

Status & tagging log