the timestamp of the last update, in YYYYMMDDHHMMSS format.
* (bug 5628) More translations for MessagesHr.php
* (bug 5595) Localisation for Bosnian language (bs)
+* (bug 2910) Default view preferences for watchlists
== Compatibility ==
$this->mReset = $request->getCheck( 'wpReset' );
$this->mPosted = $request->wasPosted();
$this->mSuccess = $request->getCheck( 'success' );
+ $this->mWatchlistDays = $request->getVal( 'wpWatchlistDays' );
$this->mSaveprefs = $request->getCheck( 'wpSaveprefs' ) &&
$this->mPosted &&
return $val;
}
+ /**
+ * @access private
+ */
+ function validateFloat( &$val, $min, $max=0x7fffffff ) {
+ $val = floatval( $val );
+ $val = min( $val, $max );
+ $val = max( $val, $min );
+ return( $val );
+ }
+
/**
* @access private
*/
$wgUser->setOption( 'imagesize', $this->mImageSize );
$wgUser->setOption( 'thumbsize', $this->mThumbSize );
$wgUser->setOption( 'underline', $this->validateInt($this->mUnderline, 0, 2) );
+ $wgUser->setOption( 'watchlistdays', $this->validateFloat( $this->mWatchlistDays, 0.5, 5 ) );
# Set search namespace options
foreach( $this->mSearchNs as $i => $value ) {
$this->mThumbSize = $wgUser->getOption( 'thumbsize' );
$this->mRecent = $wgUser->getOption( 'rclimit' );
$this->mUnderline = $wgUser->getOption( 'underline' );
+ $this->mWatchlistDays = $wgUser->getOption( 'watchlistdays' );
$togs = $wgLang->getUserToggles();
foreach ( $togs as $tname ) {
) . '</fieldset>'
);
+ # Watchlist
+ $wgOut->addHTML( '<fieldset><legend>' . wfMsgHtml( 'prefs-watchlist' ) . '</legend>' );
+
+ $wgOut->addHTML( '<label for="wpWatchlistDays">' . wfMsgHtml( 'prefs-watchlist-days' ) . '</label> ' );
+ $wgOut->addHTML( '<input type="text" name="wpWatchlistDays" id="wpWatchlistDays" value="' . $this->mWatchlistDays . '" size="3" />' );
+ $wgOut->addHTML( '<p></p>' ); # Spacing
+ $wgOut->addHTML( $this->getToggles( array( 'watchlisthideown' ) ) );
+
+ $wgOut->addHTML( '</fieldset>' );
+
+ # Search
$wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'searchresultshead' ) . '</legend><table>' .
$this->addRow(
'<label for="wpSearch">' . wfMsg( 'resultsperpage' ) . '</label>',
extract($defaults);
+ # Extract variables from the request, falling back to user preferences or
+ # other default values if these don't exist
+ $prefs['days'] = floatval( $wgUser->getOption( 'watchlistdays' ) );
+ $prefs['hideown'] = $wgUser->getBoolOption( 'watchlisthideown' );
+
+ # The hide bots thing is b0rk3d for now
+ # $prefs['bots'] = $wgUser->getBoolOption( 'watchlisthidebots' );
+
# Get query variables
- $days = $wgRequest->getVal( 'days' );
- $hideOwn = $wgRequest->getBool( 'hideOwn' );
+ $days = $wgRequest->getVal( 'days', $prefs['days'] );
+ $hideOwn = $wgRequest->getBool( 'hideOwn', $prefs['hideown'] );
$hideBots = $wgRequest->getBool( 'hideBots' );
# Get namespace value, if supplied, and prepare a WHERE fragment
'showjumplinks' => 1,
'numberheadings' => 0,
'uselivepreview' => 0,
+ 'watchlistdays' => 3.0,
);
/* private */ $wgQuickbarSettingsEn = array(
'uselivepreview',
'autopatrol',
'forceeditsummary',
+ 'watchlisthideown',
);
/* private */ $wgBookstoreListEn = array(
'tog-uselivepreview' => 'Use live preview (JavaScript) (Experimental)',
'tog-autopatrol' => 'Mark edits I make as patrolled',
'tog-forceeditsummary' => 'Prompt me when entering a blank edit summary',
+'tog-watchlisthideown' => 'Hide my edits from the watchlist',
'underline-always' => 'Always',
'underline-never' => 'Never',
'math_notexvc' => 'Missing texvc executable; please see math/README to configure.',
'prefs-personal' => 'User profile',
'prefs-rc' => 'Recent changes',
+'prefs-watchlist' => 'Watchlist',
+'prefs-watchlist-days' => 'Number of days to show in watchlist:',
'prefs-misc' => 'Misc',
'saveprefs' => 'Save',
'resetprefs' => 'Reset',