r113178 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113177‎ | r113178 | r113179 >
Date:20:55, 6 March 2012
Author:ialex
Status:ok (Comments)
Tags:
Comment:
Use local context to get messages
Modified paths:
  • /trunk/phase3/includes/specials/SpecialListgrouprights.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialListgrouprights.php
@@ -54,8 +54,8 @@
5555 $out->addHTML(
5656 Xml::openElement( 'table', array( 'class' => 'wikitable mw-listgrouprights-table' ) ) .
5757 '<tr>' .
58 - Xml::element( 'th', null, wfMsg( 'listgrouprights-group' ) ) .
59 - Xml::element( 'th', null, wfMsg( 'listgrouprights-rights' ) ) .
 58+ Xml::element( 'th', null, $this->msg( 'listgrouprights-group' )->text() ) .
 59+ Xml::element( 'th', null, $this->msg( 'listgrouprights-rights' )->text() ) .
6060 '</tr>'
6161 );
6262
@@ -77,10 +77,10 @@
7878 ? 'all'
7979 : $group;
8080
81 - $msg = wfMessage( 'group-' . $groupname );
 81+ $msg = $this->msg( 'group-' . $groupname );
8282 $groupnameLocalized = !$msg->isBlank() ? $msg->text() : $groupname;
8383
84 - $msg = wfMessage( 'grouppage-' . $groupname )->inContentLanguage();
 84+ $msg = $this->msg( 'grouppage-' . $groupname )->inContentLanguage();
8585 $grouppageLocalized = !$msg->isBlank() ?
8686 $msg->text() :
8787 MWNamespace::getCanonicalName( NS_PROJECT ) . ':' . $groupname;
@@ -99,12 +99,12 @@
100100 // Link to Special:listusers for implicit group 'user'
101101 $grouplink = '<br />' . Linker::linkKnown(
102102 SpecialPage::getTitleFor( 'Listusers' ),
103 - wfMsgHtml( 'listgrouprights-members' )
 103+ $this->msg( 'listgrouprights-members' )->escaped()
104104 );
105105 } elseif ( !in_array( $group, $wgImplicitGroups ) ) {
106106 $grouplink = '<br />' . Linker::linkKnown(
107107 SpecialPage::getTitleFor( 'Listusers' ),
108 - wfMsgHtml( 'listgrouprights-members' ),
 108+ $this->msg( 'listgrouprights-members' )->escaped(),
109109 array(),
110110 array( 'group' => $group )
111111 );
@@ -152,59 +152,59 @@
153153 foreach( $permissions as $permission => $granted ) {
154154 //show as granted only if it isn't revoked to prevent duplicate display of permissions
155155 if( $granted && ( !isset( $revoke[$permission] ) || !$revoke[$permission] ) ) {
156 - $description = wfMsgExt( 'listgrouprights-right-display', array( 'parseinline' ),
 156+ $description = $this->msg( 'listgrouprights-right-display',
157157 User::getRightDescription( $permission ),
158158 '<span class="mw-listgrouprights-right-name">' . $permission . '</span>'
159 - );
 159+ )->parse();
160160 $r[] = $description;
161161 }
162162 }
163163 foreach( $revoke as $permission => $revoked ) {
164164 if( $revoked ) {
165 - $description = wfMsgExt( 'listgrouprights-right-revoked', array( 'parseinline' ),
 165+ $description = $this->msg( 'listgrouprights-right-revoked',
166166 User::getRightDescription( $permission ),
167167 '<span class="mw-listgrouprights-right-name">' . $permission . '</span>'
168 - );
 168+ )->parse();
169169 $r[] = $description;
170170 }
171171 }
172172 sort( $r );
173173 $lang = $this->getLanguage();
174174 if( $add === true ){
175 - $r[] = wfMsgExt( 'listgrouprights-addgroup-all', array( 'escape' ) );
 175+ $r[] = $this->msg( 'listgrouprights-addgroup-all' )->escaped();
176176 } elseif( is_array( $add ) && count( $add ) ) {
177177 $add = array_values( array_unique( $add ) );
178 - $r[] = wfMsgExt( 'listgrouprights-addgroup', array( 'parseinline' ),
 178+ $r[] = $this->msg( 'listgrouprights-addgroup',
179179 $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $add ) ),
180180 count( $add )
181 - );
 181+ )->parse();
182182 }
183183 if( $remove === true ){
184 - $r[] = wfMsgExt( 'listgrouprights-removegroup-all', array( 'escape' ) );
 184+ $r[] = $this->msg( 'listgrouprights-removegroup-all' )->escaped();
185185 } elseif( is_array( $remove ) && count( $remove ) ) {
186186 $remove = array_values( array_unique( $remove ) );
187 - $r[] = wfMsgExt( 'listgrouprights-removegroup', array( 'parseinline' ),
 187+ $r[] = $this->msg( 'listgrouprights-removegroup', array( 'parseinline' ),
188188 $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $remove ) ),
189189 count( $remove )
190 - );
 190+ )->parse();
191191 }
192192 if( $addSelf === true ){
193 - $r[] = wfMsgExt( 'listgrouprights-addgroup-self-all', array( 'escape' ) );
 193+ $r[] = $this->msg( 'listgrouprights-addgroup-self-all' )->escaped();
194194 } elseif( is_array( $addSelf ) && count( $addSelf ) ) {
195195 $addSelf = array_values( array_unique( $addSelf ) );
196 - $r[] = wfMsgExt( 'listgrouprights-addgroup-self', array( 'parseinline' ),
 196+ $r[] = $this->msg( 'listgrouprights-addgroup-self', array( 'parseinline' ),
197197 $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $addSelf ) ),
198198 count( $addSelf )
199 - );
 199+ )->parse();
200200 }
201201 if( $removeSelf === true ){
202 - $r[] = wfMsgExt( 'listgrouprights-removegroup-self-all', array( 'escape' ) );
 202+ $r[] = $this->msg( 'listgrouprights-removegroup-self-all' )->parse();
203203 } elseif( is_array( $removeSelf ) && count( $removeSelf ) ) {
204204 $removeSelf = array_values( array_unique( $removeSelf ) );
205 - $r[] = wfMsgExt( 'listgrouprights-removegroup-self', array( 'parseinline' ),
 205+ $r[] = $this->msg( 'listgrouprights-removegroup-self', array( 'parseinline' ),
206206 $lang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $removeSelf ) ),
207207 count( $removeSelf )
208 - );
 208+ )->parse();
209209 }
210210 if( empty( $r ) ) {
211211 return '';

Comments

#Comment by Nikerabbit (talk | contribs)   07:42, 7 March 2012

Before doing more of this, we should fix bug 34987.

Status & tagging log