From e7633f9d84dff492663117240c28141007507095 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sun, 8 Apr 2007 09:30:06 +0000 Subject: [PATCH] (bug 929, 4215) Expose "rcdays" user preference in Special:Preferences --- RELEASE-NOTES | 1 + includes/SpecialPreferences.php | 35 ++++++++++++++++++++++--------- languages/messages/MessagesEn.php | 3 ++- maintenance/language/messages.inc | 1 + 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 844583e359..d7540d7571 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -306,6 +306,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN to edit page protection levels due to a block, database lock or permissions * Fixed $wgFeedLimit * (bug 9270) Corrected help namespace name for Dutch Lower Saxon (nds-nl) +* (bug 929, 4215) Expose "rcdays" user preference in Special:Preferences == Maintenance == diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index d26d31ea4f..5ca818cdbb 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -23,7 +23,7 @@ class PreferencesForm { var $mQuickbar, $mOldpass, $mNewpass, $mRetypePass, $mStubs; var $mRows, $mCols, $mSkin, $mMath, $mDate, $mUserEmail, $mEmailFlag, $mNick; var $mUserLanguage, $mUserVariant; - var $mSearch, $mRecent, $mHourDiff, $mSearchLines, $mSearchChars, $mAction; + var $mSearch, $mRecent, $mRecentDays, $mHourDiff, $mSearchLines, $mSearchChars, $mAction; var $mReset, $mPosted, $mToggles, $mSearchNs, $mRealName, $mImageSize; var $mUnderline, $mWatchlistEdits; @@ -52,6 +52,7 @@ class PreferencesForm { $this->mUserVariant = $request->getVal( 'wpUserVariant' ); $this->mSearch = $request->getVal( 'wpSearch' ); $this->mRecent = $request->getVal( 'wpRecent' ); + $this->mRecentDays = $request->getVal( 'wpRecentDays' ); $this->mHourDiff = $request->getVal( 'wpHourDiff' ); $this->mSearchLines = $request->getVal( 'wpSearchLines' ); $this->mSearchChars = $request->getVal( 'wpSearchChars' ); @@ -261,6 +262,7 @@ class PreferencesForm { $wgUser->setOption( 'contextlines', $this->validateIntOrNull( $this->mSearchLines ) ); $wgUser->setOption( 'contextchars', $this->validateIntOrNull( $this->mSearchChars ) ); $wgUser->setOption( 'rclimit', $this->validateIntOrNull( $this->mRecent ) ); + $wgUser->setOption( 'rcdays', $this->validateInt( $this->mRecentDays, 1, 7 ) ); $wgUser->setOption( 'wllimit', $this->validateIntOrNull( $this->mWatchlistEdits, 0, 1000 ) ); $wgUser->setOption( 'rows', $this->validateInt( $this->mRows, 4, 1000 ) ); $wgUser->setOption( 'cols', $this->validateInt( $this->mCols, 4, 1000 ) ); @@ -363,6 +365,7 @@ class PreferencesForm { $this->mImageSize = $wgUser->getOption( 'imagesize' ); $this->mThumbSize = $wgUser->getOption( 'thumbsize' ); $this->mRecent = $wgUser->getOption( 'rclimit' ); + $this->mRecentDays = $wgUser->getOption( 'rcdays' ); $this->mWatchlistEdits = $wgUser->getOption( 'wllimit' ); $this->mUnderline = $wgUser->getOption( 'underline' ); $this->mWatchlistDays = $wgUser->getOption( 'watchlistdays' ); @@ -859,15 +862,27 @@ class PreferencesForm { ) ) . '' ); - $wgOut->addHTML( '
' . htmlspecialchars(wfMsg('prefs-rc')) . '' . - wfInputLabel( wfMsg( 'recentchangescount' ), - 'wpRecent', 'wpRecent', 3, $this->mRecent ) . - $this->getToggles( array( - 'hideminor', - $wgRCShowWatchingUsers ? 'shownumberswatching' : false, - 'usenewrc' ) - ) . '
' - ); + # Recent changes + $wgOut->addHtml( '
' . wfMsgHtml( 'prefs-rc' ) . '' ); + + $rc = ''; + $rc .= ''; + $rc .= ''; + $rc .= ''; + $rc .= ''; + $rc .= ''; + $rc .= '
' . Xml::label( wfMsg( 'recentchangesdays' ), 'wpRecentDays' ) . '' . Xml::input( 'wpRecentDays', 3, $this->mRecentDays, array( 'id' => 'wpRecentDays' ) ) . '
' . Xml::label( wfMsg( 'recentchangescount' ), 'wpRecent' ) . '' . Xml::input( 'wpRecent', 3, $this->mRecent, array( 'id' => 'wpRecent' ) ) . '
'; + $wgOut->addHtml( $rc ); + + $wgOut->addHtml( '
' ); + + $toggles[] = 'hideminor'; + if( $wgRCShowWatchingUsers ) + $toggles[] = 'shownumberswatching'; + $toggles[] = 'usenewrc'; + $wgOut->addHtml( $this->getToggles( $toggles ) ); + + $wgOut->addHtml( '
' ); # Watchlist $wgOut->addHtml( '
' . wfMsgHtml( 'prefs-watchlist' ) . '' ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 60e1578308..3887f59742 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1239,7 +1239,8 @@ containing all of the search terms will appear in the result).", 'contextlines' => 'Lines per hit:', 'contextchars' => 'Context per line:', 'stubthreshold' => 'Threshold for stub display:', -'recentchangescount' => 'Titles in recent changes:', +'recentchangesdays' => 'Days to show in recent changes:', +'recentchangescount' => 'Number of edits to show in recent changes:', 'savedprefs' => 'Your preferences have been saved.', 'timezonelegend' => 'Time zone', 'timezonetext' => 'The number of hours your local time differs from server time (UTC).', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 7f0ce80fa9..ba73db8885 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -666,6 +666,7 @@ $wgMessageStructure = array( 'contextlines', 'contextchars', 'stubthreshold', + 'recentchangesdays', 'recentchangescount', 'savedprefs', 'timezonelegend', -- 2.20.1