* @return bool|ResultWrapper Result or false (for Recentchangeslinked only)
*/
public function doMainQuery( $conds, $opts ) {
- global $wgAllowCategorizedRecentChanges;
-
$dbr = $this->getDB();
$user = $this->getUser();
);
// Build the final data
- if ( $wgAllowCategorizedRecentChanges ) {
+ if ( $this->getConfig()->get( 'AllowCategorizedRecentChanges' ) ) {
$this->filterByCategories( $rows, $opts );
}
* @return array
*/
private function getFeedQuery() {
- global $wgFeedLimit;
$query = array_filter( $this->getOptions()->getAllValues(), function ( $value ) {
// API handles empty parameters in a different way
return $value !== '';
} );
$query['action'] = 'feedrecentchanges';
- if ( $query['limit'] > $wgFeedLimit ) {
- $query['limit'] = $wgFeedLimit;
+ $feedLimit = $this->getConfig()->get( 'FeedLimit' );
+ if ( $query['limit'] > $feedLimit ) {
+ $query['limit'] = $feedLimit;
}
return $query;
* @param FormOptions $opts
*/
public function outputChangesList( $rows, $opts ) {
- global $wgRCShowWatchingUsers, $wgShowUpdatedMarker;
-
$limit = $opts['limit'];
- $showWatcherCount = $wgRCShowWatchingUsers
+ $showWatcherCount = $this->getConfig()->get( 'RCShowWatchingUsers' )
&& $this->getUser()->getOption( 'shownumberswatching' );
$watcherCache = array();
$rc = RecentChange::newFromRow( $obj );
$rc->counter = $counter++;
# Check if the page has been updated since the last visit
- if ( $wgShowUpdatedMarker && !empty( $obj->wl_notificationtimestamp ) ) {
+ if ( $this->getConfig()->get( 'ShowUpdatedMarker' ) && !empty( $obj->wl_notificationtimestamp ) ) {
$rc->notificationtimestamp = ( $obj->rc_timestamp >= $obj->wl_notificationtimestamp );
} else {
$rc->notificationtimestamp = false; // Default
* @param int $numRows Number of rows in the result to show after this header
*/
public function doHeader( $opts, $numRows ) {
- global $wgScript;
-
$this->setTopText( $opts );
$defaults = $opts->getAllValues();
$t = $this->getPageTitle();
$out .= Html::hidden( 'title', $t->getPrefixedText() );
- $form = Xml::tags( 'form', array( 'action' => $wgScript ), $out );
+ $form = Xml::tags( 'form', array( 'action' => wfScript() ), $out );
$panel[] = $form;
$panelString = implode( "\n", $panel );
$extraOpts = array();
$extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
- global $wgAllowCategorizedRecentChanges;
- if ( $wgAllowCategorizedRecentChanges ) {
+ if ( $this->getConfig()->get( 'AllowCategorizedRecentChanges' ) ) {
$extraOpts['category'] = $this->categoryFilterForm( $opts );
}
* @return string
*/
function optionsPanel( $defaults, $nondefaults, $numRows ) {
- global $wgRCLinkLimits, $wgRCLinkDays;
-
$options = $nondefaults + $defaults;
$note = '';
}
# Sort data for display and make sure it's unique after we've added user data.
- $linkLimits = $wgRCLinkLimits;
+ $linkLimits = $this->getConfig()->get( 'RCLinkLimits' );
$linkLimits[] = $options['limit'];
sort( $linkLimits );
$linkLimits = array_unique( $linkLimits );
- $linkDays = $wgRCLinkDays;
+ $linkDays = $this->getConfig()->get( 'RCLinkDays' );
$linkDays[] = $options['days'];
sort( $linkDays );
$linkDays = array_unique( $linkDays );