(bug 16969) Add show/hide to Preferences for option on specialpages added by FlaggedRevs
authorAaron Schulz <aaron@users.mediawiki.org>
Tue, 13 Jan 2009 13:46:02 +0000 (13:46 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Tue, 13 Jan 2009 13:46:02 +0000 (13:46 +0000)
includes/User.php
includes/specials/SpecialPreferences.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialWatchlist.php
languages/messages/MessagesEn.php

index 41aaf5b..d1f2858 100644 (file)
@@ -1013,9 +1013,13 @@ class User {
         * @return \type{\arrayof{\string}} Array of user toggle names
         */
        static function getToggles() {
-               global $wgContLang;
+               global $wgContLang, $wgUseRCPatrol;
                $extraToggles = array();
                wfRunHooks( 'UserToggles', array( &$extraToggles ) );
+               if( $wgUseRCPatrol ) {
+                       $extraToggles[] = 'hidepatrolled';
+                       $extraToggles[] = 'watchlisthidepatrolled';
+               }
                return array_merge( self::$mToggles, $extraToggles, $wgContLang->getExtraUserToggles() );
        }
 
index 04ac759..16adc09 100644 (file)
@@ -1093,6 +1093,7 @@ class PreferencesForm {
                );
 
                $toggles[] = 'hideminor';
+               $toggles[] = 'hidepatrolled';
                if( $wgRCShowWatchingUsers )
                        $toggles[] = 'shownumberswatching';
                $toggles[] = 'usenewrc';
@@ -1112,7 +1113,8 @@ class PreferencesForm {
                        Xml::inputLabel( wfMsg( 'prefs-watchlist-edits' ), 'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) . ' ' .
                        wfMsgHTML( 'prefs-watchlist-edits-max' ) .
                        '<br /><br />' .
-                       $this->getToggles( array( 'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown', 'watchlisthideanons', 'watchlisthideliu' ) )
+                       $this->getToggles( array( 'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown',
+                               'watchlisthideanons', 'watchlisthideliu', 'watchlisthidepatrolled' ) )
                );
 
                if( $wgUser->isAllowed( 'createpage' ) || $wgUser->isAllowed( 'createtalk' ) ) {
index 8c14e1f..6729c91 100644 (file)
@@ -23,11 +23,11 @@ class SpecialRecentChanges extends SpecialPage {
                $opts->add( 'limit', (int)$wgUser->getOption( 'rclimit' ) );
                $opts->add( 'from', '' );
 
-               $opts->add( 'hideminor',     (bool)$wgUser->getOption( 'hideminor' ) );
+               $opts->add( 'hideminor',     $wgUser->getBoolOption( 'hideminor' ) );
                $opts->add( 'hidebots',      true  );
                $opts->add( 'hideanons',     false );
                $opts->add( 'hideliu',       false );
-               $opts->add( 'hidepatrolled', false );
+               $opts->add( 'hidepatrolled', $wgUser->getBoolOption( 'hidepatrolled' ) );
                $opts->add( 'hidemyself',    false );
 
                $opts->add( 'namespace', '', FormOptions::INTNULL );
index 61dd6b3..6e7fb6e 100644 (file)
@@ -54,7 +54,7 @@ function wfSpecialWatchlist( $par ) {
        /* bool  */ 'hideBots'  => (int)$wgUser->getBoolOption( 'watchlisthidebots' ),
        /* bool  */ 'hideAnons' => (int)$wgUser->getBoolOption( 'watchlisthideanons' ),
        /* bool  */ 'hideLiu'   => (int)$wgUser->getBoolOption( 'watchlisthideliu' ),
-       /* bool  */ 'hidePatrolled' => (int)$wgUser->getBoolOption( 'watchlisthidepatrolled' ), // TODO
+       /* bool  */ 'hidePatrolled' => (int)$wgUser->getBoolOption( 'watchlisthidepatrolled' ),
        /* bool  */ 'hideOwn'   => (int)$wgUser->getBoolOption( 'watchlisthideown' ),
        /* ?     */ 'namespace' => 'all',
        /* ?     */ 'invert'    => false,
index e7acf03..66a26bc 100644 (file)
@@ -490,6 +490,7 @@ XHTML id names.
 'tog-highlightbroken'         => 'Format broken links <a href="" class="new">like this</a> (alternative: like this<a href="" class="internal">?</a>).',
 'tog-justify'                 => 'Justify paragraphs',
 'tog-hideminor'               => 'Hide minor edits in recent changes',
+'tog-hidepatrolled'           => 'Hide patrolled edits in recent changes',
 'tog-extendwatchlist'         => 'Expand watchlist to show all applicable changes',
 'tog-usenewrc'                => 'Enhanced recent changes (JavaScript)',
 'tog-numberheadings'          => 'Auto-number headings',
@@ -524,6 +525,7 @@ XHTML id names.
 'tog-watchlisthideminor'      => 'Hide minor edits from the watchlist',
 'tog-watchlisthideliu'        => 'Hide edits by logged in users from the watchlist',
 'tog-watchlisthideanons'      => 'Hide edits by anonymous users from the watchlist',
+'tog-watchlisthidepatrolled'  => 'Hide patrolled edits from the watchlist',
 'tog-nolangconversion'        => 'Disable variants conversion', # only translate this message to other languages if you have to change it
 'tog-ccmeonemails'            => 'Send me copies of e-mails I send to other users',
 'tog-diffonly'                => 'Do not show page content below diffs',