Be consistent about 'TablePager' CSS class usage
authorBartosz Dziewoński <matma.rex@gmail.com>
Sat, 23 Aug 2014 13:00:07 +0000 (15:00 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Sat, 23 Aug 2014 13:00:07 +0000 (15:00 +0200)
* 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
includes/specials/SpecialBlockList.php
includes/specials/SpecialListfiles.php
includes/specials/SpecialProtectedpages.php
includes/specials/SpecialTrackingCategories.php

index 1e4e18b..7096fde 100644 (file)
@@ -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" .
index 62fadb5..e2ebdbe 100644 (file)
@@ -409,7 +409,7 @@ class BlockListPager extends TablePager {
        }
 
        public function getTableClass() {
-               return 'TablePager mw-blocklist';
+               return parent::getTableClass() . ' mw-blocklist';
        }
 
        function getIndexField() {
index ed7648d..5eafd66 100644 (file)
@@ -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() {
index b64b029..5072e76 100644 (file)
@@ -558,7 +558,7 @@ class ProtectedPagesPager extends TablePager {
        }
 
        public function getTableClass() {
-               return 'TablePager mw-protectedpages';
+               return parent::getTableClass() . ' mw-protectedpages';
        }
 
        function getIndexField() {
index 5e5588c..552031f 100644 (file)
@@ -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" .
                        "<thead><tr>
                        <th>" .