*/
class SpecialWatchlist extends ChangesListSpecialPage {
protected static $savedQueriesPreferenceName = 'rcfilters-wl-saved-queries';
+ protected static $daysPreferenceName = 'watchlistdays';
+ protected static $limitPreferenceName = 'wllimit';
private $maxDays;
}
}
- public function isStructuredFilterUiEnabled() {
- return $this->getRequest()->getBool( 'rcfilters' ) || (
- $this->getConfig()->get( 'StructuredChangeFiltersOnWatchlist' ) &&
- $this->getUser()->getOption( 'rcenhancedfilters' )
+ public static function checkStructuredFilterUiEnabled( Config $config, User $user ) {
+ return (
+ $config->get( 'StructuredChangeFiltersOnWatchlist' ) &&
+ $user->getOption( 'rcenhancedfilters' )
);
}
- public function isStructuredFilterUiEnabledByDefault() {
- return $this->getConfig()->get( 'StructuredChangeFiltersOnWatchlist' ) &&
- $this->getUser()->getDefaultOption( 'rcenhancedfilters' );
- }
-
/**
* Return an array of subpages that this special page will accept.
*
$dbr = $this->getDB();
$user = $this->getUser();
- $tables = array_merge( [ 'recentchanges', 'watchlist' ], $tables );
- $fields = array_merge( RecentChange::selectFields(), $fields );
+ $rcQuery = RecentChange::getQueryInfo();
+ $tables = array_merge( $tables, $rcQuery['tables'], [ 'watchlist' ] );
+ $fields = array_merge( $rcQuery['fields'], $fields );
$join_conds = array_merge(
[
],
],
],
+ $rcQuery['joins'],
$join_conds
);
return Html::rawElement(
'span',
$attribs,
- Xml::checkLabel(
- $this->msg( $message, '' )->text(),
- $name,
- $name,
- (int)$value
+ // not using Html::checkLabel because that would escape the contents
+ Html::check( $name, (int)$value, [ 'id' => $name ] ) . Html::rawElement(
+ 'label',
+ $attribs + [ 'for' => $name ],
+ // <nowiki/> at beginning to avoid messages with "$1 ..." being parsed as pre tags
+ $this->msg( $message, '<nowiki/>' )->parse()
)
);
}
$count = $store->countWatchedItems( $this->getUser() );
return floor( $count / 2 );
}
-
- function getDefaultLimit() {
- return $this->getUser()->getIntOption( 'wllimit' );
- }
-
- function getDefaultDays() {
- return floatval( $this->getUser()->getOption( 'watchlistdays' ) );
- }
}