r110328 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110327‎ | r110328 | r110329 >
Date:21:09, 30 January 2012
Author:ialex
Status:ok
Tags:core 
Comment:
Use local context to get messages instead of relying on global variables
Modified paths:
  • /trunk/phase3/includes/actions/InfoAction.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/actions/InfoAction.php
@@ -42,7 +42,7 @@
4343 }
4444
4545 protected function getPageTitle() {
46 - return wfMsg( 'pageinfo-title', $this->getTitle()->getSubjectPage()->getPrefixedText() );
 46+ return $this->msg( 'pageinfo-title', $this->getTitle()->getSubjectPage()->getPrefixedText() )->text();
4747 }
4848
4949 public function onView() {
@@ -56,42 +56,42 @@
5757 return Html::rawElement( 'table', array( 'class' => 'wikitable mw-page-info' ),
5858 Html::rawElement( 'tr', array(),
5959 Html::element( 'th', array(), '' ) .
60 - Html::element( 'th', array(), wfMsg( 'pageinfo-subjectpage' ) ) .
61 - Html::element( 'th', array(), wfMsg( 'pageinfo-talkpage' ) )
 60+ Html::element( 'th', array(), $this->msg( 'pageinfo-subjectpage' )->text() ) .
 61+ Html::element( 'th', array(), $this->msg( 'pageinfo-talkpage' )->text() )
6262 ) .
6363 Html::rawElement( 'tr', array(),
64 - Html::element( 'th', array( 'colspan' => 3 ), wfMsg( 'pageinfo-header-edits' ) )
 64+ Html::element( 'th', array( 'colspan' => 3 ), $this->msg( 'pageinfo-header-edits' )->text() )
6565 ) .
6666 Html::rawElement( 'tr', array(),
67 - Html::element( 'td', array(), wfMsg( 'pageinfo-edits' ) ) .
 67+ Html::element( 'td', array(), $this->msg( 'pageinfo-edits' )->text() ) .
6868 Html::element( 'td', array(), $this->getLanguage()->formatNum( $pageInfo['edits'] ) ) .
6969 Html::element( 'td', array(), $this->getLanguage()->formatNum( $talkInfo['edits'] ) )
7070 ) .
7171 Html::rawElement( 'tr', array(),
72 - Html::element( 'td', array(), wfMsg( 'pageinfo-authors' ) ) .
 72+ Html::element( 'td', array(), $this->msg( 'pageinfo-authors' )->text() ) .
7373 Html::element( 'td', array(), $this->getLanguage()->formatNum( $pageInfo['authors'] ) ) .
7474 Html::element( 'td', array(), $this->getLanguage()->formatNum( $talkInfo['authors'] ) )
7575 ) .
7676 ( !$this->getUser()->isAllowed( 'unwatchedpages' ) ? '' :
7777 Html::rawElement( 'tr', array(),
78 - Html::element( 'th', array( 'colspan' => 3 ), wfMsg( 'pageinfo-header-watchlist' ) )
 78+ Html::element( 'th', array( 'colspan' => 3 ), $this->msg( 'pageinfo-header-watchlist' )->text() )
7979 ) .
8080 Html::rawElement( 'tr', array(),
81 - Html::element( 'td', array(), wfMsg( 'pageinfo-watchers' ) ) .
 81+ Html::element( 'td', array(), $this->msg( 'pageinfo-watchers' )->text() ) .
8282 Html::element( 'td', array( 'colspan' => 2 ), $this->getLanguage()->formatNum( $pageInfo['watchers'] ) )
8383 )
8484 ).
8585 ( $wgDisableCounters ? '' :
8686 Html::rawElement( 'tr', array(),
87 - Html::element( 'th', array( 'colspan' => 3 ), wfMsg( 'pageinfo-header-views' ) )
 87+ Html::element( 'th', array( 'colspan' => 3 ), $this->msg( 'pageinfo-header-views' )->text() )
8888 ) .
8989 Html::rawElement( 'tr', array(),
90 - Html::element( 'td', array(), wfMsg( 'pageinfo-views' ) ) .
 90+ Html::element( 'td', array(), $this->msg( 'pageinfo-views' )->text() ) .
9191 Html::element( 'td', array(), $this->getLanguage()->formatNum( $pageInfo['views'] ) ) .
9292 Html::element( 'td', array(), $this->getLanguage()->formatNum( $talkInfo['views'] ) )
9393 ) .
9494 Html::rawElement( 'tr', array(),
95 - Html::element( 'td', array(), wfMsg( 'pageinfo-viewsperedit' ) ) .
 95+ Html::element( 'td', array(), $this->msg( 'pageinfo-viewsperedit' )->text() ) .
9696 Html::element( 'td', array(), $this->getLanguage()->formatNum( sprintf( '%.2f', $pageInfo['edits'] ? $pageInfo['views'] / $pageInfo['edits'] : 0 ) ) ) .
9797 Html::element( 'td', array(), $this->getLanguage()->formatNum( sprintf( '%.2f', $talkInfo['edits'] ? $talkInfo['views'] / $talkInfo['edits'] : 0 ) ) )
9898 )

Status & tagging log