r45698 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45697‎ | r45698 | r45699 >
Date:13:46, 13 January 2009
Author:aaron
Status:resolved (Comments)
Tags:
Comment:
(bug 16969) Add show/hide to Preferences for option on specialpages added by FlaggedRevs
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialPreferences.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRecentchanges.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialWatchlist.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -1013,9 +1013,13 @@
10141014 * @return \type{\arrayof{\string}} Array of user toggle names
10151015 */
10161016 static function getToggles() {
1017 - global $wgContLang;
 1017+ global $wgContLang, $wgUseRCPatrol;
10181018 $extraToggles = array();
10191019 wfRunHooks( 'UserToggles', array( &$extraToggles ) );
 1020+ if( $wgUseRCPatrol ) {
 1021+ $extraToggles[] = 'hidepatrolled';
 1022+ $extraToggles[] = 'watchlisthidepatrolled';
 1023+ }
10201024 return array_merge( self::$mToggles, $extraToggles, $wgContLang->getExtraUserToggles() );
10211025 }
10221026
Index: trunk/phase3/includes/specials/SpecialPreferences.php
@@ -1093,6 +1093,7 @@
10941094 );
10951095
10961096 $toggles[] = 'hideminor';
 1097+ $toggles[] = 'hidepatrolled';
10971098 if( $wgRCShowWatchingUsers )
10981099 $toggles[] = 'shownumberswatching';
10991100 $toggles[] = 'usenewrc';
@@ -1112,7 +1113,8 @@
11131114 Xml::inputLabel( wfMsg( 'prefs-watchlist-edits' ), 'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) . ' ' .
11141115 wfMsgHTML( 'prefs-watchlist-edits-max' ) .
11151116 '<br /><br />' .
1116 - $this->getToggles( array( 'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown', 'watchlisthideanons', 'watchlisthideliu' ) )
 1117+ $this->getToggles( array( 'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown',
 1118+ 'watchlisthideanons', 'watchlisthideliu', 'watchlisthidepatrolled' ) )
11171119 );
11181120
11191121 if( $wgUser->isAllowed( 'createpage' ) || $wgUser->isAllowed( 'createtalk' ) ) {
Index: trunk/phase3/includes/specials/SpecialRecentchanges.php
@@ -23,11 +23,11 @@
2424 $opts->add( 'limit', (int)$wgUser->getOption( 'rclimit' ) );
2525 $opts->add( 'from', '' );
2626
27 - $opts->add( 'hideminor', (bool)$wgUser->getOption( 'hideminor' ) );
 27+ $opts->add( 'hideminor', $wgUser->getBoolOption( 'hideminor' ) );
2828 $opts->add( 'hidebots', true );
2929 $opts->add( 'hideanons', false );
3030 $opts->add( 'hideliu', false );
31 - $opts->add( 'hidepatrolled', false );
 31+ $opts->add( 'hidepatrolled', $wgUser->getBoolOption( 'hidepatrolled' ) );
3232 $opts->add( 'hidemyself', false );
3333
3434 $opts->add( 'namespace', '', FormOptions::INTNULL );
Index: trunk/phase3/includes/specials/SpecialWatchlist.php
@@ -54,7 +54,7 @@
5555 /* bool */ 'hideBots' => (int)$wgUser->getBoolOption( 'watchlisthidebots' ),
5656 /* bool */ 'hideAnons' => (int)$wgUser->getBoolOption( 'watchlisthideanons' ),
5757 /* bool */ 'hideLiu' => (int)$wgUser->getBoolOption( 'watchlisthideliu' ),
58 - /* bool */ 'hidePatrolled' => (int)$wgUser->getBoolOption( 'watchlisthidepatrolled' ), // TODO
 58+ /* bool */ 'hidePatrolled' => (int)$wgUser->getBoolOption( 'watchlisthidepatrolled' ),
5959 /* bool */ 'hideOwn' => (int)$wgUser->getBoolOption( 'watchlisthideown' ),
6060 /* ? */ 'namespace' => 'all',
6161 /* ? */ 'invert' => false,
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -490,6 +490,7 @@
491491 'tog-highlightbroken' => 'Format broken links <a href="" class="new">like this</a> (alternative: like this<a href="" class="internal">?</a>).',
492492 'tog-justify' => 'Justify paragraphs',
493493 'tog-hideminor' => 'Hide minor edits in recent changes',
 494+'tog-hidepatrolled' => 'Hide patrolled edits in recent changes',
494495 'tog-extendwatchlist' => 'Expand watchlist to show all applicable changes',
495496 'tog-usenewrc' => 'Enhanced recent changes (JavaScript)',
496497 'tog-numberheadings' => 'Auto-number headings',
@@ -524,6 +525,7 @@
525526 'tog-watchlisthideminor' => 'Hide minor edits from the watchlist',
526527 'tog-watchlisthideliu' => 'Hide edits by logged in users from the watchlist',
527528 'tog-watchlisthideanons' => 'Hide edits by anonymous users from the watchlist',
 529+'tog-watchlisthidepatrolled' => 'Hide patrolled edits from the watchlist',
528530 'tog-nolangconversion' => 'Disable variants conversion', # only translate this message to other languages if you have to change it
529531 'tog-ccmeonemails' => 'Send me copies of e-mails I send to other users',
530532 'tog-diffonly' => 'Do not show page content below diffs',

Follow-up revisions

RevisionCommit summaryAuthorDate
r45699follow up r45698: Add new messagesraymond14:15, 13 January 2009
r45757Follow-up to r45698 "(bug 16969) Add show/hide to Preferences for option on s...brion22:31, 14 January 2009
r45953Follow up r45698 and r45857: Add new options to $wgDefaultUserOptionsraymond08:02, 21 January 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   22:33, 14 January 2009

Follow-up in r45757 hides the extra core options when RC patrol is disabled; they were being shown regardless of whether patrolling was on.

#Comment by Raymond (talk | contribs)   08:03, 21 January 2009

Follow-up in r45953: New options added to $wgDefaultUserOptions

Status & tagging log