From 0c796633ae9e85e72f864e07836b9a4d839f6371 Mon Sep 17 00:00:00 2001 From: Anders Wegge Jakobsen Date: Tue, 18 Apr 2006 11:47:09 +0000 Subject: [PATCH] Add preference settings for extended watchlists --- RELEASE-NOTES | 2 ++ includes/SpecialPreferences.php | 9 +++++++-- includes/SpecialWatchlist.php | 14 ++++++++++++-- languages/Language.php | 2 ++ languages/Messages.php | 2 ++ languages/MessagesDa.php | 2 ++ 6 files changed, 27 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 804f8e9c7e..6190595f66 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -95,6 +95,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 2910) Default view preferences for watchlists * Add "hide bot edits from the watchlist" user preference * (bug 5250) Introduce Special:Unusedtemplates +* Add user preference setting for an extended watchlist, showing all recent + edits up to a certain edit, and not just the latest edit.. == Compatibility == diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index 83277628a9..962be13096 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -27,7 +27,7 @@ class PreferencesForm { var $mUserLanguage, $mUserVariant; var $mSearch, $mRecent, $mHourDiff, $mSearchLines, $mSearchChars, $mAction; var $mReset, $mPosted, $mToggles, $mSearchNs, $mRealName, $mImageSize; - var $mUnderline; + var $mUnderline, $mWatchlistEdits; /** * Constructor @@ -65,6 +65,7 @@ class PreferencesForm { $this->mPosted = $request->wasPosted(); $this->mSuccess = $request->getCheck( 'success' ); $this->mWatchlistDays = $request->getVal( 'wpWatchlistDays' ); + $this->mWatchlistEdits = $request->getVal( 'wpWatchlistEdits' ); $this->mSaveprefs = $request->getCheck( 'wpSaveprefs' ) && $this->mPosted && @@ -258,6 +259,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( '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 ) ); $wgUser->setOption( 'stubthreshold', $this->validateIntOrNull( $this->mStubs ) ); @@ -362,6 +364,7 @@ class PreferencesForm { $this->mImageSize = $wgUser->getOption( 'imagesize' ); $this->mThumbSize = $wgUser->getOption( 'thumbsize' ); $this->mRecent = $wgUser->getOption( 'rclimit' ); + $this->mWatchlistEdits = $wgUser->getOption( 'wllimit' ); $this->mUnderline = $wgUser->getOption( 'underline' ); $this->mWatchlistDays = $wgUser->getOption( 'watchlistdays' ); @@ -853,7 +856,9 @@ class PreferencesForm { $wgOut->addHTML( ' ' ); $wgOut->addHTML( '' ); $wgOut->addHTML( '

' ); # Spacing - $wgOut->addHTML( $this->getToggles( array( 'watchlisthideown', 'watchlisthidebots' ) ) ); + $wgOut->addHTML( $this->getToggles( array( 'watchlisthideown', 'watchlisthidebots', 'extendwatchlist' ) ) ); + $wgOut->addHTML( ' ' ); + $wgOut->addHTML( '' ); $wgOut->addHTML( '' ); diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php index 2ad6c9f426..368030d653 100644 --- a/includes/SpecialWatchlist.php +++ b/includes/SpecialWatchlist.php @@ -259,6 +259,15 @@ function wfSpecialWatchlist( $par ) { $header .= wfMsg( 'wlheader-showupdated' ) . "\n"; } + # Toggle watchlist content (all recent edits or just the latest) + if( $wgUser->getOption( 'extendwatchlist' )) { + $andLatest=''; + $limitWatchlist = 'LIMIT ' . $wgUser->getOption( 'wllimit' ); + } else { + $andLatest= 'AND rc_this_oldid=page_latest'; + $limitWatchlist = ''; + } + # TODO: Consider removing the third parameter $header .= wfMsg( 'watchdetails', $wgLang->formatNum( $nitems ), $wgLang->formatNum( $npages ), '', @@ -288,11 +297,12 @@ function wfSpecialWatchlist( $par ) { AND wl_title=rc_title AND rc_timestamp > '$cutoff' AND rc_cur_id=page_id - AND rc_this_oldid=page_latest + $andLatest $andHideOwn $andHideBots $nameSpaceClause - ORDER BY rc_timestamp DESC"; + ORDER BY rc_timestamp DESC + $limitWatchlist"; $res = $dbr->query( $sql, $fname ); $numRows = $dbr->numRows( $res ); diff --git a/languages/Language.php b/languages/Language.php index 6a2d2009da..70a1a8b79c 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -62,6 +62,7 @@ if(isset($wgExtraNamespaces)) { 'math' => 1, 'rcdays' => 7, 'rclimit' => 50, + 'wllimit' => 250, 'highlightbroken' => 1, 'stubthreshold' => 0, 'previewontop' => 1, @@ -135,6 +136,7 @@ $wgDateFormatsEn = array( 'highlightbroken', 'justify', 'hideminor', + 'extendwatchlist', 'usenewrc', 'numberheadings', 'showtoolbar', diff --git a/languages/Messages.php b/languages/Messages.php index babcae73ee..603b5c2237 100644 --- a/languages/Messages.php +++ b/languages/Messages.php @@ -36,6 +36,7 @@ parent class in order maintain consistency across languages. 'tog-highlightbroken' => 'Format broken links like this (alternative: like this?).', 'tog-justify' => 'Justify paragraphs', 'tog-hideminor' => 'Hide minor edits in recent changes', +'tog-extendwatchlist' => 'Enhanced watchlist', 'tog-usenewrc' => 'Enhanced recent changes (JavaScript)', 'tog-numberheadings' => 'Auto-number headings', 'tog-showtoolbar' => 'Show edit toolbar (JavaScript)', @@ -699,6 +700,7 @@ $2 List redirects   Search for $3 $9", 'prefs-rc' => 'Recent changes', 'prefs-watchlist' => 'Watchlist', 'prefs-watchlist-days' => 'Number of days to show in watchlist:', +'prefs-watchlist-edits' => 'Number of edits to show in expanded watchlist:', 'prefs-misc' => 'Misc', 'saveprefs' => 'Save', 'resetprefs' => 'Reset', diff --git a/languages/MessagesDa.php b/languages/MessagesDa.php index 35991aa06f..7859bbdb64 100644 --- a/languages/MessagesDa.php +++ b/languages/MessagesDa.php @@ -11,6 +11,7 @@ "tog-highlightbroken" => "Brug røde henvisninger til tomme sider", "tog-justify" => "Justér afsnit", "tog-hideminor" => "Skjul mindre ændringer i seneste ændringer listen", +"tog-extendwatchlist" => "Udvidet liste med seneste ændringer", "tog-usenewrc" => "Udvidet seneste ændringer liste
(ikke for alle browsere)", "tog-numberheadings" => "Automatisk nummerering af overskrifter", "tog-showtoolbar" => "Vis værktøjslinje til redigering", @@ -539,6 +540,7 @@ for at ændre brugerindstillinger.", 'prefs-personal' => 'Brugerdata', 'prefs-rc' => 'Seneste ændringer og artikelstumper', 'prefs-misc' => 'Forskelligt', +'prefs-watchlist-edits' => 'Antal redigeringer der vises i udvidet overvågningsliste:', "saveprefs" => "Gem indstillinger", "resetprefs" => "Gendan indstillinger", "oldpassword" => "Gammel adgangskode", -- 2.20.1