* @ingroup Pager
*/
abstract class TablePager extends IndexPager {
+ /** @var string */
protected $mSort;
+ /** @var stdClass */
protected $mCurrentRow;
public function __construct( IContextSource $context = null ) {
* @protected
* @return string
*/
- function getStartBody() {
+ protected function getStartBody() {
$sortClass = $this->getSortHeaderClass();
$s = '';
// We don't actually know in which direction other fields will be sorted by default…
if ( $this->mDefaultDirection == IndexPager::DIR_DESCENDING ) {
$linkType = 'asc';
- $class = "$sortClass TablePager_sort-descending";
+ $class = "$sortClass mw-datatable-is-sorted mw-datatable-is-descending";
$query['asc'] = '1';
$query['desc'] = '';
} else {
$linkType = 'desc';
- $class = "$sortClass TablePager_sort-ascending";
+ $class = "$sortClass mw-datatable-is-sorted mw-datatable-is-ascending";
$query['asc'] = '';
$query['desc'] = '1';
}
$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";
* @protected
* @return string
*/
- function getEndBody() {
+ protected function getEndBody() {
return "</tbody></table>\n";
}
}
/**
+ * TablePager relies on `mw-datatable` for styling, see T214208
* @return string
*/
protected function getTableClass() {
- return 'TablePager';
+ return 'mw-datatable';
}
/**
// * table_pager_prev
// * table_pager_next
// * table_pager_last
+ 'classes' => [ 'TablePager-button-' . $type ],
+ 'flags' => [ 'progressive' ],
+ 'framed' => false,
'label' => $this->msg( 'table_pager_' . $type )->text(),
'href' => $queries[ $type ] ?
$title->getLinkURL( $queries[ $type ] + $this->getDefaultQuery() ) :