Index: trunk/extensions/Renameuser/Renameuser_body.php |
— | — | @@ -177,24 +177,18 @@ |
178 | 178 | # Let user read warnings |
179 | 179 | return; |
180 | 180 | } elseif ( !$wgRequest->wasPosted() || !$wgUser->matchEditToken( $wgRequest->getVal( 'token' ) ) ) { |
181 | | - $wgOut->addWikiText( "<div class=\"errorbox\">" . wfMsg( 'renameuser-error-request' ) . "</div>" ); |
| 181 | + $wgOut->wrapWikiMsg( "<div class=\"errorbox\">$1</div>", 'renameuser-error-request' ); |
182 | 182 | return; |
183 | 183 | } elseif ( !is_object( $oldusername ) ) { |
184 | | - $wgOut->addWikiText( |
185 | | - "<div class=\"errorbox\">" |
186 | | - . wfMsg( 'renameusererrorinvalid', $wgRequest->getText( 'oldusername' ) ) |
187 | | - . "</div>" |
188 | | - ); |
| 184 | + $wgOut->wrapWikiMsg( "<div class=\"errorbox\">$1</div>", |
| 185 | + array( 'renameusererrorinvalid', $wgRequest->getText( 'oldusername' ) ) ); |
189 | 186 | return; |
190 | 187 | } elseif ( !is_object( $newusername ) ) { |
191 | | - $wgOut->addWikiText( |
192 | | - "<div class=\"errorbox\">" |
193 | | - . wfMsg( 'renameusererrorinvalid', $wgRequest->getText( 'newusername' ) ) |
194 | | - . "</div>" |
195 | | - ); |
| 188 | + $wgOut->wrapWikiMsg( "<div class=\"errorbox\">$1</div>", |
| 189 | + array( 'renameusererrorinvalid', $wgRequest->getText( 'newusername' ) ) ); |
196 | 190 | return; |
197 | 191 | } elseif ( $oldusername->getText() == $newusername->getText() ) { |
198 | | - $wgOut->addWikiText( "<div class=\"errorbox\">" . wfMsg( 'renameuser-error-same-user' ) . "</div>" ); |
| 192 | + $wgOut->wrapWikiMsg( "<div class=\"errorbox\">$1</div>", 'renameuser-error-same-user' ); |
199 | 193 | return; |
200 | 194 | } |
201 | 195 | |
— | — | @@ -204,13 +198,13 @@ |
205 | 199 | |
206 | 200 | // It won't be an object if for instance "|" is supplied as a value |
207 | 201 | if ( !is_object( $olduser ) ) { |
208 | | - $wgOut->addWikiText( "<div class=\"errorbox\">" . wfMsg( 'renameusererrorinvalid', |
209 | | - $oldusername->getText() ) . "</div>" ); |
| 202 | + $wgOut->wrapWikiMsg( "<div class=\"errorbox\">$1</div>", |
| 203 | + array( 'renameusererrorinvalid', $oldusername->getText() ) ); |
210 | 204 | return; |
211 | 205 | } |
212 | 206 | if ( !is_object( $newuser ) || !User::isCreatableName( $newuser->getName() ) ) { |
213 | | - $wgOut->addWikiText( "<div class=\"errorbox\">" . wfMsg( 'renameusererrorinvalid', |
214 | | - $newusername->getText() ) . "</div>" ); |
| 207 | + $wgOut->wrapWikiMsg( "<div class=\"errorbox\">$1</div>", |
| 208 | + array( 'renameusererrorinvalid', $newusername->getText() ) ); |
215 | 209 | return; |
216 | 210 | } |
217 | 211 | |
— | — | @@ -237,14 +231,14 @@ |
238 | 232 | } |
239 | 233 | |
240 | 234 | if ( $uid == 0 ) { |
241 | | - $wgOut->addWikiText( "<div class=\"errorbox\">" . wfMsg( 'renameusererrordoesnotexist' , |
242 | | - $oldusername->getText() ) . "</div>" ); |
| 235 | + $wgOut->wrapWikiMsg( "<div class=\"errorbox\">$1</div>", |
| 236 | + array( 'renameusererrordoesnotexist', $oldusername->getText() ) ); |
243 | 237 | return; |
244 | 238 | } |
245 | 239 | |
246 | 240 | if ( $newuser->idForName() != 0 ) { |
247 | | - $wgOut->addWikiText( "<div class=\"errorbox\">" . wfMsg( 'renameusererrorexists', |
248 | | - $newusername->getText() ) . "</div>" ); |
| 241 | + $wgOut->wrapWikiMsg( "<div class=\"errorbox\">$1</div>", |
| 242 | + array( 'renameusererrorexists', $newusername->getText() ) ); |
249 | 243 | return; |
250 | 244 | } |
251 | 245 | |
— | — | @@ -254,13 +248,11 @@ |
255 | 249 | // Check edit count |
256 | 250 | if ( !$wgUser->isAllowed( 'siteadmin' ) ) { |
257 | 251 | if ( RENAMEUSER_CONTRIBLIMIT != 0 && $contribs > RENAMEUSER_CONTRIBLIMIT ) { |
258 | | - $wgOut->addWikiText( "<div class=\"errorbox\">" . |
259 | | - wfMsg( 'renameusererrortoomany', |
260 | | - $oldusername->getText(), |
| 252 | + $wgOut->wrapWikiMsg( "<div class=\"errorbox\">$1</div>", |
| 253 | + array( 'renameusererrortoomany', $oldusername->getText(), |
261 | 254 | $wgLang->formatNum( $contribs ), |
262 | 255 | $wgLang->formatNum( RENAMEUSER_CONTRIBLIMIT ) |
263 | | - ) |
264 | | - . "</div>" ); |
| 256 | + ) ); |
265 | 257 | return; |
266 | 258 | } |
267 | 259 | } |
— | — | @@ -337,8 +329,8 @@ |
338 | 330 | } |
339 | 331 | |
340 | 332 | // Output success message stuff :) |
341 | | - $wgOut->addWikiText( "<div class=\"successbox\">" . wfMsg( 'renameusersuccess', $oldusername->getText(), |
342 | | - $newusername->getText() ) . "</div><br style=\"clear:both\" />" ); |
| 333 | + $wgOut->wrapWikiMsg( "<div class=\"successbox\">$1</div><br style=\"clear:both\" />", |
| 334 | + array( 'renameusersuccess', $oldusername->getText(), $newusername->getText() ) ); |
343 | 335 | } |
344 | 336 | |
345 | 337 | function showLogExtract( $username, $type, &$out ) { |