Don't clutter the HTML source with useless class=""
authorRaimond Spekking <raymond@users.mediawiki.org>
Fri, 18 Feb 2011 11:20:49 +0000 (11:20 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Fri, 18 Feb 2011 11:20:49 +0000 (11:20 +0000)
includes/Pager.php

index bf613fd..ee150a0 100644 (file)
@@ -868,7 +868,12 @@ abstract class TablePager extends IndexPager {
 
        function formatRow( $row ) {
                $this->mCurrentRow = $row;      # In case formatValue etc need to know
-               $s = Xml::openElement( 'tr', $this->getRowAttrs($row) );
+               $classArray = $this->getRowAttrs($row);
+               if ( $classArray['class'] === '' ) {
+                       $s = Html::openElement( 'tr' );
+               } else {
+                       $s = Html::openElement( 'tr', $classArray );
+               }
                $fieldNames = $this->getFieldNames();
                foreach ( $fieldNames as $field => $name ) {
                        $value = isset( $row->$field ) ? $row->$field : null;