(bug 16957) Add show/hide to Preferences for option on Special:NewPages
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 18 Jan 2009 00:01:58 +0000 (00:01 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 18 Jan 2009 00:01:58 +0000 (00:01 +0000)
includes/User.php
includes/specials/SpecialNewpages.php
includes/specials/SpecialPreferences.php
languages/messages/MessagesEn.php

index af7871c..f87323f 100644 (file)
@@ -1020,6 +1020,7 @@ class User {
                wfRunHooks( 'UserToggles', array( &$extraToggles ) );
                if( $wgUseRCPatrol ) {
                        $extraToggles[] = 'hidepatrolled';
+                       $extraToggles[] = 'newpageshidepatrolled';
                        $extraToggles[] = 'watchlisthidepatrolled';
                }
                return array_merge( self::$mToggles, $extraToggles, $wgContLang->getExtraUserToggles() );
index b4940f1..685e215 100644 (file)
@@ -24,7 +24,7 @@ class SpecialNewpages extends SpecialPage {
                $opts = new FormOptions();
                $this->opts = $opts; // bind
                $opts->add( 'hideliu', false );
-               $opts->add( 'hidepatrolled', false );
+               $opts->add( 'hidepatrolled', $wgUser->getBoolOption( 'newpageshidepatrolled' ) );
                $opts->add( 'hidebots', false );
                $opts->add( 'hideredirs', true );
                $opts->add( 'limit', (int)$wgUser->getOption( 'rclimit' ) );
index 08d7107..cc61775 100644 (file)
@@ -1093,10 +1093,11 @@ class PreferencesForm {
                );
 
                $toggles[] = 'hideminor';
-               if( $wgUseRCPatrol )
+               if( $wgUseRCPatrol ) {
                        $toggles[] = 'hidepatrolled';
-               if( $wgRCShowWatchingUsers )
-                       $toggles[] = 'shownumberswatching';
+                       $toggles[] = 'newpageshidepatrolled';
+               }
+               if( $wgRCShowWatchingUsers ) $toggles[] = 'shownumberswatching';
                $toggles[] = 'usenewrc';
 
                $wgOut->addHTML(
@@ -1106,10 +1107,8 @@ class PreferencesForm {
 
                # Watchlist
                $watchlistToggles = array( 'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown',
-                               'watchlisthideanons', 'watchlisthideliu' );
-               if( $wgUseRCPatrol ) {
-                       $watchlistToggles[] = 'watchlisthidepatrolled';
-               }
+                       'watchlisthideanons', 'watchlisthideliu' );
+               if( $wgUseRCPatrol ) $watchlistToggles[] = 'watchlisthidepatrolled';
 
                $wgOut->addHTML( 
                        Xml::fieldset( wfMsg( 'prefs-watchlist' ) ) .
index 79f7fac..095917c 100644 (file)
@@ -491,6 +491,7 @@ XHTML id names.
 'tog-justify'                 => 'Justify paragraphs',
 'tog-hideminor'               => 'Hide minor edits in recent changes',
 'tog-hidepatrolled'           => 'Hide patrolled edits in recent changes',
+'tog-newpageshidepatrolled'   => 'Hide patrolled pages from new page list',
 'tog-extendwatchlist'         => 'Expand watchlist to show all applicable changes',
 'tog-usenewrc'                => 'Enhanced recent changes (JavaScript)',
 'tog-numberheadings'          => 'Auto-number headings',