r58323 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58322‎ | r58323 | r58324 >
Date:16:37, 29 October 2009
Author:raymond
Status:ok (Comments)
Tags:
Comment:
Follow-up r58192: Improved version. Split info for local and other blocks. See CodeReview for a screenshot.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialIpblocklist.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -1931,6 +1931,7 @@
19321932 'ipblocklist-sh-addressblocks',
19331933 'ipblocklist-summary',
19341934 'ipblocklist-submit',
 1935+ 'ipblocklist-localblock',
19351936 'ipblocklist-otherblocks',
19361937 'blocklistline',
19371938 'infiniteblock',
Index: trunk/phase3/includes/specials/SpecialIpblocklist.php
@@ -296,27 +296,36 @@
297297 $conds[] = "ipb_user != 0 OR ipb_range_end > ipb_range_start";
298298 }
299299
 300+ // Search form
 301+ $wgOut->addHTML( $this->searchForm() );
 302+
 303+ // Check for other blocks, i.e. global/tor blocks
 304+ $otherBlockLink = array();
 305+ wfRunHooks( 'getOtherBlockLogLink', array( &$otherBlockLink, $this->ip ) );
 306+
 307+ // Show additional header for the local block only when other blocks exists.
 308+ // Not necessary in a standard installation without such extensions enabled
 309+ if( count( $otherBlockLink ) ) {
 310+ $wgOut->addHTML(
 311+ Html::rawElement( 'h2', array(), wfMsg( 'ipblocklist-localblock' ) ) . "\n"
 312+ );
 313+ }
300314 $pager = new IPBlocklistPager( $this, $conds );
301315 if ( $pager->getNumRows() ) {
302316 $wgOut->addHTML(
303 - $this->searchForm() .
304317 $pager->getNavigationBar() .
305318 Xml::tags( 'ul', null, $pager->getBody() ) .
306319 $pager->getNavigationBar()
307320 );
308321 } elseif ( $this->ip != '') {
309 - $wgOut->addHTML( $this->searchForm() );
310322 $wgOut->addWikiMsg( 'ipblocklist-no-results' );
311323 } else {
312 - $wgOut->addHTML( $this->searchForm() );
313324 $wgOut->addWikiMsg( 'ipblocklist-empty' );
314325 }
315326
316 - $otherBlockLink = array();
317 - wfRunHooks( 'getOtherBlockLogLink', array( &$otherBlockLink, $this->ip ) );
318327 if( count( $otherBlockLink ) ) {
319328 $wgOut->addHTML(
320 - Html::rawElement( 'h2', array(), wfMsg( 'ipblocklist-otherblocks' ) ) . "\n"
 329+ Html::rawElement( 'h2', array(), wfMsgExt( 'ipblocklist-otherblocks', 'parseinline', count( $otherBlockLink ) ) ) . "\n"
321330 );
322331 $list = '';
323332 foreach( $otherBlockLink as $link ) {
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2896,7 +2896,8 @@
28972897 'ipblocklist-sh-addressblocks' => '$1 single IP blocks',
28982898 'ipblocklist-summary' => '', # do not translate or duplicate this message to other languages
28992899 'ipblocklist-submit' => 'Search',
2900 -'ipblocklist-otherblocks' => 'Other blocks',
 2900+'ipblocklist-localblock' => 'Local block',
 2901+'ipblocklist-otherblocks' => 'Other {{PLURAL:$1|block|blocks}}',
29012902 'blocklistline' => '$1, $2 blocked $3 ($4)',
29022903 'infiniteblock' => 'infinite',
29032904 'expiringblock' => 'expires on $1 at $2',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r58192New hook getOtherBlockLogLink, called in Special:IPBlockList to show links to...raymond14:08, 27 October 2009

Comments

#Comment by Raymond (talk | contribs)   16:38, 29 October 2009

Screenshot from my local wiki with installed GlobalBlocking and TorBlock extensions:

Screenshot

Status & tagging log