Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -67,7 +67,7 @@ |
68 | 68 | $this->opts['namespace'] = ''; |
69 | 69 | } |
70 | 70 | |
71 | | - $this->opts['tagfilter'] = (string) $wgRequest->getVal( 'tagfilter' ); |
| 71 | + $this->opts['tagFilter'] = (string) $wgRequest->getVal( 'tagFilter' ); |
72 | 72 | |
73 | 73 | // Allows reverts to have the bot flag in recent changes. It is just here to |
74 | 74 | // be passed in the form at the top of the page |
— | — | @@ -96,8 +96,14 @@ |
97 | 97 | |
98 | 98 | $wgOut->addHTML( $this->getForm() ); |
99 | 99 | |
100 | | - $pager = new ContribsPager( $target, $this->opts['namespace'], $this->opts['year'], |
101 | | - $this->opts['month'], false, $this->opts['deletedOnly'], $this->opts['topOnly'] ); |
| 100 | + $pager = new ContribsPager( array( |
| 101 | + 'target' => $target, |
| 102 | + 'namespace' => $this->opts['namespace'], |
| 103 | + 'year' => $this->opts['year'], |
| 104 | + 'month' => $this->opts['month'], |
| 105 | + 'deletedOnly' => $this->opts['deletedOnly'], |
| 106 | + 'topOnly' => $this->opts['topOnly'], |
| 107 | + ) ); |
102 | 108 | if( !$pager->getNumRows() ) { |
103 | 109 | $wgOut->addWikiMsg( 'nocontribs', $target ); |
104 | 110 | } else { |
— | — | @@ -295,8 +301,8 @@ |
296 | 302 | $this->opts['target'] = ''; |
297 | 303 | } |
298 | 304 | |
299 | | - if( !isset( $this->opts['tagfilter'] ) ) { |
300 | | - $this->opts['tagfilter'] = ''; |
| 305 | + if( !isset( $this->opts['tagFilter'] ) ) { |
| 306 | + $this->opts['tagFilter'] = ''; |
301 | 307 | } |
302 | 308 | |
303 | 309 | if( !isset( $this->opts['topOnly'] ) ) { |
— | — | @@ -314,7 +320,7 @@ |
315 | 321 | $f .= "\t" . Xml::hidden( $name, $value ) . "\n"; |
316 | 322 | } |
317 | 323 | |
318 | | - $tagFilter = ChangeTags::buildTagFilterSelector( $this->opts['tagfilter'] ); |
| 324 | + $tagFilter = ChangeTags::buildTagFilterSelector( $this->opts['tagFilter'] ); |
319 | 325 | |
320 | 326 | $f .= '<fieldset>' . |
321 | 327 | Xml::element( 'legend', array(), wfMsg( 'sp-contributions-search' ) ) . |
— | — | @@ -380,8 +386,15 @@ |
381 | 387 | $nt = Title::makeTitleSafe( NS_USER, $this->opts['target'] ); |
382 | 388 | $target = $this->opts['target'] == 'newbies' ? 'newbies' : $nt->getText(); |
383 | 389 | |
384 | | - $pager = new ContribsPager( $target, $this->opts['namespace'], $this->opts['year'], |
385 | | - $this->opts['month'], $this->opts['tagfilter'], $this->opts['deletedOnly'], $this->opts['topOnly'] ); |
| 390 | + $pager = new ContribsPager( array( |
| 391 | + 'target' => $target, |
| 392 | + 'namespace' => $this->opts['namespace'], |
| 393 | + 'year' => $this->opts['year'], |
| 394 | + 'month' => $this->opts['month'], |
| 395 | + 'tagFilter' => $this->opts['tagFilter'], |
| 396 | + 'deletedOnly' => $this->opts['deletedOnly'], |
| 397 | + 'topOnly' => $this->opts['topOnly'], |
| 398 | + ) ); |
386 | 399 | |
387 | 400 | $pager->mLimit = min( $this->opts['limit'], $wgFeedLimit ); |
388 | 401 | |
— | — | @@ -445,7 +458,7 @@ |
446 | 459 | var $messages, $target; |
447 | 460 | var $namespace = '', $mDb; |
448 | 461 | |
449 | | - function __construct( $target, $namespace = false, $year = false, $month = false, $tagFilter = false, $deletedOnly = false, $topOnly = false ) { |
| 462 | + function __construct( $options ) { |
450 | 463 | parent::__construct(); |
451 | 464 | |
452 | 465 | $msgs = array( 'uctop', 'diff', 'newarticle', 'rollbacklink', 'diff', 'hist', 'rev-delundel', 'pipe-separator' ); |
— | — | @@ -454,12 +467,15 @@ |
455 | 468 | $this->messages[$msg] = wfMsgExt( $msg, array( 'escapenoentities' ) ); |
456 | 469 | } |
457 | 470 | |
458 | | - $this->target = $target; |
459 | | - $this->namespace = $namespace; |
460 | | - $this->tagFilter = $tagFilter; |
461 | | - $this->deletedOnly = $deletedOnly; |
462 | | - $this->topOnly = $topOnly; |
| 471 | + $this->target = isset( $options['target'] ) ? $options['target'] : ''; |
| 472 | + $this->namespace = isset( $options['namespace'] ) ? $options['namespace'] : ''; |
| 473 | + $this->tagFilter = isset( $options['tagFilter'] ) ? $options['tagFilter'] : false; |
463 | 474 | |
| 475 | + $this->deletedOnly = !empty( $options['deletedOnly'] ); |
| 476 | + $this->topOnly = !empty( $options['topOnly'] ); |
| 477 | + |
| 478 | + $year = isset( $options['year'] ) ? $options['year'] : false; |
| 479 | + $month = isset( $options['month'] ) ? $options['month'] : false; |
464 | 480 | $this->getDateCond( $year, $month ); |
465 | 481 | |
466 | 482 | $this->mDb = wfGetDB( DB_SLAVE, 'contributions' ); |