Index: trunk/phase3/includes/api/ApiFeedContributions.php |
— | — | @@ -74,7 +74,7 @@ |
75 | 75 | $feedUrl |
76 | 76 | ); |
77 | 77 | |
78 | | - $pager = new ContribsPager( array( |
| 78 | + $pager = new ContribsPager( $this->getContext(), array( |
79 | 79 | 'target' => $target, |
80 | 80 | 'namespace' => $params['namespace'], |
81 | 81 | 'year' => $params['year'], |
Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -85,11 +85,11 @@ |
86 | 86 | if ( $this->opts['contribs'] != 'newbie' ) { |
87 | 87 | $target = $nt->getText(); |
88 | 88 | $out->addSubtitle( $this->contributionsSub( $userObj ) ); |
89 | | - $out->setHTMLTitle( $this->msg( 'pagetitle', wfMsgExt( 'contributions-title', array( 'parsemag' ), $target ) ) ); |
| 89 | + $out->setHTMLTitle( $this->msg( 'pagetitle', $this->msg( 'contributions-title', $target )->plain() ) ); |
90 | 90 | $this->getSkin()->setRelevantUser( $userObj ); |
91 | 91 | } else { |
92 | 92 | $out->addSubtitle( $this->msg( 'sp-contributions-newbies-sub' ) ); |
93 | | - $out->setHTMLTitle( $this->msg( 'pagetitle', wfMsg( 'sp-contributions-newbies-title' ) ) ); |
| 93 | + $out->setHTMLTitle( $this->msg( 'pagetitle', $this->msg( 'sp-contributions-newbies-title' )->plain() ) ); |
94 | 94 | } |
95 | 95 | |
96 | 96 | if ( ( $ns = $request->getVal( 'namespace', null ) ) !== null && $ns !== '' ) { |
— | — | @@ -161,7 +161,7 @@ |
162 | 162 | |
163 | 163 | $out->addHTML( $this->getForm() ); |
164 | 164 | |
165 | | - $pager = new ContribsPager( array( |
| 165 | + $pager = new ContribsPager( $this->getContext(), array( |
166 | 166 | 'target' => $target, |
167 | 167 | 'contribs' => $this->opts['contribs'], |
168 | 168 | 'namespace' => $this->opts['namespace'], |
— | — | @@ -200,7 +200,7 @@ |
201 | 201 | } |
202 | 202 | } |
203 | 203 | |
204 | | - if ( !wfMessage( $message, $target )->isDisabled() ) { |
| 204 | + if ( !$this->msg( $message, $target )->isDisabled() ) { |
205 | 205 | $out->wrapWikiMsg( |
206 | 206 | "<div class='mw-contributions-footer'>\n$1\n</div>", |
207 | 207 | array( $message, $target ) ); |
— | — | @@ -275,30 +275,30 @@ |
276 | 276 | $id = $target->getId(); |
277 | 277 | $username = $target->getName(); |
278 | 278 | |
279 | | - $tools[] = Linker::link( $talkpage, wfMsgHtml( 'sp-contributions-talk' ) ); |
| 279 | + $tools[] = Linker::link( $talkpage, $this->msg( 'sp-contributions-talk' )->escaped() ); |
280 | 280 | |
281 | 281 | if ( ( $id !== null ) || ( $id === null && IP::isIPAddress( $username ) ) ) { |
282 | 282 | if ( $subject->isAllowed( 'block' ) ) { # Block / Change block / Unblock links |
283 | 283 | if ( $target->isBlocked() ) { |
284 | 284 | $tools[] = Linker::linkKnown( # Change block link |
285 | 285 | SpecialPage::getTitleFor( 'Block', $username ), |
286 | | - wfMsgHtml( 'change-blocklink' ) |
| 286 | + $this->msg( 'change-blocklink' )->escaped() |
287 | 287 | ); |
288 | 288 | $tools[] = Linker::linkKnown( # Unblock link |
289 | 289 | SpecialPage::getTitleFor( 'Unblock', $username ), |
290 | | - wfMsgHtml( 'unblocklink' ) |
| 290 | + $this->msg( 'unblocklink' )->escaped() |
291 | 291 | ); |
292 | 292 | } else { # User is not blocked |
293 | 293 | $tools[] = Linker::linkKnown( # Block link |
294 | 294 | SpecialPage::getTitleFor( 'Block', $username ), |
295 | | - wfMsgHtml( 'blocklink' ) |
| 295 | + $this->msg( 'blocklink' )->escaped() |
296 | 296 | ); |
297 | 297 | } |
298 | 298 | } |
299 | 299 | # Block log link |
300 | 300 | $tools[] = Linker::linkKnown( |
301 | 301 | SpecialPage::getTitleFor( 'Log', 'block' ), |
302 | | - wfMsgHtml( 'sp-contributions-blocklog' ), |
| 302 | + $this->msg( 'sp-contributions-blocklog' )->escaped(), |
303 | 303 | array(), |
304 | 304 | array( |
305 | 305 | 'page' => $userpage->getPrefixedText() |
— | — | @@ -308,20 +308,20 @@ |
309 | 309 | # Uploads |
310 | 310 | $tools[] = Linker::linkKnown( |
311 | 311 | SpecialPage::getTitleFor( 'Listfiles', $username ), |
312 | | - wfMsgHtml( 'sp-contributions-uploads' ) |
| 312 | + $this->msg( 'sp-contributions-uploads' )->escaped() |
313 | 313 | ); |
314 | 314 | |
315 | 315 | # Other logs link |
316 | 316 | $tools[] = Linker::linkKnown( |
317 | 317 | SpecialPage::getTitleFor( 'Log', $username ), |
318 | | - wfMsgHtml( 'sp-contributions-logs' ) |
| 318 | + $this->msg( 'sp-contributions-logs' )->escaped() |
319 | 319 | ); |
320 | 320 | |
321 | 321 | # Add link to deleted user contributions for priviledged users |
322 | 322 | if ( $subject->isAllowed( 'deletedhistory' ) ) { |
323 | 323 | $tools[] = Linker::linkKnown( |
324 | 324 | SpecialPage::getTitleFor( 'DeletedContributions', $username ), |
325 | | - wfMsgHtml( 'sp-contributions-deleted' ) |
| 325 | + $this->msg( 'sp-contributions-deleted' )->escaped() |
326 | 326 | ); |
327 | 327 | } |
328 | 328 | |
— | — | @@ -331,7 +331,7 @@ |
332 | 332 | if ( $id !== null && $userrightsPage->userCanChangeRights( $target ) ) { |
333 | 333 | $tools[] = Linker::linkKnown( |
334 | 334 | SpecialPage::getTitleFor( 'Userrights', $username ), |
335 | | - wfMsgHtml( 'sp-contributions-userrights' ) |
| 335 | + $this->msg( 'sp-contributions-userrights' )->escaped() |
336 | 336 | ); |
337 | 337 | } |
338 | 338 | |
— | — | @@ -412,7 +412,7 @@ |
413 | 413 | |
414 | 414 | $targetSelection = Xml::tags( 'td', array( 'colspan' => 2 ), |
415 | 415 | Xml::radioLabel( |
416 | | - wfMsgExt( 'sp-contributions-newbies', array( 'parsemag' ) ), |
| 416 | + $this->msg( 'sp-contributions-newbies' )->text(), |
417 | 417 | 'contribs', |
418 | 418 | 'newbie' , |
419 | 419 | 'newbie', |
— | — | @@ -420,7 +420,7 @@ |
421 | 421 | array( 'class' => 'mw-input' ) |
422 | 422 | ) . '<br />' . |
423 | 423 | Xml::radioLabel( |
424 | | - wfMsgExt( 'sp-contributions-username', array( 'parsemag' ) ), |
| 424 | + $this->msg( 'sp-contributions-username' )->text(), |
425 | 425 | 'contribs', |
426 | 426 | 'user', |
427 | 427 | 'user', |
— | — | @@ -440,7 +440,7 @@ |
441 | 441 | $namespaceSelection = |
442 | 442 | Xml::tags( 'td', array( 'class' => 'mw-label' ), |
443 | 443 | Xml::label( |
444 | | - wfMsg( 'namespace' ), |
| 444 | + $this->msg( 'namespace' )->text(), |
445 | 445 | 'namespace', |
446 | 446 | '' |
447 | 447 | ) |
— | — | @@ -449,20 +449,20 @@ |
450 | 450 | Xml::namespaceSelector( $this->opts['namespace'], '' ) . ' ' . |
451 | 451 | Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ), |
452 | 452 | Xml::checkLabel( |
453 | | - wfMsg( 'invert' ), |
| 453 | + $this->msg( 'invert' )->text(), |
454 | 454 | 'nsInvert', |
455 | 455 | 'nsInvert', |
456 | 456 | $this->opts['nsInvert'], |
457 | | - array( 'title' => wfMsg( 'tooltip-invert' ), 'class' => 'mw-input' ) |
| 457 | + array( 'title' => $this->msg( 'tooltip-invert' )->text(), 'class' => 'mw-input' ) |
458 | 458 | ) . ' ' |
459 | 459 | ) . |
460 | 460 | Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ), |
461 | 461 | Xml::checkLabel( |
462 | | - wfMsg( 'namespace_association' ), |
| 462 | + $this->msg( 'namespace_association' )->text(), |
463 | 463 | 'associated', |
464 | 464 | 'associated', |
465 | 465 | $this->opts['associated'], |
466 | | - array( 'title' => wfMsg( 'tooltip-namespace_association' ), 'class' => 'mw-input' ) |
| 466 | + array( 'title' => $this->msg( 'tooltip-namespace_association' )->text(), 'class' => 'mw-input' ) |
467 | 467 | ) . ' ' |
468 | 468 | ) |
469 | 469 | ) ; |
— | — | @@ -470,7 +470,7 @@ |
471 | 471 | $extraOptions = Xml::tags( 'td', array( 'colspan' => 2 ), |
472 | 472 | Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ), |
473 | 473 | Xml::checkLabel( |
474 | | - wfMsg( 'history-show-deleted' ), |
| 474 | + $this->msg( 'history-show-deleted' )->text(), |
475 | 475 | 'deletedOnly', |
476 | 476 | 'mw-show-deleted-only', |
477 | 477 | $this->opts['deletedOnly'], |
— | — | @@ -479,7 +479,7 @@ |
480 | 480 | ) . |
481 | 481 | Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ), |
482 | 482 | Xml::checkLabel( |
483 | | - wfMsg( 'sp-contributions-toponly' ), |
| 483 | + $this->msg( 'sp-contributions-toponly' )->text(), |
484 | 484 | 'topOnly', |
485 | 485 | 'mw-show-top-only', |
486 | 486 | $this->opts['topOnly'], |
— | — | @@ -494,13 +494,13 @@ |
495 | 495 | $this->opts['month'] |
496 | 496 | ) . ' ' . |
497 | 497 | Xml::submitButton( |
498 | | - wfMsg( 'sp-contributions-submit' ), |
| 498 | + $this->msg( 'sp-contributions-submit' )->text(), |
499 | 499 | array( 'class' => 'mw-submit' ) |
500 | 500 | ) |
501 | 501 | ) ; |
502 | 502 | |
503 | 503 | $form .= |
504 | | - Xml::fieldset( wfMsg( 'sp-contributions-search' ) ) . |
| 504 | + Xml::fieldset( $this->msg( 'sp-contributions-search' )->text() ) . |
505 | 505 | Xml::openElement( 'table', array( 'class' => 'mw-contributions-table' ) ) . |
506 | 506 | Xml::openElement( 'tr' ) . |
507 | 507 | $targetSelection . |
— | — | @@ -519,7 +519,7 @@ |
520 | 520 | Xml::closeElement( 'tr' ) . |
521 | 521 | Xml::closeElement( 'table' ); |
522 | 522 | |
523 | | - $explain = wfMessage( 'sp-contributions-explain' ); |
| 523 | + $explain = $this->msg( 'sp-contributions-explain' ); |
524 | 524 | if ( $explain->exists() ) { |
525 | 525 | $form .= "<p id='mw-sp-contributions-explain'>{$explain}</p>"; |
526 | 526 | } |
— | — | @@ -539,13 +539,13 @@ |
540 | 540 | var $namespace = '', $mDb; |
541 | 541 | var $preventClickjacking = false; |
542 | 542 | |
543 | | - function __construct( $options ) { |
544 | | - parent::__construct(); |
| 543 | + function __construct( IContextSource $context, array $options ) { |
| 544 | + parent::__construct( $context ); |
545 | 545 | |
546 | 546 | $msgs = array( 'uctop', 'diff', 'newarticle', 'rollbacklink', 'diff', 'hist', 'rev-delundel', 'pipe-separator' ); |
547 | 547 | |
548 | 548 | foreach ( $msgs as $msg ) { |
549 | | - $this->messages[$msg] = wfMsgExt( $msg, array( 'escapenoentities' ) ); |
| 549 | + $this->messages[$msg] = $this->msg( $msg )->escaped(); |
550 | 550 | } |
551 | 551 | |
552 | 552 | $this->target = isset( $options['target'] ) ? $options['target'] : ''; |
— | — | @@ -795,8 +795,9 @@ |
796 | 796 | $chardiff = ' '; |
797 | 797 | } |
798 | 798 | |
799 | | - $comment = $this->getLanguage()->getDirMark() . Linker::revComment( $rev, false, true ); |
800 | | - $date = $this->getLanguage()->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true ); |
| 799 | + $lang = $this->getLanguage(); |
| 800 | + $comment = $lang->getDirMark() . Linker::revComment( $rev, false, true ); |
| 801 | + $date = $lang->userTimeAndDate( $row->rev_timestamp, $user ); |
801 | 802 | if ( $rev->userCan( Revision::DELETED_TEXT, $user ) ) { |
802 | 803 | $d = Linker::linkKnown( |
803 | 804 | $page, |
— | — | @@ -815,8 +816,8 @@ |
816 | 817 | # Note that we already excluded rows with hidden user names. |
817 | 818 | if ( $this->contribs == 'newbie' ) { |
818 | 819 | $userlink = ' . . ' . Linker::userLink( $rev->getUser(), $rev->getUserText() ); |
819 | | - $userlink .= ' ' . wfMsg( 'parentheses', |
820 | | - Linker::userTalkLink( $rev->getUser(), $rev->getUserText() ) ) . ' '; |
| 820 | + $userlink .= ' ' . $this->msg( 'parentheses' )->rawParams( |
| 821 | + Linker::userTalkLink( $rev->getUser(), $rev->getUserText() ) )->escaped() . ' '; |
821 | 822 | } else { |
822 | 823 | $userlink = ''; |
823 | 824 | } |
— | — | @@ -857,7 +858,7 @@ |
858 | 859 | |
859 | 860 | # Denote if username is redacted for this edit |
860 | 861 | if ( $rev->isDeleted( Revision::DELETED_USER ) ) { |
861 | | - $ret .= " <strong>" . wfMsgHtml( 'rev-deleted-user-contribs' ) . "</strong>"; |
| 862 | + $ret .= " <strong>" . $this->msg( 'rev-deleted-user-contribs' )->escaped() . "</strong>"; |
862 | 863 | } |
863 | 864 | |
864 | 865 | # Tags, if any. |