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 );
return 'rev_timestamp';
}
+ /**
+ * @return false|string
+ */
+ public function getTagFilter() {
+ return $this->tagFilter;
+ }
+
+ /**
+ * @return string
+ */
+ public function getContribs() {
+ return $this->contribs;
+ }
+
+ /**
+ * @return string
+ */
+ public function getTarget() {
+ return $this->target;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isNewOnly() {
+ return $this->newOnly;
+ }
+
+ /**
+ * @return int|string
+ */
+ public function getNamespace() {
+ return $this->namespace;
+ }
+
/**
* @return string[]
*/