Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -48,6 +48,8 @@ |
49 | 49 | 'tog-watchlisthideown', |
50 | 50 | 'tog-watchlisthidebots', |
51 | 51 | 'tog-watchlisthideminor', |
| 52 | + 'tog-watchlisthideliu', |
| 53 | + 'tog-watchlisthideanons', |
52 | 54 | 'tog-nolangconversion', |
53 | 55 | 'tog-ccmeonemails', |
54 | 56 | 'tog-diffonly', |
— | — | @@ -1374,6 +1376,10 @@ |
1375 | 1377 | 'watchlist-hide-own', |
1376 | 1378 | 'watchlist-show-minor', |
1377 | 1379 | 'watchlist-hide-minor', |
| 1380 | + 'watchlist-show-anons', |
| 1381 | + 'watchlist-hide-anons', |
| 1382 | + 'watchlist-show-liu', |
| 1383 | + 'watchlist-hide-liu', |
1378 | 1384 | ), |
1379 | 1385 | 'watching' => array( |
1380 | 1386 | 'watching', |
Index: trunk/phase3/includes/specials/SpecialPreferences.php |
— | — | @@ -1023,7 +1023,7 @@ |
1024 | 1024 | $wgOut->addHtml( wfInputLabel( wfMsg( 'prefs-watchlist-edits' ), 'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) ); |
1025 | 1025 | $wgOut->addHtml( '<br /><br />' ); |
1026 | 1026 | |
1027 | | - $wgOut->addHtml( $this->getToggles( array( 'watchlisthideown', 'watchlisthidebots', 'watchlisthideminor' ) ) ); |
| 1027 | + $wgOut->addHtml( $this->getToggles( array( 'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown', 'watchlisthideanons', 'watchlisthideliu' ) ) ); |
1028 | 1028 | |
1029 | 1029 | if( $wgUser->isAllowed( 'createpage' ) || $wgUser->isAllowed( 'createtalk' ) ) |
1030 | 1030 | $wgOut->addHtml( $this->getToggle( 'watchcreations' ) ); |
Index: trunk/phase3/includes/specials/SpecialWatchlist.php |
— | — | @@ -47,33 +47,44 @@ |
48 | 48 | } |
49 | 49 | |
50 | 50 | $defaults = array( |
51 | | - /* float */ 'days' => floatval( $wgUser->getOption( 'watchlistdays' ) ), /* 3.0 or 0.5, watch further below */ |
52 | | - /* bool */ 'hideOwn' => (int)$wgUser->getBoolOption( 'watchlisthideown' ), |
53 | | - /* bool */ 'hideBots' => (int)$wgUser->getBoolOption( 'watchlisthidebots' ), |
54 | | - /* bool */ 'hideMinor' => (int)$wgUser->getBoolOption( 'watchlisthideminor' ), |
| 51 | + /* float */ 'days' => floatval( $wgUser->getOption( 'watchlistdays' ) ), /* 3.0 or 0.5, watch further below */ |
| 52 | + /* bool */ 'hideMinor' => (int)$wgUser->getBoolOption( 'watchlisthideminor' ), |
| 53 | + /* bool */ 'hideBots' => (int)$wgUser->getBoolOption( 'watchlisthidebots' ), |
| 54 | + /* bool */ 'hideAnons' => (int)$wgUser->getBoolOption( 'watchlisthideanons' ), |
| 55 | + /* bool */ 'hideLiu' => (int)$wgUser->getBoolOption( 'watchlisthideliu' ), |
| 56 | + /* bool */ 'hideOwn' => (int)$wgUser->getBoolOption( 'watchlisthideown' ), |
55 | 57 | /* ? */ 'namespace' => 'all', |
| 58 | + /* ? */ 'invert' => false, |
56 | 59 | ); |
57 | 60 | |
58 | 61 | extract($defaults); |
59 | 62 | |
60 | 63 | # Extract variables from the request, falling back to user preferences or |
61 | 64 | # other default values if these don't exist |
62 | | - $prefs['days' ] = floatval( $wgUser->getOption( 'watchlistdays' ) ); |
63 | | - $prefs['hideown' ] = $wgUser->getBoolOption( 'watchlisthideown' ); |
64 | | - $prefs['hidebots'] = $wgUser->getBoolOption( 'watchlisthidebots' ); |
| 65 | + $prefs['days'] = floatval( $wgUser->getOption( 'watchlistdays' ) ); |
65 | 66 | $prefs['hideminor'] = $wgUser->getBoolOption( 'watchlisthideminor' ); |
| 67 | + $prefs['hidebots'] = $wgUser->getBoolOption( 'watchlisthidebots' ); |
| 68 | + $prefs['hideanons'] = $wgUser->getBoolOption( 'watchlisthideanon' ); |
| 69 | + $prefs['hideliu'] = $wgUser->getBoolOption( 'watchlisthideliu' ); |
| 70 | + $prefs['hideown' ] = $wgUser->getBoolOption( 'watchlisthideown' ); |
66 | 71 | |
67 | 72 | # Get query variables |
68 | | - $days = $wgRequest->getVal( 'days', $prefs['days'] ); |
69 | | - $hideOwn = $wgRequest->getBool( 'hideOwn', $prefs['hideown'] ); |
70 | | - $hideBots = $wgRequest->getBool( 'hideBots', $prefs['hidebots'] ); |
| 73 | + $days = $wgRequest->getVal( 'days' , $prefs['days'] ); |
71 | 74 | $hideMinor = $wgRequest->getBool( 'hideMinor', $prefs['hideminor'] ); |
| 75 | + $hideBots = $wgRequest->getBool( 'hideBots' , $prefs['hidebots'] ); |
| 76 | + $hideAnons = $wgRequest->getBool( 'hideAnons', $prefs['hideanons'] ); |
| 77 | + $hideLiu = $wgRequest->getBool( 'hideLiu' , $prefs['hideliu'] ); |
| 78 | + $hideOwn = $wgRequest->getBool( 'hideOwn' , $prefs['hideown'] ); |
72 | 79 | |
73 | 80 | # Get namespace value, if supplied, and prepare a WHERE fragment |
74 | 81 | $nameSpace = $wgRequest->getIntOrNull( 'namespace' ); |
| 82 | + $invert = $wgRequest->getIntOrNull( 'invert' ); |
75 | 83 | if( !is_null( $nameSpace ) ) { |
76 | 84 | $nameSpace = intval( $nameSpace ); |
77 | | - $nameSpaceClause = " AND rc_namespace = $nameSpace"; |
| 85 | + if( $invert && $nameSpace != 'all' ) |
| 86 | + $nameSpaceClause = " AND rc_namespace != $nameSpace"; |
| 87 | + else |
| 88 | + $nameSpaceClause = " AND rc_namespace = $nameSpace"; |
78 | 89 | } else { |
79 | 90 | $nameSpace = ''; |
80 | 91 | $nameSpaceClause = ''; |
— | — | @@ -103,11 +114,13 @@ |
104 | 115 | // Dump everything here |
105 | 116 | $nondefaults = array(); |
106 | 117 | |
107 | | - wfAppendToArrayIfNotDefault('days' , $days , $defaults, $nondefaults); |
108 | | - wfAppendToArrayIfNotDefault('hideOwn' , (int)$hideOwn , $defaults, $nondefaults); |
109 | | - wfAppendToArrayIfNotDefault('hideBots' , (int)$hideBots, $defaults, $nondefaults); |
| 118 | + wfAppendToArrayIfNotDefault( 'days' , $days , $defaults, $nondefaults); |
110 | 119 | wfAppendToArrayIfNotDefault( 'hideMinor', (int)$hideMinor, $defaults, $nondefaults ); |
111 | | - wfAppendToArrayIfNotDefault('namespace', $nameSpace , $defaults, $nondefaults); |
| 120 | + wfAppendToArrayIfNotDefault( 'hideBots' , (int)$hideBots , $defaults, $nondefaults); |
| 121 | + wfAppendToArrayIfNotDefault( 'hideAnons', (int)$hideAnons, $defaults, $nondefaults ); |
| 122 | + wfAppendToArrayIfNotDefault( 'hideLiu' , (int)$hideLiu , $defaults, $nondefaults ); |
| 123 | + wfAppendToArrayIfNotDefault( 'hideOwn' , (int)$hideOwn , $defaults, $nondefaults); |
| 124 | + wfAppendToArrayIfNotDefault( 'namespace', $nameSpace , $defaults, $nondefaults); |
112 | 125 | |
113 | 126 | $hookSql = ""; |
114 | 127 | if( ! wfRunHooks('BeforeWatchlist', array($nondefaults, $wgUser, &$hookSql)) ) { |
— | — | @@ -140,9 +153,11 @@ |
141 | 154 | # Up estimate of watched items by 15% to compensate for talk pages... |
142 | 155 | |
143 | 156 | # Toggles |
144 | | - $andHideOwn = $hideOwn ? "AND (rc_user <> $uid)" : ''; |
145 | | - $andHideBots = $hideBots ? "AND (rc_bot = 0)" : ''; |
146 | | - $andHideMinor = $hideMinor ? 'AND rc_minor = 0' : ''; |
| 157 | + $andHideOwn = $hideOwn ? "AND (rc_user <> $uid)" : ''; |
| 158 | + $andHideBots = $hideBots ? "AND (rc_bot = 0)" : ''; |
| 159 | + $andHideMinor = $hideMinor ? "AND (rc_minor = 0)" : ''; |
| 160 | + $andHideLiu = $hideLiu ? "AND (rc_user = 0)" : ''; |
| 161 | + $andHideAnons = $hideAnons ? "AND (rc_user != 0)" : ''; |
147 | 162 | |
148 | 163 | # Show watchlist header |
149 | 164 | $header = ''; |
— | — | @@ -194,6 +209,8 @@ |
195 | 210 | $andHideOwn |
196 | 211 | $andHideBots |
197 | 212 | $andHideMinor |
| 213 | + $andHideLiu |
| 214 | + $andHideAnons |
198 | 215 | $nameSpaceClause |
199 | 216 | $hookSql |
200 | 217 | ORDER BY rc_timestamp DESC |
— | — | @@ -230,21 +247,31 @@ |
231 | 248 | $thisTitle = SpecialPage::getTitleFor( 'Watchlist' ); |
232 | 249 | $skin = $wgUser->getSkin(); |
233 | 250 | |
| 251 | + # Hide/show minor edits |
| 252 | + $label = $hideMinor ? wfMsgHtml( 'watchlist-show-minor' ) : wfMsgHtml( 'watchlist-hide-minor' ); |
| 253 | + $linkBits = wfArrayToCGI( array( 'hideMinor' => 1 - (int)$hideMinor ), $nondefaults ); |
| 254 | + $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); |
| 255 | + |
234 | 256 | # Hide/show bot edits |
235 | 257 | $label = $hideBots ? wfMsgHtml( 'watchlist-show-bots' ) : wfMsgHtml( 'watchlist-hide-bots' ); |
236 | 258 | $linkBits = wfArrayToCGI( array( 'hideBots' => 1 - (int)$hideBots ), $nondefaults ); |
237 | 259 | $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); |
238 | 260 | |
| 261 | + # Hide/show anonymous edits |
| 262 | + $label = $hideAnons ? wfMsgHtml( 'watchlist-show-anons' ) : wfMsgHtml( 'watchlist-hide-anons' ); |
| 263 | + $linkBits = wfArrayToCGI( array( 'hideAnons' => 1 - (int)$hideAnons ), $nondefaults ); |
| 264 | + $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); |
| 265 | + |
| 266 | + # Hide/show logged in edits |
| 267 | + $label = $hideLiu ? wfMsgHtml( 'watchlist-show-liu' ) : wfMsgHtml( 'watchlist-hide-liu' ); |
| 268 | + $linkBits = wfArrayToCGI( array( 'hideLiu' => 1 - (int)$hideLiu ), $nondefaults ); |
| 269 | + $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); |
| 270 | + |
239 | 271 | # Hide/show own edits |
240 | 272 | $label = $hideOwn ? wfMsgHtml( 'watchlist-show-own' ) : wfMsgHtml( 'watchlist-hide-own' ); |
241 | 273 | $linkBits = wfArrayToCGI( array( 'hideOwn' => 1 - (int)$hideOwn ), $nondefaults ); |
242 | 274 | $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); |
243 | 275 | |
244 | | - # Hide/show minor edits |
245 | | - $label = $hideMinor ? wfMsgHtml( 'watchlist-show-minor' ) : wfMsgHtml( 'watchlist-hide-minor' ); |
246 | | - $linkBits = wfArrayToCGI( array( 'hideMinor' => 1 - (int)$hideMinor ), $nondefaults ); |
247 | | - $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); |
248 | | - |
249 | 276 | $wgOut->addHTML( implode( ' | ', $links ) ); |
250 | 277 | |
251 | 278 | # Form for namespace filtering |
— | — | @@ -252,14 +279,19 @@ |
253 | 280 | $form .= '<p>'; |
254 | 281 | $form .= Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' '; |
255 | 282 | $form .= Xml::namespaceSelector( $nameSpace, '' ) . ' '; |
| 283 | + $form .= Xml::checkLabel( wfMsg('invert'), 'invert', 'nsinvert', $invert ) . "<br />"; |
256 | 284 | $form .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . '</p>'; |
257 | 285 | $form .= Xml::hidden( 'days', $days ); |
| 286 | + if( $hideMinor ) |
| 287 | + $form .= Xml::hidden( 'hideMinor', 1 ); |
| 288 | + if( $hideBots ) |
| 289 | + $form .= Xml::hidden( 'hideBots', 1 ); |
| 290 | + if( $hideAnons ) |
| 291 | + $form .= Xml::hidden( 'hideAnons', 1 ); |
| 292 | + if( $hideLiu ) |
| 293 | + $form .= Xml::hidden( 'hideLiu', 1 ); |
258 | 294 | if( $hideOwn ) |
259 | 295 | $form .= Xml::hidden( 'hideOwn', 1 ); |
260 | | - if( $hideBots ) |
261 | | - $form .= Xml::hidden( 'hideBots', 1 ); |
262 | | - if( $hideMinor ) |
263 | | - $form .= Xml::hidden( 'hideMinor', 1 ); |
264 | 296 | $form .= Xml::closeElement( 'form' ); |
265 | 297 | $wgOut->addHtml( $form ); |
266 | 298 | |
— | — | @@ -316,7 +348,6 @@ |
317 | 349 | |
318 | 350 | $dbr->freeResult( $res ); |
319 | 351 | $wgOut->addHTML( $s ); |
320 | | - |
321 | 352 | } |
322 | 353 | |
323 | 354 | function wlHoursLink( $h, $page, $options = array() ) { |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -528,6 +528,8 @@ |
529 | 529 | 'tog-watchlisthideown' => 'Hide my edits from the watchlist', |
530 | 530 | 'tog-watchlisthidebots' => 'Hide bot edits from the watchlist', |
531 | 531 | 'tog-watchlisthideminor' => 'Hide minor edits from the watchlist', |
| 532 | +'tog-watchlisthideliu' => 'Hide edits by logged in users from the watchlist', |
| 533 | +'tog-watchlisthideanons' => 'Hide edits by anonymous users from the watchlist', |
532 | 534 | 'tog-nolangconversion' => 'Disable variants conversion', # only translate this message to other languages if you have to change it |
533 | 535 | 'tog-ccmeonemails' => 'Send me copies of e-mails I send to other users', |
534 | 536 | 'tog-diffonly' => 'Do not show page content below diffs', |
— | — | @@ -2097,6 +2099,10 @@ |
2098 | 2100 | 'watchlist-hide-own' => 'Hide my edits', |
2099 | 2101 | 'watchlist-show-minor' => 'Show minor edits', |
2100 | 2102 | 'watchlist-hide-minor' => 'Hide minor edits', |
| 2103 | +'watchlist-show-anons' => 'Show anonymous edits', |
| 2104 | +'watchlist-hide-anons' => 'Hide anonymous edits', |
| 2105 | +'watchlist-show-liu' => 'Show logged-in user edits', |
| 2106 | +'watchlist-hide-liu' => 'Hide logged-in user edits', |
2101 | 2107 | |
2102 | 2108 | # Displayed when you click the "watch" button and it is in the process of watching |
2103 | 2109 | 'watching' => 'Watching...', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -78,6 +78,8 @@ |
79 | 79 | so-called GIFAR vulnerability. |
80 | 80 | * (bug 15141) Give ability to only list protected pages with the cascading |
81 | 81 | option enabled on Special:ProtectedPages |
| 82 | +* (bug 15157) Special:Watchlist has the same options as Special:Watchlist: |
| 83 | + Show/Hide logged in users, Show/Hide anonymous, Invert namespace selection |
82 | 84 | |
83 | 85 | === Bug fixes in 1.14 === |
84 | 86 | |