r111826 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111825‎ | r111826 | r111827 >
Date:14:14, 18 February 2012
Author:ialex
Status:ok
Tags:
Comment:
Use local context to get messages
Modified paths:
  • /trunk/phase3/includes/specials/SpecialWhatlinkshere.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialWhatlinkshere.php
@@ -287,7 +287,7 @@
288288 'whatlinkshere-links', 'isimage' );
289289 $msgcache = array();
290290 foreach ( $msgs as $msg ) {
291 - $msgcache[$msg] = wfMsgExt( $msg, array( 'escapenoentities' ) );
 291+ $msgcache[$msg] = $this->msg( $msg )->escaped();
292292 }
293293 }
294294
@@ -355,8 +355,8 @@
356356
357357 function getPrevNext( $prevId, $nextId ) {
358358 $currentLimit = $this->opts->getValue( 'limit' );
359 - $prev = wfMessage( 'whatlinkshere-prev' )->numParams( $currentLimit )->escaped();
360 - $next = wfMessage( 'whatlinkshere-next' )->numParams( $currentLimit )->escaped();
 359+ $prev = $this->msg( 'whatlinkshere-prev' )->numParams( $currentLimit )->escaped();
 360+ $next = $this->msg( 'whatlinkshere-next' )->numParams( $currentLimit )->escaped();
361361
362362 $changed = $this->opts->getChangedValues();
363363 unset($changed['target']); // Already in the request title
@@ -380,7 +380,7 @@
381381
382382 $nums = $lang->pipeList( $limitLinks );
383383
384 - return wfMsgHtml( 'viewprevnext', $prev, $next, $nums );
 384+ return $this->msg( 'viewprevnext' )->rawParams( $prev, $next, $nums )->escaped();
385385 }
386386
387387 function whatlinkshereForm() {
@@ -403,22 +403,22 @@
404404 $f .= Html::hidden( $name, $value );
405405 }
406406
407 - $f .= Xml::fieldset( wfMsg( 'whatlinkshere' ) );
 407+ $f .= Xml::fieldset( $this->msg( 'whatlinkshere' )->text() );
408408
409409 # Target input
410 - $f .= Xml::inputLabel( wfMsg( 'whatlinkshere-page' ), 'target',
 410+ $f .= Xml::inputLabel( $this->msg( 'whatlinkshere-page' )->text(), 'target',
411411 'mw-whatlinkshere-target', 40, $target );
412412
413413 $f .= ' ';
414414
415415 # Namespace selector
416 - $f .= Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' .
 416+ $f .= Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) . ' ' .
417417 Xml::namespaceSelector( $namespace, '' );
418418
419419 $f .= ' ';
420420
421421 # Submit
422 - $f .= Xml::submitButton( wfMsg( 'allpagessubmit' ) );
 422+ $f .= Xml::submitButton( $this->msg( 'allpagessubmit' )->text() );
423423
424424 # Close
425425 $f .= Xml::closeElement( 'fieldset' ) . Xml::closeElement( 'form' ) . "\n";
@@ -432,8 +432,8 @@
433433 * @return string HTML fieldset and filter panel with the show/hide links
434434 */
435435 function getFilterPanel() {
436 - $show = wfMsgHtml( 'show' );
437 - $hide = wfMsgHtml( 'hide' );
 436+ $show = $this->msg( 'show' )->escaped();
 437+ $hide = $this->msg( 'hide' )->escaped();
438438
439439 $changed = $this->opts->getChangedValues();
440440 unset($changed['target']); // Already in the request title
@@ -449,8 +449,9 @@
450450 $chosen = $this->opts->getValue( $type );
451451 $msg = $chosen ? $show : $hide;
452452 $overrides = array( $type => !$chosen );
453 - $links[] = wfMsgHtml( "whatlinkshere-{$type}", $this->makeSelfLink( $msg, array_merge( $changed, $overrides ) ) );
 453+ $links[] = $this->msg( "whatlinkshere-{$type}" )->rawParams(
 454+ $this->makeSelfLink( $msg, array_merge( $changed, $overrides ) ) )->escaped();
454455 }
455 - return Xml::fieldset( wfMsg( 'whatlinkshere-filters' ), $this->getLanguage()->pipeList( $links ) );
 456+ return Xml::fieldset( $this->msg( 'whatlinkshere-filters' )->text(), $this->getLanguage()->pipeList( $links ) );
456457 }
457458 }

Sign-offs

UserFlagDate
Nikerabbitinspected06:49, 20 February 2012

Status & tagging log