X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=blobdiff_plain;f=includes%2Fpager%2FTablePager.php;h=f611699b942d68e85ba1410eb01952a2a94c184c;hb=bd980451109fb588c30aa5059ddada5ea4f6492e;hp=71b1ad7246e406fb78ce0b6414f78aac10a160cd;hpb=c0f24b44487c97c989a3071ffb5c1b1af6ce3d16;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/pager/TablePager.php b/includes/pager/TablePager.php index 71b1ad7246..f611699b94 100644 --- a/includes/pager/TablePager.php +++ b/includes/pager/TablePager.php @@ -21,6 +21,8 @@ * @ingroup Pager */ +use MediaWiki\Linker\LinkRenderer; + /** * Table-based display with a user-selectable sort order * @ingroup Pager @@ -32,7 +34,7 @@ abstract class TablePager extends IndexPager { /** @var stdClass */ protected $mCurrentRow; - public function __construct( IContextSource $context = null ) { + public function __construct( IContextSource $context = null, LinkRenderer $linkRenderer = null ) { if ( $context ) { $this->setContext( $context ); } @@ -49,7 +51,8 @@ abstract class TablePager extends IndexPager { $this->mDefaultDirection = IndexPager::DIR_DESCENDING; } /* Else leave it at whatever the class default is */ - parent::__construct(); + // Parent constructor needs mSort set, so we call it last + parent::__construct( null, $linkRenderer ); } /** @@ -152,7 +155,7 @@ abstract class TablePager extends IndexPager { $tableClass = $this->getTableClass(); $ret = Html::openElement( 'table', [ - 'class' => "mw-datatable $tableClass" ] + 'class' => " $tableClass" ] ); $ret .= Html::rawElement( 'thead', [], Html::rawElement( 'tr', [], "\n" . $s . "\n" ) ); $ret .= Html::openElement( 'tbody' ) . "\n"; @@ -266,10 +269,11 @@ abstract class TablePager extends IndexPager { } /** + * TablePager relies on `mw-datatable` for styling, see T214208 * @return string */ protected function getTableClass() { - return 'TablePager'; + return 'mw-datatable'; } /**