(bug 4611) Add user preference (default on) to add new pages to creators's watchlist
authorRob Church <robchurch@users.mediawiki.org>
Sat, 18 Mar 2006 19:22:33 +0000 (19:22 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sat, 18 Mar 2006 19:22:33 +0000 (19:22 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/EditPage.php
includes/SpecialPreferences.php
languages/Language.php
languages/Messages.php

index 350ca5d..3d18e3e 100644 (file)
@@ -703,7 +703,7 @@ fully support the editing toolbar, but was found to be too confusing.
   reliable beyond the hostname where it's used for the spam bulk checker.
 * Don't URL-decode in the title attribute for URL links; it can produce false
   results that don't code back to their original values.
-
+* (bug 4611) Add user preference (default on) to add new pages to creators's watchlist
 
 === Caveats ===
 
index 1daf9e3..5338303 100644 (file)
@@ -1435,6 +1435,7 @@ $wgDefaultSkin = 'monobook';
  *
  */
 $wgDefaultUserOptions = array();
+$wgDefaultUserOptions['watchcreations'] = 1;
 
 /** Whether or not to allow and use real name fields. Defaults to true. */
 $wgAllowRealName = true;
index 480533c..b47dce7 100644 (file)
@@ -830,13 +830,19 @@ class EditPage {
 
                // activate checkboxes if user wants them to be always active
                if( !$this->preview && !$this->diff ) {
-                       if( $wgUser->getOption( 'watchdefault' ) ) $this->watchthis = true;
+                       # Sort out the "watch" checkbox
+                       if( $wgUser->getOption( 'watchdefault' ) ) {
+                               # Watch all edits
+                               $this->watchthis = true;
+                       } elseif( $wgUser->getOption( 'watchcreations' ) && !$this->mTitle->exists() ) {
+                               # Watch creations
+                               $this->watchthis = true;
+                       } elseif( $this->mTitle->userIsWatching() ) {
+                               # Already watched
+                               $this->watchthis = true;
+                       }
+                       
                        if( $wgUser->getOption( 'minordefault' ) ) $this->minoredit = true;
-
-                       // activate checkbox also if user is already watching the page,
-                       // require wpWatchthis to be unset so that second condition is not
-                       // checked unnecessarily
-                       if( !$this->watchthis && $this->mTitle->userIsWatching() ) $this->watchthis = true;
                }
 
                $minoredithtml = '';
index 5221ddf..fa7f9da 100644 (file)
@@ -812,6 +812,7 @@ class PreferencesForm {
                                'showtoolbar',
                                'previewonfirst',
                                'previewontop',
+                               'watchcreations',
                                'watchdefault',
                                'minordefault',
                                'externaleditor',
index 78b596f..103480e 100644 (file)
@@ -143,6 +143,7 @@ $wgDateFormatsEn = array(
        'showtoc',
        'rememberpassword',
        'editwidth',
+       'watchcreations',
        'watchdefault',
        'minordefault',
        'previewontop',
index 248d2e3..8ed3249 100644 (file)
@@ -45,6 +45,7 @@ parent class in order maintain consistency across languages.
 'tog-showtoc'                  => 'Show table of contents (for pages with more than 3 headings)',
 'tog-rememberpassword' => 'Remember across sessions',
 'tog-editwidth' => 'Edit box has full width',
+'tog-watchcreations' => 'Add pages you create to your watchlist',
 'tog-watchdefault' => 'Add pages you edit to your watchlist',
 'tog-minordefault' => 'Mark all edits minor by default',
 'tog-previewontop' => 'Show preview before edit box',