Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2918,6 +2918,7 @@ |
2919 | 2919 | The latest block log entry is provided below for reference:', |
2920 | 2920 | 'sp-contributions-search' => 'Search for contributions', |
2921 | 2921 | 'sp-contributions-username' => 'IP address or username:', |
| 2922 | +'sp-contributions-toponly' => 'Show only top revisions', |
2922 | 2923 | 'sp-contributions-submit' => 'Search', |
2923 | 2924 | 'sp-contributions-explain' => '', # only translate this message to other languages if you have to change it |
2924 | 2925 | 'sp-contributions-footer' => '-', # do not translate or duplicate this message to other languages |
Index: trunk/phase3/languages/messages/MessagesCs.php |
— | — | @@ -2392,6 +2392,7 @@ |
2393 | 2393 | Zde je pro přehled zobrazen nejnovější záznam z knihy zablokování:', |
2394 | 2394 | 'sp-contributions-search' => 'Zobrazení příspěvků', |
2395 | 2395 | 'sp-contributions-username' => 'IP adresa nebo uživatelské jméno:', |
| 2396 | +'sp-contributions-toponly' => 'Zobrazit pouze aktuální revize', |
2396 | 2397 | 'sp-contributions-submit' => 'Zobrazit', |
2397 | 2398 | |
2398 | 2399 | # What links here |
Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | * @file |
6 | 6 | * @ingroup SpecialPage |
7 | 7 | */ |
8 | | - |
| 8 | + |
9 | 9 | class SpecialContributions extends SpecialPage { |
10 | 10 | |
11 | 11 | public function __construct() { |
— | — | @@ -43,6 +43,7 @@ |
44 | 44 | |
45 | 45 | $this->opts['limit'] = $wgRequest->getInt( 'limit', $wgUser->getOption('rclimit') ); |
46 | 46 | $this->opts['target'] = $target; |
| 47 | + $this->opts['topOnly'] = $wgRequest->getCheck( 'topOnly' ); |
47 | 48 | |
48 | 49 | $nt = Title::makeTitleSafe( NS_USER, $target ); |
49 | 50 | if( !$nt ) { |
— | — | @@ -67,9 +68,9 @@ |
68 | 69 | } |
69 | 70 | |
70 | 71 | $this->opts['tagfilter'] = (string) $wgRequest->getVal( 'tagfilter' ); |
71 | | - |
| 72 | + |
72 | 73 | // Allows reverts to have the bot flag in recent changes. It is just here to |
73 | | - // be passed in the form at the top of the page |
| 74 | + // be passed in the form at the top of the page |
74 | 75 | if( $wgUser->isAllowed( 'markbotedits' ) && $wgRequest->getBool( 'bot' ) ) { |
75 | 76 | $this->opts['bot'] = '1'; |
76 | 77 | } |
— | — | @@ -83,7 +84,7 @@ |
84 | 85 | $this->opts['year'] = $wgRequest->getIntOrNull( 'year' ); |
85 | 86 | $this->opts['month'] = $wgRequest->getIntOrNull( 'month' ); |
86 | 87 | } |
87 | | - |
| 88 | + |
88 | 89 | // Add RSS/atom links |
89 | 90 | $this->setSyndicated(); |
90 | 91 | $feedType = $wgRequest->getVal( 'feed' ); |
— | — | @@ -95,8 +96,8 @@ |
96 | 97 | |
97 | 98 | $wgOut->addHTML( $this->getForm() ); |
98 | 99 | |
99 | | - $pager = new ContribsPager( $target, $this->opts['namespace'], $this->opts['year'], |
100 | | - $this->opts['month'], false, $this->opts['deletedOnly'] ); |
| 100 | + $pager = new ContribsPager( $target, $this->opts['namespace'], $this->opts['year'], |
| 101 | + $this->opts['month'], false, $this->opts['deletedOnly'], $this->opts['topOnly'] ); |
101 | 102 | if( !$pager->getNumRows() ) { |
102 | 103 | $wgOut->addWikiMsg( 'nocontribs', $target ); |
103 | 104 | } else { |
— | — | @@ -134,7 +135,7 @@ |
135 | 136 | } |
136 | 137 | } |
137 | 138 | } |
138 | | - |
| 139 | + |
139 | 140 | protected function setSyndicated() { |
140 | 141 | global $wgOut; |
141 | 142 | $wgOut->setSyndicated( true ); |
— | — | @@ -176,7 +177,7 @@ |
177 | 178 | array(), |
178 | 179 | array( |
179 | 180 | 'action' => 'unblock', |
180 | | - 'ip' => $nt->getDBkey() |
| 181 | + 'ip' => $nt->getDBkey() |
181 | 182 | ) |
182 | 183 | ); |
183 | 184 | } |
— | — | @@ -266,30 +267,30 @@ |
267 | 268 | */ |
268 | 269 | protected function getForm() { |
269 | 270 | global $wgScript; |
270 | | - |
| 271 | + |
271 | 272 | $this->opts['title'] = $this->getTitle()->getPrefixedText(); |
272 | 273 | if( !isset( $this->opts['target'] ) ) { |
273 | 274 | $this->opts['target'] = ''; |
274 | 275 | } else { |
275 | 276 | $this->opts['target'] = str_replace( '_' , ' ' , $this->opts['target'] ); |
276 | 277 | } |
277 | | - |
| 278 | + |
278 | 279 | if( !isset( $this->opts['namespace'] ) ) { |
279 | 280 | $this->opts['namespace'] = ''; |
280 | 281 | } |
281 | | - |
| 282 | + |
282 | 283 | if( !isset( $this->opts['contribs'] ) ) { |
283 | 284 | $this->opts['contribs'] = 'user'; |
284 | 285 | } |
285 | | - |
| 286 | + |
286 | 287 | if( !isset( $this->opts['year'] ) ) { |
287 | 288 | $this->opts['year'] = ''; |
288 | 289 | } |
289 | | - |
| 290 | + |
290 | 291 | if( !isset( $this->opts['month'] ) ) { |
291 | 292 | $this->opts['month'] = ''; |
292 | 293 | } |
293 | | - |
| 294 | + |
294 | 295 | if( $this->opts['contribs'] == 'newbie' ) { |
295 | 296 | $this->opts['target'] = ''; |
296 | 297 | } |
— | — | @@ -297,11 +298,15 @@ |
298 | 299 | if( !isset( $this->opts['tagfilter'] ) ) { |
299 | 300 | $this->opts['tagfilter'] = ''; |
300 | 301 | } |
301 | | - |
| 302 | + |
| 303 | + if( !isset( $this->opts['topOnly'] ) ) { |
| 304 | + $this->opts['topOnly'] = false; |
| 305 | + } |
| 306 | + |
302 | 307 | $f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
303 | 308 | |
304 | 309 | # Add hidden params for tracking except for parameters in $skipParameters |
305 | | - $skipParameters = array( 'namespace', 'deletedOnly', 'target', 'contribs', 'year', 'month' ); |
| 310 | + $skipParameters = array( 'namespace', 'deletedOnly', 'target', 'contribs', 'year', 'month', 'topOnly' ); |
306 | 311 | foreach ( $this->opts as $name => $value ) { |
307 | 312 | if( in_array( $name, $skipParameters ) ) { |
308 | 313 | continue; |
— | — | @@ -310,12 +315,12 @@ |
311 | 316 | } |
312 | 317 | |
313 | 318 | $tagFilter = ChangeTags::buildTagFilterSelector( $this->opts['tagfilter'] ); |
314 | | - |
| 319 | + |
315 | 320 | $f .= '<fieldset>' . |
316 | 321 | Xml::element( 'legend', array(), wfMsg( 'sp-contributions-search' ) ) . |
317 | | - Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parsemag' ) ), |
| 322 | + Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parsemag' ) ), |
318 | 323 | 'contribs', 'newbie' , 'newbie', $this->opts['contribs'] == 'newbie' ? true : false ) . '<br />' . |
319 | | - Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parsemag' ) ), |
| 324 | + Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parsemag' ) ), |
320 | 325 | 'contribs' , 'user', 'user', $this->opts['contribs'] == 'user' ? true : false ) . ' ' . |
321 | 326 | Html::input( 'target', $this->opts['target'], 'text', array( |
322 | 327 | 'size' => '20', |
— | — | @@ -326,7 +331,9 @@ |
327 | 332 | Xml::namespaceSelector( $this->opts['namespace'], '' ) . |
328 | 333 | '</span>' . |
329 | 334 | Xml::checkLabel( wfMsg( 'history-show-deleted' ), |
330 | | - 'deletedOnly', 'mw-show-deleted-only', $this->opts['deletedOnly'] ) . |
| 335 | + 'deletedOnly', 'mw-show-deleted-only', $this->opts['deletedOnly'] ) . '<br />' . |
| 336 | + Xml::tags( 'p', null, Xml::checkLabel( wfMsg( 'sp-contributions-toponly' ), |
| 337 | + 'topOnly', 'mw-show-top-only', $this->opts['topOnly'] ) ) . |
331 | 338 | ( $tagFilter ? Xml::tags( 'p', null, implode( ' ', $tagFilter ) ) : '' ) . |
332 | 339 | Xml::openElement( 'p' ) . |
333 | 340 | '<span style="white-space: nowrap">' . |
— | — | @@ -334,16 +341,16 @@ |
335 | 342 | '</span>' . ' ' . |
336 | 343 | Xml::submitButton( wfMsg( 'sp-contributions-submit' ) ) . |
337 | 344 | Xml::closeElement( 'p' ); |
338 | | - |
| 345 | + |
339 | 346 | $explain = wfMsgExt( 'sp-contributions-explain', 'parseinline' ); |
340 | 347 | if( !wfEmptyMsg( 'sp-contributions-explain', $explain ) ) |
341 | 348 | $f .= "<p id='mw-sp-contributions-explain'>{$explain}</p>"; |
342 | | - |
| 349 | + |
343 | 350 | $f .= '</fieldset>' . |
344 | 351 | Xml::closeElement( 'form' ); |
345 | 352 | return $f; |
346 | 353 | } |
347 | | - |
| 354 | + |
348 | 355 | /** |
349 | 356 | * Output a subscription feed listing recent edits to this page. |
350 | 357 | * @param $type String |
— | — | @@ -368,14 +375,14 @@ |
369 | 376 | wfMsgExt( 'tagline', 'parsemag' ), |
370 | 377 | $this->getTitle()->getFullUrl() . "/" . urlencode($this->opts['target']) |
371 | 378 | ); |
372 | | - |
| 379 | + |
373 | 380 | // Already valid title |
374 | 381 | $nt = Title::makeTitleSafe( NS_USER, $this->opts['target'] ); |
375 | 382 | $target = $this->opts['target'] == 'newbies' ? 'newbies' : $nt->getText(); |
376 | | - |
377 | | - $pager = new ContribsPager( $target, $this->opts['namespace'], |
378 | | - $this->opts['year'], $this->opts['month'], $this->opts['tagfilter'], $this->opts['deletedOnly'] ); |
379 | 383 | |
| 384 | + $pager = new ContribsPager( $target, $this->opts['namespace'], $this->opts['year'], |
| 385 | + $this->opts['month'], $this->opts['tagfilter'], $this->opts['deletedOnly'], $this->opts['topOnly'] ); |
| 386 | + |
380 | 387 | $pager->mLimit = min( $this->opts['limit'], $wgFeedLimit ); |
381 | 388 | |
382 | 389 | $feed->outHeader(); |
— | — | @@ -421,7 +428,7 @@ |
422 | 429 | protected function feedItemDesc( $revision ) { |
423 | 430 | if( $revision ) { |
424 | 431 | return '<p>' . htmlspecialchars( $revision->getUserText() ) . wfMsgForContent( 'colon-separator' ) . |
425 | | - htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) . |
| 432 | + htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) . |
426 | 433 | "</p>\n<hr />\n<div>" . |
427 | 434 | nl2br( htmlspecialchars( $revision->getText() ) ) . "</div>"; |
428 | 435 | } |
— | — | @@ -438,7 +445,7 @@ |
439 | 446 | var $messages, $target; |
440 | 447 | var $namespace = '', $mDb; |
441 | 448 | |
442 | | - function __construct( $target, $namespace = false, $year = false, $month = false, $tagFilter = false, $deletedOnly = false ) { |
| 449 | + function __construct( $target, $namespace = false, $year = false, $month = false, $tagFilter = false, $deletedOnly = false, $topOnly = false ) { |
443 | 450 | parent::__construct(); |
444 | 451 | |
445 | 452 | $msgs = array( 'uctop', 'diff', 'newarticle', 'rollbacklink', 'diff', 'hist', 'rev-delundel', 'pipe-separator' ); |
— | — | @@ -451,6 +458,7 @@ |
452 | 459 | $this->namespace = $namespace; |
453 | 460 | $this->tagFilter = $tagFilter; |
454 | 461 | $this->deletedOnly = $deletedOnly; |
| 462 | + $this->topOnly = $topOnly; |
455 | 463 | |
456 | 464 | $this->getDateCond( $year, $month ); |
457 | 465 | |
— | — | @@ -466,7 +474,7 @@ |
467 | 475 | function getQueryInfo() { |
468 | 476 | global $wgUser; |
469 | 477 | list( $tables, $index, $userCond, $join_cond ) = $this->getUserCond(); |
470 | | - |
| 478 | + |
471 | 479 | $conds = array_merge( $userCond, $this->getNamespaceCond() ); |
472 | 480 | // Paranoia: avoid brute force searches (bug 17342) |
473 | 481 | if( !$wgUser->isAllowed( 'deletedhistory' ) ) { |
— | — | @@ -476,12 +484,12 @@ |
477 | 485 | ' != ' . Revision::SUPPRESSED_USER; |
478 | 486 | } |
479 | 487 | $join_cond['page'] = array( 'INNER JOIN', 'page_id=rev_page' ); |
480 | | - |
| 488 | + |
481 | 489 | $queryInfo = array( |
482 | 490 | 'tables' => $tables, |
483 | 491 | 'fields' => array( |
484 | 492 | 'page_namespace', 'page_title', 'page_is_new', 'page_latest', 'page_is_redirect', |
485 | | - 'page_len','rev_id', 'rev_page', 'rev_text_id', 'rev_timestamp', 'rev_comment', |
| 493 | + 'page_len','rev_id', 'rev_page', 'rev_text_id', 'rev_timestamp', 'rev_comment', |
486 | 494 | 'rev_minor_edit', 'rev_user', 'rev_user_text', 'rev_parent_id', 'rev_deleted' |
487 | 495 | ), |
488 | 496 | 'conds' => $conds, |
— | — | @@ -518,9 +526,12 @@ |
519 | 527 | $condition['rev_user_text'] = $this->target; |
520 | 528 | $index = 'usertext_timestamp'; |
521 | 529 | } |
522 | | - if ( $this->deletedOnly ) { |
| 530 | + if( $this->deletedOnly ) { |
523 | 531 | $condition[] = "rev_deleted != '0'"; |
524 | 532 | } |
| 533 | + if( $this->topOnly ) { |
| 534 | + $condition[] = "rev_id = page_latest"; |
| 535 | + } |
525 | 536 | return array( $tables, $index, $condition, $join_conds ); |
526 | 537 | } |
527 | 538 | |
— | — | @@ -658,7 +669,7 @@ |
659 | 670 | |
660 | 671 | $diffHistLinks = '(' . $difftext . $this->messages['pipe-separator'] . $histlink . ')'; |
661 | 672 | $ret = "{$del}{$d} {$diffHistLinks} {$nflag}{$mflag} {$link}{$userlink} {$comment} {$topmarktext}"; |
662 | | - |
| 673 | + |
663 | 674 | # Denote if username is redacted for this edit |
664 | 675 | if( $rev->isDeleted( Revision::DELETED_USER ) ) { |
665 | 676 | $ret .= " <strong>" . wfMsgHtml('rev-deleted-user-contribs') . "</strong>"; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -84,6 +84,8 @@ |
85 | 85 | Special:Preferences |
86 | 86 | * Interlanguage links display the page title in their tooltip. |
87 | 87 | * (bug 23621) New Special:ComparePages to compare (diff) two articles. |
| 88 | +* (bug 4597) Provide support in Special:Contributions to show only "current" |
| 89 | + contributions |
88 | 90 | |
89 | 91 | === Bug fixes in 1.17 === |
90 | 92 | * (bug 17560) Half-broken deletion moved image files to deletion archive |
Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1943,6 +1943,7 @@ |
1944 | 1944 | 'sp-contributions-blocked-notice-anon', |
1945 | 1945 | 'sp-contributions-search', |
1946 | 1946 | 'sp-contributions-username', |
| 1947 | + 'sp-contributions-toponly', |
1947 | 1948 | 'sp-contributions-submit', |
1948 | 1949 | 'sp-contributions-explain', |
1949 | 1950 | 'sp-contributions-footer', |