Merge "Avoid @backupGlobals in ExtensionRegistryTest"
[lhc/web/wiklou.git] / includes / specials / SpecialBlockList.php
index 62fadb5..4583430 100644 (file)
@@ -47,6 +47,7 @@ class SpecialBlockList extends SpecialPage {
                $lang = $this->getLanguage();
                $out->setPageTitle( $this->msg( 'ipblocklist' ) );
                $out->addModuleStyles( 'mediawiki.special' );
+               $out->addModules( 'mediawiki.userSuggest' );
 
                $request = $this->getRequest();
                $par = $request->getVal( 'ip', $par );
@@ -72,6 +73,7 @@ class SpecialBlockList extends SpecialPage {
                                'tabindex' => '1',
                                'size' => '45',
                                'default' => $this->target,
+                               'cssclass' => 'mw-autocomplete-user', // used by mediawiki.userSuggest
                        ),
                        'Options' => array(
                                'type' => 'multiselect',
@@ -103,6 +105,7 @@ class SpecialBlockList extends SpecialPage {
                $form->setMethod( 'get' );
                $form->setWrapperLegendMsg( 'ipblocklist-legend' );
                $form->setSubmitTextMsg( 'ipblocklist-submit' );
+               $form->setSubmitProgressive();
                $form->prepareForm();
 
                $form->displayForm( '' );
@@ -167,7 +170,7 @@ class SpecialBlockList extends SpecialPage {
 
                # Check for other blocks, i.e. global/tor blocks
                $otherBlockLink = array();
-               wfRunHooks( 'OtherBlockLogLink', array( &$otherBlockLink, $this->target ) );
+               Hooks::run( 'OtherBlockLogLink', array( &$otherBlockLink, $this->target ) );
 
                $out = $this->getOutput();
 
@@ -181,11 +184,7 @@ class SpecialBlockList extends SpecialPage {
 
                $pager = new BlockListPager( $this, $conds );
                if ( $pager->getNumRows() ) {
-                       $out->addHTML(
-                               $pager->getNavigationBar() .
-                                       $pager->getBody() .
-                                       $pager->getNavigationBar()
-                       );
+                       $out->addParserOutputContent( $pager->getFullOutput() );
                } elseif ( $this->target ) {
                        $out->addWikiMsg( 'ipblocklist-no-results' );
                } else {
@@ -228,7 +227,7 @@ class BlockListPager extends TablePager {
        function __construct( $page, $conds ) {
                $this->page = $page;
                $this->conds = $conds;
-               $this->mDefaultDirection = true;
+               $this->mDefaultDirection = IndexPager::DIR_DESCENDING;
                parent::__construct( $page->getContext() );
        }
 
@@ -263,7 +262,6 @@ class BlockListPager extends TablePager {
                                'blocklist-nousertalk',
                                'unblocklink',
                                'change-blocklink',
-                               'infiniteblock',
                        );
                        $msg = array_combine( $msg, array_map( array( $this, 'msg' ), $msg ) );
                }
@@ -409,7 +407,7 @@ class BlockListPager extends TablePager {
        }
 
        public function getTableClass() {
-               return 'TablePager mw-blocklist';
+               return parent::getTableClass() . ' mw-blocklist';
        }
 
        function getIndexField() {
@@ -429,7 +427,6 @@ class BlockListPager extends TablePager {
         * @param ResultWrapper $result
         */
        function preprocessResults( $result ) {
-               wfProfileIn( __METHOD__ );
                # Do a link batch query
                $lb = new LinkBatch;
                $lb->setCaller( __METHOD__ );
@@ -454,6 +451,5 @@ class BlockListPager extends TablePager {
                }
 
                $lb->execute();
-               wfProfileOut( __METHOD__ );
        }
 }