X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fspecials%2FSpecialWatchlist.php;h=2ad70a67a83353947b105561271bdd45a936689b;hp=ff62e9e6033dafc7b464fd1532d475a7151d7689;hb=a620ccb99ce905d8d8afd51fce2bdb7647cad958;hpb=6ff59f49793acccc53b34188d7490a35cbd7f3a2 diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index ff62e9e603..2ad70a67a8 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -33,6 +33,8 @@ use Wikimedia\Rdbms\IDatabase; */ class SpecialWatchlist extends ChangesListSpecialPage { protected static $savedQueriesPreferenceName = 'rcfilters-wl-saved-queries'; + protected static $daysPreferenceName = 'watchlistdays'; + protected static $limitPreferenceName = 'wllimit'; private $maxDays; @@ -108,18 +110,13 @@ class SpecialWatchlist extends ChangesListSpecialPage { } } - 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. * @@ -855,11 +852,12 @@ class SpecialWatchlist extends ChangesListSpecialPage { 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 ], + // at beginning to avoid messages with "$1 ..." being parsed as pre tags + $this->msg( $message, '' )->parse() ) ); } @@ -876,12 +874,4 @@ class SpecialWatchlist extends ChangesListSpecialPage { $count = $store->countWatchedItems( $this->getUser() ); return floor( $count / 2 ); } - - function getDefaultLimit() { - return $this->getUser()->getIntOption( 'wllimit' ); - } - - function getDefaultDays() { - return floatval( $this->getUser()->getOption( 'watchlistdays' ) ); - } }