| Index: trunk/phase3/includes/Pager.php |
| — | — | @@ -868,12 +868,7 @@ |
| 869 | 869 | |
| 870 | 870 | function formatRow( $row ) { |
| 871 | 871 | $this->mCurrentRow = $row; # In case formatValue etc need to know |
| 872 | | - $classArray = $this->getRowAttrs($row); |
| 873 | | - if ( $classArray['class'] === '' ) { |
| 874 | | - $s = Html::openElement( 'tr' ); |
| 875 | | - } else { |
| 876 | | - $s = Html::openElement( 'tr', $classArray ); |
| 877 | | - } |
| | 872 | + $s = Xml::openElement( 'tr', $this->getRowAttrs($row) ); |
| 878 | 873 | $fieldNames = $this->getFieldNames(); |
| 879 | 874 | foreach ( $fieldNames as $field => $name ) { |
| 880 | 875 | $value = isset( $row->$field ) ? $row->$field : null; |
| — | — | @@ -904,7 +899,13 @@ |
| 905 | 900 | * @return Associative array |
| 906 | 901 | */ |
| 907 | 902 | function getRowAttrs( $row ) { |
| 908 | | - return array( 'class' => $this->getRowClass( $row ) ); |
| | 903 | + $class = $this->getRowClass( $row ); |
| | 904 | + if ( $class === '' ) { |
| | 905 | + // Return an empty array to avoid clutter in HTML like class="" |
| | 906 | + return array(); |
| | 907 | + } else { |
| | 908 | + return array( 'class' => $this->getRowClass( $row ) ); |
| | 909 | + } |
| 909 | 910 | } |
| 910 | 911 | |
| 911 | 912 | /** |