X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialWatchlist.php;h=4f4570e3f83f0092d0c8e5bf09564480f78f66e4;hb=3b4c53b79540e1ab4519cb7781d3da6cdf8af7b7;hp=ec648690f4c0bd0622ff58c4d5124bc5e83e20bd;hpb=5cb794e3d9e55ee3fa71ddaca05be4e4225f84f1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index ec648690f4..4f4570e3f8 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -32,6 +32,8 @@ use Wikimedia\Rdbms\IDatabase; * @ingroup SpecialPage */ class SpecialWatchlist extends ChangesListSpecialPage { + protected static $savedQueriesPreferenceName = 'rcfilters-wl-saved-queries'; + private $maxDays; public function __construct( $page = 'Watchlist', $restriction = 'viewmywatchlist' ) { @@ -100,10 +102,6 @@ class SpecialWatchlist extends ChangesListSpecialPage { $output->addModuleStyles( [ 'mediawiki.rcfilters.highlightCircles.seenunseen.styles' ] ); $output->addJsConfigVars( 'wgStructuredChangeFiltersLiveUpdateSupported', false ); - $output->addJsConfigVars( - 'wgStructuredChangeFiltersSavedQueriesPreferenceName', - 'rcfilters-wl-saved-queries' - ); $output->addJsConfigVars( 'wgStructuredChangeFiltersEditWatchlistUrl', SpecialPage::getTitleFor( 'EditWatchlist' )->getLocalURL() @@ -277,10 +275,9 @@ class SpecialWatchlist extends ChangesListSpecialPage { */ public function getDefaultOptions() { $opts = parent::getDefaultOptions(); - $user = $this->getUser(); - $opts->add( 'days', $user->getOption( 'watchlistdays' ), FormOptions::FLOAT ); - $opts->add( 'limit', $user->getIntOption( 'wllimit' ), FormOptions::INT ); + $opts->add( 'days', $this->getDefaultDays(), FormOptions::FLOAT ); + $opts->add( 'limit', $this->getDefaultLimit(), FormOptions::INT ); return $opts; } @@ -636,11 +633,13 @@ class SpecialWatchlist extends ChangesListSpecialPage { 'id' => 'mw-watchlist-form' ] ); $form .= Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ); - $form .= Xml::fieldset( - $this->msg( 'watchlist-options' )->text(), - false, + $form .= Xml::openElement( + 'fieldset', [ 'id' => 'mw-watchlist-options', 'class' => 'cloptions' ] ); + $form .= Xml::element( + 'legend', null, $this->msg( 'watchlist-options' )->text() + ); if ( !$this->isStructuredFilterUiEnabled() ) { $form .= $this->makeLegend(); @@ -918,6 +917,6 @@ class SpecialWatchlist extends ChangesListSpecialPage { } function getDefaultDays() { - return $this->getUser()->getIntOption( 'watchlistdays' ); + return floatval( $this->getUser()->getOption( 'watchlistdays' ) ); } }