$output = $this->getOutput();
$request = $this->getRequest();
$this->addHelpLink( 'Help:Watching pages' );
+ $output->addModules( array(
+ 'mediawiki.special.changeslist.visitedstatus',
+ ) );
$mode = SpecialEditWatchlist::getMode( $request, $subpage );
if ( $mode !== false ) {
$opts->add( 'hideliu', $user->getBoolOption( 'watchlisthideliu' ) );
$opts->add( 'hidepatrolled', $user->getBoolOption( 'watchlisthidepatrolled' ) );
$opts->add( 'hidemyself', $user->getBoolOption( 'watchlisthideown' ) );
-
- if ( $this->getConfig()->get( 'RCWatchCategoryMembership' ) ) {
- $opts->add( 'hidecategorization', $user->getBoolOption( 'watchlisthidecategorization' ) );
- }
+ $opts->add( 'hidecategorization', $user->getBoolOption( 'watchlisthidecategorization' ) );
return $opts;
}
$this->setTopText( $opts );
$lang = $this->getLanguage();
- $wlInfo = '';
if ( $opts['days'] > 0 ) {
- $timestamp = wfTimestampNow();
- $wlInfo = $this->msg( 'wlnote' )->numParams( $numRows, round( $opts['days'] * 24 ) )->params(
- $lang->userDate( $timestamp, $user ), $lang->userTime( $timestamp, $user )
- )->parse() . "<br />\n";
+ $days = $opts['days'];
+ } else {
+ $days = $this->getConfig()->get( 'RCMaxAge' ) / ( 3600 * 24 );
}
+ $timestamp = wfTimestampNow();
+ $wlInfo = $this->msg( 'wlnote' )->numParams( $numRows, round( $days * 24 ) )->params(
+ $lang->userDate( $timestamp, $user ), $lang->userTime( $timestamp, $user )
+ )->parse() . "<br />\n";
$nondefaults = $opts->getChangedValues();
$cutofflinks = $this->msg( 'wlshowtime' ) . ' ' . $this->cutoffselector( $opts );
);
if ( $this->getConfig()->get( 'RCWatchCategoryMembership' ) ) {
- $filters['hidecategorization'] = 'rcshowhidecategorization';
+ $filters['hidecategorization'] = 'wlshowhidecategorization';
}
foreach ( $this->getCustomFilters() as $key => $params ) {
$days[] = $userWatchlistOption;
}
+ $maxDays = (string)( $this->getConfig()->get( 'RCMaxAge' ) / ( 3600 * 24 ) );
+ // add the maximum possible value, if it isn't available already
+ if ( !in_array( $maxDays, $days ) ) {
+ $days[] = $maxDays;
+ }
+
$selected = (string)$options['days'];
+ if ( $selected <= 0 ) {
+ $selected = $maxDays;
+ }
+
// add the currently selected value, if it isn't available already
- if ( !in_array( $selected, $days ) && $selected !== '0' ) {
+ if ( !in_array( $selected, $days ) ) {
$days[] = $selected;
}
$select->addOption( $name, $value );
}
- // 'all' option
- $name = $this->msg( 'watchlistall2' )->text();
- $value = '0';
- $select->addOption( $name, $value );
-
return $select->getHTML() . "\n<br />\n";
}
array( 'id' => 'mw-watchlist-options' )
);
- $form .= SpecialRecentChanges::makeLegend( $this->getContext() );
+ $form .= $this->makeLegend();
$this->getOutput()->addHTML( $form );
}