* (bug 4488) Support watching pages on deletion; introduces new user preference
authorRob Church <robchurch@users.mediawiki.org>
Sat, 16 Dec 2006 21:36:01 +0000 (21:36 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sat, 16 Dec 2006 21:36:01 +0000 (21:36 +0000)
RELEASE-NOTES
includes/Article.php
includes/SpecialPreferences.php
includes/User.php
languages/messages/MessagesEn.php

index 1e22e99..6c55706 100644 (file)
@@ -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 ==
 
index e1242d3..1e2a9a6 100644 (file)
@@ -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( "
 <form id='deleteconfirm' method='post' action=\"{$formaction}\">
@@ -1876,6 +1882,10 @@ class Article {
                                <input type='text' size='60' name='wpReason' id='wpReason' value=\"" . htmlspecialchars( $reason ) . "\" />
                        </td>
                </tr>
+               <tr>
+                       <td>&nbsp;</td>
+                       <td>$watch</td>
+               </tr>
                <tr>
                        <td>&nbsp;</td>
                        <td>
index da2d3cd..1fb9d5e 100644 (file)
@@ -853,8 +853,6 @@ class PreferencesForm {
                                'showtoolbar',
                                'previewonfirst',
                                'previewontop',
-                               'watchcreations',
-                               'watchdefault',
                                'minordefault',
                                'externaleditor',
                                'externaldiff',
@@ -876,16 +874,19 @@ class PreferencesForm {
                );
 
                # Watchlist
-               $wgOut->addHTML( '<fieldset><legend>' . wfMsgHtml( 'prefs-watchlist' ) . '</legend>' );
-
-               $wgOut->addHTML( wfInputLabel( wfMsg( 'prefs-watchlist-days' ),
-                       'wpWatchlistDays', 'wpWatchlistDays', 3, $this->mWatchlistDays ) );
-               $wgOut->addHTML( '<br /><br />' ); # Spacing
-               $wgOut->addHTML( $this->getToggles( array( 'watchlisthideown', 'watchlisthidebots', 'extendwatchlist' ) ) );
-               $wgOut->addHTML( wfInputLabel( wfMsg( 'prefs-watchlist-edits' ),
-                       'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) );
-
-               $wgOut->addHTML( '</fieldset>' );
+               $wgOut->addHtml( '<fieldset><legend>' . wfMsgHtml( 'prefs-watchlist' ) . '</legend>' );
+               
+               $wgOut->addHtml( wfInputLabel( wfMsg( 'prefs-watchlist-days' ), 'wpWatchlistDays', 'wpWatchlistDays', 3, $this->mWatchlistDays ) );
+               $wgOut->addHtml( '<br /><br />' );
+
+               $wgOut->addHtml( $this->getToggle( 'extendwatchlist' ) );
+               $wgOut->addHtml( wfInputLabel( wfMsg( 'prefs-watchlist-edits' ), 'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) );
+               $wgOut->addHtml( '<br /><br />' );
+
+               $wgOut->addHtml( $this->getToggles( array( 'watchlisthideown', 'watchlisthidebots' ) ) );
+               $wgOut->addHtml( $this->getToggles( array( 'watchdefault', 'watchcreations', 'watchdeletion' ) ) );
+               
+               $wgOut->addHtml( '</fieldset>' );
 
                # Search
                $wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'searchresultshead' ) . '</legend><table>' .
index 7f98ee0..7001ddb 100644 (file)
@@ -50,6 +50,7 @@ class User {
                'editwidth',
                'watchcreations',
                'watchdefault',
+               'watchdeletion',
                'minordefault',
                'previewontop',
                'previewonfirst',
index 79185c9..3e5fc02 100644 (file)
@@ -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',