From 941a032df2cf74d8fb5d56cefa4a6b173ad5c6e8 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sat, 16 Dec 2006 21:36:01 +0000 Subject: [PATCH] * (bug 4488) Support watching pages on deletion; introduces new user preference --- RELEASE-NOTES | 3 ++- includes/Article.php | 10 ++++++++++ includes/SpecialPreferences.php | 25 +++++++++++++------------ includes/User.php | 1 + languages/messages/MessagesEn.php | 1 + 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1e22e998f1..6c557060c0 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -327,7 +327,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 8164) Special:Booksources should use GET for form submission * Rewrite Special:Booksources to clean up interface and remove redundant code * (bug 7925) Change Special:Allmessages message name filter javascript to be - a bit more responsive and easier on the CPU. + a bit more responsive and easier on the CPU +* (bug 4488) Support watching pages on deletion; introduces new user preference == Languages updated == diff --git a/includes/Article.php b/includes/Article.php index e1242d3155..1e2a9a6496 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1725,6 +1725,11 @@ class Article { if( $confirm ) { $this->doDelete( $reason ); + if( $wgRequest->getCheck( 'wpWatch' ) ) { + $this->doWatch(); + } elseif( $this->mTitle->userIsWatching() ) { + $this->doUnwatch(); + } return; } @@ -1864,6 +1869,7 @@ class Article { $confirm = htmlspecialchars( wfMsg( 'deletepage' ) ); $delcom = htmlspecialchars( wfMsg( 'deletecomment' ) ); $token = htmlspecialchars( $wgUser->editToken() ); + $watch = Xml::checkLabel( wfMsg( 'watchthis' ), 'wpWatch', 'wpWatch', $wgUser->getBoolOption( 'watchdeletion' ) || $this->mTitle->userIsWatching() ); $wgOut->addHTML( "
@@ -1876,6 +1882,10 @@ class Article { + +   + $watch +   diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index da2d3cd55a..1fb9d5e71f 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -853,8 +853,6 @@ class PreferencesForm { 'showtoolbar', 'previewonfirst', 'previewontop', - 'watchcreations', - 'watchdefault', 'minordefault', 'externaleditor', 'externaldiff', @@ -876,16 +874,19 @@ class PreferencesForm { ); # Watchlist - $wgOut->addHTML( '
' . wfMsgHtml( 'prefs-watchlist' ) . '' ); - - $wgOut->addHTML( wfInputLabel( wfMsg( 'prefs-watchlist-days' ), - 'wpWatchlistDays', 'wpWatchlistDays', 3, $this->mWatchlistDays ) ); - $wgOut->addHTML( '

' ); # Spacing - $wgOut->addHTML( $this->getToggles( array( 'watchlisthideown', 'watchlisthidebots', 'extendwatchlist' ) ) ); - $wgOut->addHTML( wfInputLabel( wfMsg( 'prefs-watchlist-edits' ), - 'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) ); - - $wgOut->addHTML( '
' ); + $wgOut->addHtml( '
' . wfMsgHtml( 'prefs-watchlist' ) . '' ); + + $wgOut->addHtml( wfInputLabel( wfMsg( 'prefs-watchlist-days' ), 'wpWatchlistDays', 'wpWatchlistDays', 3, $this->mWatchlistDays ) ); + $wgOut->addHtml( '

' ); + + $wgOut->addHtml( $this->getToggle( 'extendwatchlist' ) ); + $wgOut->addHtml( wfInputLabel( wfMsg( 'prefs-watchlist-edits' ), 'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) ); + $wgOut->addHtml( '

' ); + + $wgOut->addHtml( $this->getToggles( array( 'watchlisthideown', 'watchlisthidebots' ) ) ); + $wgOut->addHtml( $this->getToggles( array( 'watchdefault', 'watchcreations', 'watchdeletion' ) ) ); + + $wgOut->addHtml( '
' ); # Search $wgOut->addHTML( '
' . wfMsg( 'searchresultshead' ) . '' . diff --git a/includes/User.php b/includes/User.php index 7f98ee0c0c..7001ddb4e0 100644 --- a/includes/User.php +++ b/includes/User.php @@ -50,6 +50,7 @@ class User { 'editwidth', 'watchcreations', 'watchdefault', + 'watchdeletion', 'minordefault', 'previewontop', 'previewonfirst', diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 79185c945c..3e5fc0213e 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -464,6 +464,7 @@ parent class in order maintain consistency across languages. 'tog-editwidth' => 'Edit box has full width', 'tog-watchcreations' => 'Add pages I create to my watchlist', 'tog-watchdefault' => 'Add pages I edit to my watchlist', +'tog-watchdeletion' => 'Add pages I delete to my watchlist', 'tog-minordefault' => 'Mark all edits minor by default', 'tog-previewontop' => 'Show preview before edit box', 'tog-previewonfirst' => 'Show preview on first edit', -- 2.20.1