Follow-up r58192: Improved version. Split info for local and other blocks. See CodeRe...
authorRaimond Spekking <raymond@users.mediawiki.org>
Thu, 29 Oct 2009 16:37:07 +0000 (16:37 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Thu, 29 Oct 2009 16:37:07 +0000 (16:37 +0000)
includes/specials/SpecialIpblocklist.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 010375a..701df09 100644 (file)
@@ -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 ) {
index 3d179da..16ac1bc 100644 (file)
@@ -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',
index fdff4ad..6effdb4 100644 (file)
@@ -1931,6 +1931,7 @@ $wgMessageStructure = array(
                'ipblocklist-sh-addressblocks',
                'ipblocklist-summary',
                'ipblocklist-submit',
+               'ipblocklist-localblock',
                'ipblocklist-otherblocks',
                'blocklistline',
                'infiniteblock',