From 46ee59e426b4535366c9950ef633628b8957ea65 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Thu, 29 Oct 2009 16:37:07 +0000 Subject: [PATCH] Follow-up r58192: Improved version. Split info for local and other blocks. See CodeReview for a screenshot. --- includes/specials/SpecialIpblocklist.php | 21 +++++++++++++++------ languages/messages/MessagesEn.php | 3 ++- maintenance/language/messages.inc | 1 + 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/includes/specials/SpecialIpblocklist.php b/includes/specials/SpecialIpblocklist.php index 010375a011..701df09a5a 100644 --- a/includes/specials/SpecialIpblocklist.php +++ b/includes/specials/SpecialIpblocklist.php @@ -296,27 +296,36 @@ class IPUnblockForm { $conds[] = "ipb_user != 0 OR ipb_range_end > ipb_range_start"; } + // Search form + $wgOut->addHTML( $this->searchForm() ); + + // Check for other blocks, i.e. global/tor blocks + $otherBlockLink = array(); + wfRunHooks( 'getOtherBlockLogLink', array( &$otherBlockLink, $this->ip ) ); + + // Show additional header for the local block only when other blocks exists. + // Not necessary in a standard installation without such extensions enabled + if( count( $otherBlockLink ) ) { + $wgOut->addHTML( + Html::rawElement( 'h2', array(), wfMsg( 'ipblocklist-localblock' ) ) . "\n" + ); + } $pager = new IPBlocklistPager( $this, $conds ); if ( $pager->getNumRows() ) { $wgOut->addHTML( - $this->searchForm() . $pager->getNavigationBar() . Xml::tags( 'ul', null, $pager->getBody() ) . $pager->getNavigationBar() ); } elseif ( $this->ip != '') { - $wgOut->addHTML( $this->searchForm() ); $wgOut->addWikiMsg( 'ipblocklist-no-results' ); } else { - $wgOut->addHTML( $this->searchForm() ); $wgOut->addWikiMsg( 'ipblocklist-empty' ); } - $otherBlockLink = array(); - wfRunHooks( 'getOtherBlockLogLink', array( &$otherBlockLink, $this->ip ) ); if( count( $otherBlockLink ) ) { $wgOut->addHTML( - Html::rawElement( 'h2', array(), wfMsg( 'ipblocklist-otherblocks' ) ) . "\n" + Html::rawElement( 'h2', array(), wfMsgExt( 'ipblocklist-otherblocks', 'parseinline', count( $otherBlockLink ) ) ) . "\n" ); $list = ''; foreach( $otherBlockLink as $link ) { diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 3d179daf80..16ac1bc605 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2896,7 +2896,8 @@ See [[Special:IPBlockList|IP block list]] to review blocks.', 'ipblocklist-sh-addressblocks' => '$1 single IP blocks', 'ipblocklist-summary' => '', # do not translate or duplicate this message to other languages 'ipblocklist-submit' => 'Search', -'ipblocklist-otherblocks' => 'Other blocks', +'ipblocklist-localblock' => 'Local block', +'ipblocklist-otherblocks' => 'Other {{PLURAL:$1|block|blocks}}', 'blocklistline' => '$1, $2 blocked $3 ($4)', 'infiniteblock' => 'infinite', 'expiringblock' => 'expires on $1 at $2', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index fdff4addc6..6effdb462a 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1931,6 +1931,7 @@ $wgMessageStructure = array( 'ipblocklist-sh-addressblocks', 'ipblocklist-summary', 'ipblocklist-submit', + 'ipblocklist-localblock', 'ipblocklist-otherblocks', 'blocklistline', 'infiniteblock', -- 2.20.1