return $query;
}
+ /**
+ * Wrap the navigation bar in a p element with identifying class.
+ * In future we may want to change the `p` tag to a `div` and upstream
+ * this to the parent class.
+ *
+ * @return string HTML
+ */
+ function getNavigationBar() {
+ return Html::rawElement( 'p', [ 'class' => 'mw-pager-navigation-bar' ],
+ parent::getNavigationBar()
+ );
+ }
+
/**
* This method basically executes the exact same code as the parent class, though with
* a hook added, to allow extensions to add additional queries.
*
* @param string $offset Index offset, inclusive
* @param int $limit Exact query limit
- * @param bool $descending Query direction, false for ascending, true for descending
+ * @param bool $order IndexPager::QUERY_ASCENDING or IndexPager::QUERY_DESCENDING
* @return IResultWrapper
*/
- function reallyDoQuery( $offset, $limit, $descending ) {
+ function reallyDoQuery( $offset, $limit, $order ) {
list( $tables, $fields, $conds, $fname, $options, $join_conds ) = $this->buildQueryInfo(
$offset,
$limit,
- $descending
+ $order
);
/*
) ];
Hooks::run(
'ContribsPager::reallyDoQuery',
- [ &$data, $this, $offset, $limit, $descending ]
+ [ &$data, $this, $offset, $limit, $order ]
);
$result = [];
}
// sort results
- if ( $descending ) {
+ if ( $order === self::QUERY_ASCENDING ) {
ksort( $result );
} else {
krsort( $result );
$lang = $this->getLanguage();
$comment = $lang->getDirMark() . Linker::revComment( $rev, false, true, false );
- $date = $lang->userTimeAndDate( $row->rev_timestamp, $user );
- if ( $rev->userCan( Revision::DELETED_TEXT, $user ) ) {
- $d = $linkRenderer->makeKnownLink(
- $page,
- $date,
- [ 'class' => 'mw-changeslist-date' ],
- [ 'oldid' => intval( $row->rev_id ) ]
- );
- } else {
- $d = htmlspecialchars( $date );
- }
- if ( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
- $d = '<span class="history-deleted">' . $d . '</span>';
- }
+ $d = ChangesList::revDateLink( $rev, $user, $lang, $page );
# Show user names for /newbies as there may be different users.
# Note that only unprivileged users have rows with hidden user names excluded.