X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialWatchlist.php;h=fcf1bfb8b91dbdb7843e7c0d4883a6497833dbf9;hb=7df800cb0b8040ed7bdc15741ab6a2494e48e63d;hp=531184b65feb359101f0221d0eee788f03ce435b;hpb=3a79761da37abe0e147e4a5ee61b7ee17ec7efc3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 531184b65f..fcf1bfb8b9 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -248,6 +248,22 @@ class SpecialWatchlist extends ChangesListSpecialPage { $hideLiu = $registration->getFilter( 'hideliu' ); $hideLiu->setDefault( $user->getBoolOption( 'watchlisthideliu' ) ); + // Selecting both hideanons and hideliu on watchlist preferances + // gives mutually exclusive filters, so those are ignored + if ( $user->getBoolOption( 'watchlisthideanons' ) && + !$user->getBoolOption( 'watchlisthideliu' ) + ) { + $this->getFilterGroup( 'userExpLevel' ) + ->setDefault( 'registered' ); + } + + if ( $user->getBoolOption( 'watchlisthideliu' ) && + !$user->getBoolOption( 'watchlisthideanons' ) + ) { + $this->getFilterGroup( 'userExpLevel' ) + ->setDefault( 'unregistered' ); + } + $reviewStatus = $this->getFilterGroup( 'reviewStatus' ); if ( $reviewStatus !== null ) { // Conditional on feature being available and rights @@ -608,11 +624,6 @@ class SpecialWatchlist extends ChangesListSpecialPage { } $lang = $this->getLanguage(); - if ( $opts['days'] > 0 ) { - $days = $opts['days']; - } else { - $days = $this->maxDays; - } $timestamp = wfTimestampNow(); $wlInfo = Html::rawElement( 'span', @@ -620,7 +631,7 @@ class SpecialWatchlist extends ChangesListSpecialPage { 'class' => 'wlinfo', 'data-params' => json_encode( [ 'from' => $timestamp ] ), ], - $this->msg( 'wlnote' )->numParams( $numRows, round( $days * 24 ) )->params( + $this->msg( 'wlnote' )->numParams( $numRows, round( $opts['days'] * 24 ) )->params( $lang->userDate( $timestamp, $user ), $lang->userTime( $timestamp, $user ) )->parse() ) . "
\n";