From 1387055cc06c1cc49e31c6e4f5ef7e3e8fb7a5e9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C4=9Bj=20Such=C3=A1nek?= Date: Sat, 28 Apr 2018 10:36:14 +0200 Subject: [PATCH] Use BlockListPager::getLimitSelectList() in Special:BlockList and Special:AutoblockList So that we avoid code duplication and can make the form aware of a custom limit. Change-Id: I2ee7d6594f3b6ed12fa3c24f8a7a5bb7a402c1b6 --- includes/specials/SpecialAutoblockList.php | 9 +-------- includes/specials/SpecialBlockList.php | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/includes/specials/SpecialAutoblockList.php b/includes/specials/SpecialAutoblockList.php index 4d2d1b95a0..e1909f5243 100644 --- a/includes/specials/SpecialAutoblockList.php +++ b/includes/specials/SpecialAutoblockList.php @@ -42,7 +42,6 @@ class SpecialAutoblockList extends SpecialPage { $this->setHeaders(); $this->outputHeader(); $out = $this->getOutput(); - $lang = $this->getLanguage(); $out->setPageTitle( $this->msg( 'autoblocklist' ) ); $this->addHelpLink( 'Autoblock' ); $out->addModuleStyles( [ 'mediawiki.special' ] ); @@ -55,13 +54,7 @@ class SpecialAutoblockList extends SpecialPage { 'Limit' => [ 'type' => 'limitselect', 'label-message' => 'table_pager_limit_label', - 'options' => [ - $lang->formatNum( 20 ) => 20, - $lang->formatNum( 50 ) => 50, - $lang->formatNum( 100 ) => 100, - $lang->formatNum( 250 ) => 250, - $lang->formatNum( 500 ) => 500, - ], + 'options' => $pager->getLimitSelectList(), 'name' => 'limit', 'default' => $pager->getLimit(), ] diff --git a/includes/specials/SpecialBlockList.php b/includes/specials/SpecialBlockList.php index 667b814dc3..186e5ad741 100644 --- a/includes/specials/SpecialBlockList.php +++ b/includes/specials/SpecialBlockList.php @@ -44,7 +44,6 @@ class SpecialBlockList extends SpecialPage { $this->setHeaders(); $this->outputHeader(); $out = $this->getOutput(); - $lang = $this->getLanguage(); $out->setPageTitle( $this->msg( 'ipblocklist' ) ); $out->addModuleStyles( [ 'mediawiki.special' ] ); @@ -89,13 +88,7 @@ class SpecialBlockList extends SpecialPage { 'Limit' => [ 'type' => 'limitselect', 'label-message' => 'table_pager_limit_label', - 'options' => [ - $lang->formatNum( 20 ) => 20, - $lang->formatNum( 50 ) => 50, - $lang->formatNum( 100 ) => 100, - $lang->formatNum( 250 ) => 250, - $lang->formatNum( 500 ) => 500, - ], + 'options' => $pager->getLimitSelectList(), 'name' => 'limit', 'default' => $pager->getLimit(), ], -- 2.20.1