Allow individual TablePager rows to be styled with the internal method getRowClass...
authorAndrew Garrett <werdna@users.mediawiki.org>
Wed, 28 Jan 2009 20:08:46 +0000 (20:08 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Wed, 28 Jan 2009 20:08:46 +0000 (20:08 +0000)
includes/Pager.php

index 3ff3146..32bfec5 100644 (file)
@@ -745,7 +745,8 @@ abstract class TablePager extends IndexPager {
        }
 
        function formatRow( $row ) {
-               $s = "<tr>\n";
+               $class = $this->getRowClass( $row );
+               $s = "<tr class=\"$class\">\n";
                $fieldNames = $this->getFieldNames();
                $this->mCurrentRow = $row;  # In case formatValue needs to know
                foreach ( $fieldNames as $field => $name ) {
@@ -761,6 +762,10 @@ abstract class TablePager extends IndexPager {
                return $s;
        }
 
+       function getRowClass($row) {
+               return '';
+       }
+
        function getIndexField() {
                return $this->mSort;
        }