From d473b6d34390bac1c013da11ba25cec4010c19e9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Sat, 23 Aug 2014 15:00:07 +0200 Subject: [PATCH] Be consistent about 'TablePager' CSS class usage * Do not use it when not actually using the TablePager * Always use it when actually using the TablePager * Use parent::getTableClass() rather than hardcoding it every time * Place it before other classes to allow overriding Change-Id: I042b65be64e2c2fa6c68a7bb972a7a2ea7f55b4e --- includes/specials/SpecialAllMessages.php | 3 ++- includes/specials/SpecialBlockList.php | 2 +- includes/specials/SpecialListfiles.php | 6 +++--- includes/specials/SpecialProtectedpages.php | 2 +- includes/specials/SpecialTrackingCategories.php | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/includes/specials/SpecialAllMessages.php b/includes/specials/SpecialAllMessages.php index 1e4e18b716..7096fde18f 100644 --- a/includes/specials/SpecialAllMessages.php +++ b/includes/specials/SpecialAllMessages.php @@ -336,8 +336,9 @@ class AllMessagesTablePager extends TablePager { } function getStartBody() { + $tableClass = $this->getTableClass(); return Xml::openElement( 'table', array( - 'class' => 'mw-datatable TablePager', + 'class' => "mw-datatable $tableClass", 'id' => 'mw-allmessagestable' ) ) . "\n" . diff --git a/includes/specials/SpecialBlockList.php b/includes/specials/SpecialBlockList.php index 62fadb55cd..e2ebdbe42d 100644 --- a/includes/specials/SpecialBlockList.php +++ b/includes/specials/SpecialBlockList.php @@ -409,7 +409,7 @@ class BlockListPager extends TablePager { } public function getTableClass() { - return 'TablePager mw-blocklist'; + return parent::getTableClass() . ' mw-blocklist'; } function getIndexField() { diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php index ed7648d735..5eafd6648e 100644 --- a/includes/specials/SpecialListfiles.php +++ b/includes/specials/SpecialListfiles.php @@ -557,15 +557,15 @@ class ImageListPager extends TablePager { } function getTableClass() { - return 'listfiles ' . parent::getTableClass(); + return parent::getTableClass() . ' listfiles'; } function getNavClass() { - return 'listfiles_nav ' . parent::getNavClass(); + return parent::getNavClass() . ' listfiles_nav'; } function getSortHeaderClass() { - return 'listfiles_sort ' . parent::getSortHeaderClass(); + return parent::getSortHeaderClass() . ' listfiles_sort'; } function getPagingQueries() { diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index b64b0291eb..5072e76b4b 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -558,7 +558,7 @@ class ProtectedPagesPager extends TablePager { } public function getTableClass() { - return 'TablePager mw-protectedpages'; + return parent::getTableClass() . ' mw-protectedpages'; } function getIndexField() { diff --git a/includes/specials/SpecialTrackingCategories.php b/includes/specials/SpecialTrackingCategories.php index 5e5588c425..552031f1c8 100644 --- a/includes/specials/SpecialTrackingCategories.php +++ b/includes/specials/SpecialTrackingCategories.php @@ -41,7 +41,7 @@ class SpecialTrackingCategories extends SpecialPage { $this->outputHeader(); $this->getOutput()->allowClickjacking(); $this->getOutput()->addHTML( - Html::openElement( 'table', array( 'class' => 'mw-datatable TablePager', + Html::openElement( 'table', array( 'class' => 'mw-datatable', 'id' => 'mw-trackingcategories-table' ) ) . "\n" . " " . -- 2.20.1