$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
}
$lang = $this->getLanguage();
- if ( $opts['days'] > 0 ) {
- $days = $opts['days'];
- } else {
- $days = $this->maxDays;
- }
$timestamp = wfTimestampNow();
$wlInfo = Html::rawElement(
'span',
'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()
) . "<br />\n";