X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialWatchlist.php;h=2ad70a67a83353947b105561271bdd45a936689b;hb=8a95833baed3b8071fcbd8cd2bc8c3449409f665;hp=ff62e9e6033dafc7b464fd1532d475a7151d7689;hpb=0eb07d1394fcf4f16983071888d1ce3b949ce813;p=lhc%2Fweb%2Fwiklou.git 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' ) ); - } }