From 15481366c851caaf6af0bec6dd9535c46a021edd Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 20 Feb 2012 21:14:12 +0000 Subject: [PATCH] Use local context to get messages --- includes/specials/SpecialUserrights.php | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index 5835c6ce78..f3582fff0a 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -345,7 +345,7 @@ class UserrightsPage extends SpecialPage { function makeGroupNameList( $ids ) { if( empty( $ids ) ) { - return wfMsgForContent( 'rightsnone' ); + return $this->msg( 'rightsnone' )->inContentLanguage()->text(); } else { return implode( ', ', $ids ); } @@ -367,9 +367,9 @@ class UserrightsPage extends SpecialPage { $this->getOutput()->addHTML( Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'name' => 'uluser', 'id' => 'mw-userrights-form1' ) ) . Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . - Xml::fieldset( wfMsg( 'userrights-lookup-user' ) ) . - Xml::inputLabel( wfMsg( 'userrights-user-editname' ), 'user', 'username', 30, str_replace( '_', ' ', $this->mTarget ) ) . ' ' . - Xml::submitButton( wfMsg( 'editusergroup' ) ) . + Xml::fieldset( $this->msg( 'userrights-lookup-user' )->text() ) . + Xml::inputLabel( $this->msg( 'userrights-user-editname' )->text(), 'user', 'username', 30, str_replace( '_', ' ', $this->mTarget ) ) . ' ' . + Xml::submitButton( $this->msg( 'editusergroup' )->text() ) . Html::closeElement( 'fieldset' ) . Html::closeElement( 'form' ) . "\n" ); @@ -420,12 +420,12 @@ class UserrightsPage extends SpecialPage { $grouplist = ''; $count = count( $list ); if( $count > 0 ) { - $grouplist = wfMessage( 'userrights-groupsmember', $count)->parse(); + $grouplist = $this->msg( 'userrights-groupsmember', $count )->parse(); $grouplist = '

' . $grouplist . ' ' . $this->getLanguage()->listToText( $list ) . "

\n"; } $count = count( $autolist ); if( $count > 0 ) { - $autogrouplistintro = wfMessage( 'userrights-groupsmember-auto', $count)->parse(); + $autogrouplistintro = $this->msg( 'userrights-groupsmember-auto', $count )->parse(); $grouplist .= '

' . $autogrouplistintro . ' ' . $this->getLanguage()->listToText( $autolist ) . "

\n"; } @@ -441,15 +441,15 @@ class UserrightsPage extends SpecialPage { Html::hidden( 'user', $this->mTarget ) . Html::hidden( 'wpEditToken', $this->getUser()->getEditToken( $this->mTarget ) ) . Xml::openElement( 'fieldset' ) . - Xml::element( 'legend', array(), wfMessage( 'userrights-editusergroup', $user->getName() )->text() ) . - wfMessage( 'editinguser' )->params( wfEscapeWikiText( $user->getName() ) )->rawParams( $userToolLinks )->parse() . - wfMessage( 'userrights-groups-help', $user->getName() )->parse() . + Xml::element( 'legend', array(), $this->msg( 'userrights-editusergroup', $user->getName() )->text() ) . + $this->msg( 'editinguser' )->params( wfEscapeWikiText( $user->getName() ) )->rawParams( $userToolLinks )->parse() . + $this->msg( 'userrights-groups-help', $user->getName() )->parse() . $grouplist . Xml::tags( 'p', null, $this->groupCheckboxes( $groups, $user ) ) . Xml::openElement( 'table', array( 'border' => '0', 'id' => 'mw-userrights-table-outer' ) ) . " " . - Xml::label( wfMsg( 'userrights-reason' ), 'wpReason' ) . + Xml::label( $this->msg( 'userrights-reason' )->text(), 'wpReason' ) . " " . Xml::input( 'user-reason', 60, $this->getRequest()->getVal( 'user-reason', false ), @@ -459,7 +459,7 @@ class UserrightsPage extends SpecialPage { " . - Xml::submitButton( wfMsg( 'saveusergroups' ), + Xml::submitButton( $this->msg( 'saveusergroups' )->text(), array( 'name' => 'saveusergroups' ) + Linker::tooltipAndAccesskeyAttribs( 'userrights-set' ) ) . " " . @@ -536,7 +536,7 @@ class UserrightsPage extends SpecialPage { foreach( $columns as $name => $column ) { if( $column === array() ) continue; - $ret .= Xml::element( 'th', null, wfMessage( 'userrights-' . $name . '-col', count( $column ) )->text() ); + $ret .= Xml::element( 'th', null, $this->msg( 'userrights-' . $name . '-col', count( $column ) )->text() ); } $ret.= "\n\n"; foreach( $columns as $column ) { @@ -548,7 +548,7 @@ class UserrightsPage extends SpecialPage { $member = User::getGroupMember( $group, $user->getName() ); if ( $checkbox['irreversible'] ) { - $text = wfMessage( 'userrights-irreversible-marker', $member )->escaped(); + $text = $this->msg( 'userrights-irreversible-marker', $member )->escaped(); } else { $text = htmlspecialchars( $member ); } -- 2.20.1