*
* It's important that img_media_type come first, otherwise the
* tables will be fragmented.
- * @return Array Fields to sort by
+ * @return array Fields to sort by
*/
function getOrderFields() {
return [ 'img_media_type', 'count(*)', 'img_major_mime', 'img_minor_mime' ];
* Output closing </table>
*/
protected function outputTableEnd() {
- $this->getOutput()->addHTML( Html::closeElement( 'table' ) );
+ $this->getOutput()->addHTML(
+ Html::closeElement( 'tbody' ) .
+ Html::closeElement( 'table' )
+ );
$this->getOutput()->addWikiTextAsInterface(
$this->msg( 'mediastatistics-bytespertype' )
->numParams( $this->totalPerType )
/**
* @param float $decimal A decimal percentage (ie for 12.3%, this would be 0.123)
- * @return String The percentage formatted so that 3 significant digits are shown.
+ * @return string The percentage formatted so that 3 significant digits are shown.
*/
protected function makePercentPretty( $decimal ) {
$decimal *= 100;
* @param string $mediaType
*/
protected function outputTableStart( $mediaType ) {
- $this->getOutput()->addHTML(
+ $out = $this->getOutput();
+ $out->addModuleStyles( 'jquery.tablesorter.styles' );
+ $out->addModules( 'jquery.tablesorter' );
+ $out->addHTML(
Html::openElement(
'table',
[ 'class' => [
'sortable',
'wikitable'
] ]
- )
+ ) .
+ Html::rawElement( 'thead', [], $this->getTableHeaderRow() ) .
+ Html::openElement( 'tbody' )
);
- $this->getOutput()->addHTML( $this->getTableHeaderRow() );
}
/**
* Get (not output) the header row for the table
*
- * @return String the header row of the able
+ * @return string The header row of the table
*/
protected function getTableHeaderRow() {
$headers = [ 'mimetype', 'extensions', 'count', 'totalbytes' ];