* Don't show search box when the list is empty
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 10 May 2007 17:31:10 +0000 (17:31 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 10 May 2007 17:31:10 +0000 (17:31 +0000)
RELEASE-NOTES
includes/SpecialIpblocklist.php
languages/messages/MessagesEn.php

index 65b6e90..0481f44 100644 (file)
@@ -47,6 +47,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Tooltips for print version and permalink
 * Links to the MediaWiki namespace for system messages having their default
   values are no longer shown as nonexistent (e.g., in red)
+* Special:Ipblocklist differentiates between empty list and no search results.
 
 == Maintenance script changes since 1.10 ==
 
index 9f705db..079be45 100644 (file)
@@ -224,22 +224,20 @@ class IPUnblockForm {
                        }
                }
 
-                # TODO: difference message between
-               #       a) an real empty list and
-               #       b) requested ip/username not on list
                $pager = new IPBlocklistPager( $this, $conds );
                if ( $pager->getNumRows() ) {
-                       $s = $this->searchForm() .
-                               $pager->getNavigationBar();
-                       $s .= "<ul>" . 
-                               $pager->getBody() .
-                               "</ul>";
-                       $s .= $pager->getNavigationBar();
+                       $wgOut->addHTML(
+                               $this->searchForm() .
+                               $pager->getNavigationBar() .
+                               Xml::tags( 'ul', null, $pager->getBody() ) .
+                               $pager->getNavigationBar()
+                       );
+               } elseif ( $this->ip != '') {
+                       $wgOut->addHTML( $this->searchForm() );
+                       $wgOut->addWikiText( wfMsg( 'ipblocklist-no-results' ) );
                } else {
-                       $s = $this->searchForm() .
-                               '<p>' . wfMsgHTML( 'ipblocklistempty' ) . '</p>';
+                       $wgOut->addWikiText( wfMsg( 'ipblocklist-empty' ) );
                }
-               $wgOut->addHTML( $s );
        }
 
        function searchForm() {
index 5c6ab2c..e81d3bd 100644 (file)
@@ -2017,7 +2017,8 @@ to a previously blocked IP address or username.',
 'anononlyblock' => 'anon. only',
 'noautoblockblock' => 'autoblock disabled',
 'createaccountblock' => 'account creation blocked',
-'ipblocklistempty'     => 'The blocklist is empty or the requested IP address/username is not blocked.',
+'ipblocklist-empty'    => 'The blocklist is empty.',
+'ipblocklist-no-results'       => 'The requested IP address or username is not blocked.',
 'blocklink'            => 'block',
 'unblocklink'  => 'unblock',
 'contribslink' => 'contribs',