Index: trunk/phase3/includes/specials/SpecialDeletedContributions.php |
— | — | @@ -31,11 +31,11 @@ |
32 | 32 | var $messages, $target; |
33 | 33 | var $namespace = '', $mDb; |
34 | 34 | |
35 | | - function __construct( $target, $namespace = false ) { |
36 | | - parent::__construct(); |
| 35 | + function __construct( IContextSource $context, $target, $namespace = false ) { |
| 36 | + parent::__construct( $context ); |
37 | 37 | $msgs = array( 'deletionlog', 'undeleteviewlink', 'diff' ); |
38 | 38 | foreach( $msgs as $msg ) { |
39 | | - $this->messages[$msg] = wfMsgExt( $msg, array( 'escapenoentities') ); |
| 39 | + $this->messages[$msg] = $this->msg( $msg )->escaped(); |
40 | 40 | } |
41 | 41 | $this->target = $target; |
42 | 42 | $this->namespace = $namespace; |
— | — | @@ -98,10 +98,10 @@ |
99 | 99 | $lang = $this->getLanguage(); |
100 | 100 | $fmtLimit = $lang->formatNum( $this->mLimit ); |
101 | 101 | $linkTexts = array( |
102 | | - 'prev' => wfMsgExt( 'pager-newer-n', array( 'escape', 'parsemag' ), $fmtLimit ), |
103 | | - 'next' => wfMsgExt( 'pager-older-n', array( 'escape', 'parsemag' ), $fmtLimit ), |
104 | | - 'first' => wfMsgHtml( 'histlast' ), |
105 | | - 'last' => wfMsgHtml( 'histfirst' ) |
| 102 | + 'prev' => $this->msg( 'pager-newer-n', $fmtLimit )->escaped(), |
| 103 | + 'next' => $this->msg( 'pager-older-n', $fmtLimit )->escaped(), |
| 104 | + 'first' => $this->msg( 'histlast' )->escaped(), |
| 105 | + 'last' => $this->msg( 'histfirst' )->escaped() |
106 | 106 | ); |
107 | 107 | |
108 | 108 | $pagingLinks = $this->getPagingLinks( $linkTexts ); |
— | — | @@ -109,7 +109,7 @@ |
110 | 110 | $limits = $lang->pipeList( $limitLinks ); |
111 | 111 | |
112 | 112 | $this->mNavigationBar = "(" . $lang->pipeList( array( $pagingLinks['first'], $pagingLinks['last'] ) ) . ") " . |
113 | | - wfMsgExt( 'viewprevnext', array( 'parsemag', 'escape', 'replaceafter' ), $pagingLinks['prev'], $pagingLinks['next'], $limits ); |
| 113 | + $this->msg( 'viewprevnext' )->rawParams( $pagingLinks['prev'], $pagingLinks['next'], $limits )->escaped(); |
114 | 114 | return $this->mNavigationBar; |
115 | 115 | } |
116 | 116 | |
— | — | @@ -217,14 +217,15 @@ |
218 | 218 | $tools = Html::rawElement( |
219 | 219 | 'span', |
220 | 220 | array( 'class' => 'mw-deletedcontribs-tools' ), |
221 | | - wfMsg( 'parentheses', $this->getLanguage()->pipeList( array( $last, $dellog, $reviewlink ) ) ) |
| 221 | + $this->msg( 'parentheses' )->rawParams( $this->getLanguage()->pipeList( |
| 222 | + array( $last, $dellog, $reviewlink ) ) )->escaped() |
222 | 223 | ); |
223 | 224 | |
224 | 225 | $ret = "{$del}{$link} {$tools} . . {$mflag} {$pagelink} {$comment}"; |
225 | 226 | |
226 | 227 | # Denote if username is redacted for this edit |
227 | 228 | if( $rev->isDeleted( Revision::DELETED_USER ) ) { |
228 | | - $ret .= " <strong>" . wfMsgHtml('rev-deleted-user-contribs') . "</strong>"; |
| 229 | + $ret .= " <strong>" . $this->msg( 'rev-deleted-user-contribs' )->escaped() . "</strong>"; |
229 | 230 | } |
230 | 231 | |
231 | 232 | $ret = Html::rawElement( 'li', array(), $ret ) . "\n"; |
— | — | @@ -306,7 +307,7 @@ |
307 | 308 | |
308 | 309 | $out->addHTML( $this->getForm( $options ) ); |
309 | 310 | |
310 | | - $pager = new DeletedContribsPager( $target, $options['namespace'] ); |
| 311 | + $pager = new DeletedContribsPager( $this->getContext(), $target, $options['namespace'] ); |
311 | 312 | if ( !$pager->getNumRows() ) { |
312 | 313 | $out->addWikiMsg( 'nocontribs' ); |
313 | 314 | return; |
— | — | @@ -329,7 +330,7 @@ |
330 | 331 | ? 'sp-contributions-footer-anon' |
331 | 332 | : 'sp-contributions-footer'; |
332 | 333 | |
333 | | - if( !wfMessage( $message )->isDisabled() ) { |
| 334 | + if( !$this->msg( $message )->isDisabled() ) { |
334 | 335 | $out->wrapWikiMsg( "<div class='mw-contributions-footer'>\n$1\n</div>", array( $message, $target ) ); |
335 | 336 | } |
336 | 337 | } |
— | — | @@ -352,17 +353,17 @@ |
353 | 354 | $talk = $nt->getTalkPage(); |
354 | 355 | if( $talk ) { |
355 | 356 | # Talk page link |
356 | | - $tools[] = Linker::link( $talk, wfMsgHtml( 'sp-contributions-talk' ) ); |
| 357 | + $tools[] = Linker::link( $talk, $this->msg( 'sp-contributions-talk' )->escaped() ); |
357 | 358 | if( ( $id !== null ) || ( $id === null && IP::isIPAddress( $nt->getText() ) ) ) { |
358 | 359 | if( $this->getUser()->isAllowed( 'block' ) ) { # Block / Change block / Unblock links |
359 | 360 | if ( $userObj->isBlocked() ) { |
360 | 361 | $tools[] = Linker::linkKnown( # Change block link |
361 | 362 | SpecialPage::getTitleFor( 'Block', $nt->getDBkey() ), |
362 | | - wfMsgHtml( 'change-blocklink' ) |
| 363 | + $this->msg( 'change-blocklink' )->escaped() |
363 | 364 | ); |
364 | 365 | $tools[] = Linker::linkKnown( # Unblock link |
365 | 366 | SpecialPage::getTitleFor( 'BlockList' ), |
366 | | - wfMsgHtml( 'unblocklink' ), |
| 367 | + $this->msg( 'unblocklink' )->escaped(), |
367 | 368 | array(), |
368 | 369 | array( |
369 | 370 | 'action' => 'unblock', |
— | — | @@ -373,14 +374,14 @@ |
374 | 375 | else { # User is not blocked |
375 | 376 | $tools[] = Linker::linkKnown( # Block link |
376 | 377 | SpecialPage::getTitleFor( 'Block', $nt->getDBkey() ), |
377 | | - wfMsgHtml( 'blocklink' ) |
| 378 | + $this->msg( 'blocklink' )->escaped() |
378 | 379 | ); |
379 | 380 | } |
380 | 381 | } |
381 | 382 | # Block log link |
382 | 383 | $tools[] = Linker::linkKnown( |
383 | 384 | SpecialPage::getTitleFor( 'Log' ), |
384 | | - wfMsgHtml( 'sp-contributions-blocklog' ), |
| 385 | + $this->msg( 'sp-contributions-blocklog' )->escaped(), |
385 | 386 | array(), |
386 | 387 | array( |
387 | 388 | 'type' => 'block', |
— | — | @@ -391,22 +392,23 @@ |
392 | 393 | # Other logs link |
393 | 394 | $tools[] = Linker::linkKnown( |
394 | 395 | SpecialPage::getTitleFor( 'Log' ), |
395 | | - wfMsgHtml( 'sp-contributions-logs' ), |
| 396 | + $this->msg( 'sp-contributions-logs' )->escaped(), |
396 | 397 | array(), |
397 | 398 | array( 'user' => $nt->getText() ) |
398 | 399 | ); |
399 | 400 | # Link to contributions |
400 | 401 | $tools[] = Linker::linkKnown( |
401 | 402 | SpecialPage::getTitleFor( 'Contributions', $nt->getDBkey() ), |
402 | | - wfMsgHtml( 'sp-deletedcontributions-contribs' ) |
| 403 | + $this->msg( 'sp-deletedcontributions-contribs' )->escaped() |
403 | 404 | ); |
404 | 405 | |
405 | 406 | # Add a link to change user rights for privileged users |
406 | 407 | $userrightsPage = new UserrightsPage(); |
| 408 | + $userrightsPage->setContext( $this->getContext() ); |
407 | 409 | if( $id !== null && $userrightsPage->userCanChangeRights( User::newFromId( $id ) ) ) { |
408 | 410 | $tools[] = Linker::linkKnown( |
409 | 411 | SpecialPage::getTitleFor( 'Userrights', $nt->getDBkey() ), |
410 | | - wfMsgHtml( 'sp-contributions-userrights' ) |
| 412 | + $this->msg( 'sp-contributions-userrights' )->escaped() |
411 | 413 | ); |
412 | 414 | } |
413 | 415 | |
— | — | @@ -483,15 +485,15 @@ |
484 | 486 | } |
485 | 487 | |
486 | 488 | $f .= Xml::openElement( 'fieldset' ) . |
487 | | - Xml::element( 'legend', array(), wfMsg( 'sp-contributions-search' ) ) . |
488 | | - Xml::tags( 'label', array( 'for' => 'target' ), wfMsgExt( 'sp-contributions-username', 'parseinline' ) ) . ' ' . |
| 489 | + Xml::element( 'legend', array(), $this->msg( 'sp-contributions-search' )->text() ) . |
| 490 | + Xml::tags( 'label', array( 'for' => 'target' ), $this->msg( 'sp-contributions-username' )->parse() ) . ' ' . |
489 | 491 | Html::input( 'target', $options['target'], 'text', array( |
490 | 492 | 'size' => '20', |
491 | 493 | 'required' => '' |
492 | 494 | ) + ( $options['target'] ? array() : array( 'autofocus' ) ) ) . ' '. |
493 | | - Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' . |
| 495 | + Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) . ' ' . |
494 | 496 | Xml::namespaceSelector( $options['namespace'], '' ) . ' ' . |
495 | | - Xml::submitButton( wfMsg( 'sp-contributions-submit' ) ) . |
| 497 | + Xml::submitButton( $this->msg( 'sp-contributions-submit' )->text() ) . |
496 | 498 | Xml::closeElement( 'fieldset' ) . |
497 | 499 | Xml::closeElement( 'form' ); |
498 | 500 | return $f; |