Index: trunk/extensions/CheckUser/CheckUser_body.php |
— | — | @@ -95,7 +95,7 @@ |
96 | 96 | if ( $wgRequest->getVal( 'action' ) === 'block' ) { |
97 | 97 | $this->doMassUserBlock( $users, $blockreason, $tag, $talkTag ); |
98 | 98 | } elseif ( !$this->checkReason( $reason ) ) { |
99 | | - $wgOut->addWikiText( wfMsgExt( 'checkuser-noreason', array( 'parsemag' ) ) ); |
| 99 | + $wgOut->addWikiMsg( 'checkuser-noreason' ); |
100 | 100 | } elseif ( $checktype == 'subuserips' ) { |
101 | 101 | $this->doUserIPsRequest( $name, $reason, $period ); |
102 | 102 | } elseif ( $xff && $checktype == 'subipedits' ) { |
— | — | @@ -162,6 +162,7 @@ |
163 | 163 | '|' . wfMsg( 'checkuser-showlog' ) . ']]' |
164 | 164 | ); |
165 | 165 | } |
| 166 | + // FIXME: use more Xml/Html methods |
166 | 167 | $form = "<form name='checkuserform' id='checkuserform' action=\"$action\" method='post'>"; |
167 | 168 | $form .= '<fieldset><legend>' . wfMsgHtml( 'checkuser-query' ) . '</legend>'; |
168 | 169 | $form .= '<table border="0" cellpadding="2"><tr>'; |
— | — | @@ -171,18 +172,18 @@ |
172 | 173 | $form .= '</tr><tr>'; |
173 | 174 | $form .= '<td></td><td class="checkuserradios"><table border="0" cellpadding="3"><tr>'; |
174 | 175 | $form .= '<td>' . Xml::radio( 'checktype', 'subuserips', $encuserips, array( 'id' => 'subuserips' ) ); |
175 | | - $form .= ' ' . Xml::label( wfMsgHtml( 'checkuser-ips' ), 'subuserips' ) . '</td>'; |
| 176 | + $form .= ' ' . Xml::label( wfMsg( 'checkuser-ips' ), 'subuserips' ) . '</td>'; |
176 | 177 | $form .= '<td>' . Xml::radio( 'checktype', 'subipedits', $encipedits, array( 'id' => 'subipedits' ) ); |
177 | | - $form .= ' ' . Xml::label( wfMsgHtml( 'checkuser-edits' ), 'subipedits' ) . '</td>'; |
| 178 | + $form .= ' ' . Xml::label( wfMsg( 'checkuser-edits' ), 'subipedits' ) . '</td>'; |
178 | 179 | $form .= '<td>' . Xml::radio( 'checktype', 'subipusers', $encipusers, array( 'id' => 'subipusers' ) ); |
179 | | - $form .= ' ' . Xml::label( wfMsgHtml( 'checkuser-users' ), 'subipusers' ) . '</td>'; |
| 180 | + $form .= ' ' . Xml::label( wfMsg( 'checkuser-users' ), 'subipusers' ) . '</td>'; |
180 | 181 | $form .= '<td>' . Xml::radio( 'checktype', 'subuseredits', $encuseredits, array( 'id' => 'subuseredits' ) ); |
181 | | - $form .= ' ' . Xml::label( wfMsgHtml( 'checkuser-account' ), 'subuseredits' ) . '</td>'; |
| 182 | + $form .= ' ' . Xml::label( wfMsg( 'checkuser-account' ), 'subuseredits' ) . '</td>'; |
182 | 183 | $form .= '</tr></table></td>'; |
183 | 184 | $form .= '</tr><tr>'; |
184 | 185 | $form .= '<td>' . wfMsgHtml( 'checkuser-reason' ) . '</td>'; |
185 | 186 | $form .= '<td>' . Xml::input( 'reason', 46, $reason, array( 'maxlength' => '150', 'id' => 'checkreason' ) ); |
186 | | - $form .= ' ' . Xml::submitButton( wfMsgHtml( 'checkuser-check' ), |
| 187 | + $form .= ' ' . Xml::submitButton( wfMsg( 'checkuser-check' ), |
187 | 188 | array( 'id' => 'checkusersubmit', 'name' => 'checkusersubmit' ) ) . '</td>'; |
188 | 189 | $form .= '</tr></table></fieldset></form>'; |
189 | 190 | # Output form |
— | — | @@ -194,6 +195,7 @@ |
195 | 196 | */ |
196 | 197 | protected function addStyles() { |
197 | 198 | global $wgScriptPath, $wgCheckUserStyleVersion, $wgOut; |
| 199 | + // FIXME, use Html:: |
198 | 200 | $encJSFile = htmlspecialchars( "$wgScriptPath/extensions/CheckUser/checkuser.js?$wgCheckUserStyleVersion" ); |
199 | 201 | $wgOut->addScript( "<script type=\"text/javascript\" src=\"$encJSFile\"></script>" ); |
200 | 202 | } |
— | — | @@ -229,6 +231,7 @@ |
230 | 232 | } |
231 | 233 | |
232 | 234 | /** |
| 235 | + * FIXME: documentation incomplete |
233 | 236 | * Block a list of selected users |
234 | 237 | * @param array $users |
235 | 238 | * @param string $reason |
— | — | @@ -237,23 +240,22 @@ |
238 | 241 | protected function doMassUserBlock( $users, $reason = '', $tag = '', $talkTag = '' ) { |
239 | 242 | global $wgOut, $wgUser, $wgCheckUserMaxBlocks, $wgLang; |
240 | 243 | if ( empty( $users ) || $wgUser->isBlocked( false ) ) { |
241 | | - $wgOut->addWikiText( wfMsgExt( 'checkuser-block-failure', array( 'parsemag' ) ) ); |
| 244 | + $wgOut->addWikiMsg( 'checkuser-block-failure' ); |
242 | 245 | return; |
243 | 246 | } elseif ( count( $users ) > $wgCheckUserMaxBlocks ) { |
244 | | - $wgOut->addWikiText( wfMsgExt( 'checkuser-block-limit', array( 'parsemag' ) ) ); |
| 247 | + $wgOut->addWikiMsg( 'checkuser-block-limit' ); |
245 | 248 | return; |
246 | 249 | } elseif ( !$reason ) { |
247 | | - $wgOut->addWikiText( wfMsgExt( 'checkuser-block-noreason', array( 'parsemag' ) ) ); |
| 250 | + $wgOut->addWikiMsg( 'checkuser-block-noreason' ); |
248 | 251 | return; |
249 | 252 | } |
250 | 253 | $safeUsers = IPBlockForm::doMassUserBlock( $users, $reason, $tag, $talkTag ); |
251 | 254 | if ( !empty( $safeUsers ) ) { |
252 | 255 | $n = count( $safeUsers ); |
253 | 256 | $ulist = $wgLang->listToText( $safeUsers ); |
254 | | - $wgOut->addWikiText( wfMsgExt( 'checkuser-block-success', 'parsemag', |
255 | | - $ulist, $wgLang->formatNum( $n ) ) ); |
| 257 | + $wgOut->addWikiMsg( 'checkuser-block-success', $ulist, $wgLang->formatNum( $n ) ); |
256 | 258 | } else { |
257 | | - $wgOut->addWikiText( wfMsgExt( 'checkuser-block-failure', 'parsemag' ) ); |
| 259 | + $wgOut->addWikiMsg( 'checkuser-block-failure' ); |
258 | 260 | } |
259 | 261 | } |
260 | 262 | |
— | — | @@ -289,6 +291,7 @@ |
290 | 292 | if ( $lastEdit ) { |
291 | 293 | $lastEditDate = $wgLang->date( wfTimestamp( TS_MW, $lastEdit ), true ); |
292 | 294 | $lastEditTime = $wgLang->time( wfTimestamp( TS_MW, $lastEdit ), true ); |
| 295 | + // FIXME: don't pass around parsed messages |
293 | 296 | return wfMsgExt( 'checkuser-nomatch-edits', 'parse', $lastEditDate, $lastEditTime ); |
294 | 297 | } |
295 | 298 | return wfMsgExt( 'checkuser-nomatch', 'parse' ); |
— | — | @@ -300,8 +303,9 @@ |
301 | 304 | } |
302 | 305 | |
303 | 306 | /** |
304 | | - * @param string $ip |
305 | | - * @param bool $xfor |
| 307 | + * FIXME: documentation out of date |
| 308 | + * @param string $ip <??? |
| 309 | + * @param bool $xfor <??? |
306 | 310 | * @param string $reason |
307 | 311 | * Get all IPs used by a user |
308 | 312 | * Shows first and last date and number of edits |
— | — | @@ -324,6 +328,7 @@ |
325 | 329 | |
326 | 330 | # If user is not IP or nonexistent |
327 | 331 | if ( !$user_id ) { |
| 332 | + // FIXME: addWikiMsg |
328 | 333 | $s = wfMsgExt( 'nosuchusershort', array( 'parse' ), $user ); |
329 | 334 | $wgOut->addHTML( $s ); |
330 | 335 | return; |
— | — | @@ -331,6 +336,7 @@ |
332 | 337 | |
333 | 338 | # Record check... |
334 | 339 | if ( !$this->addLogEntry( 'userips', 'user', $user, $reason, $user_id ) ) { |
| 340 | + // FIXME: addWikiMsg |
335 | 341 | $wgOut->addHTML( '<p>' . wfMsgHtml( 'checkuser-log-fail' ) . '</p>' ); |
336 | 342 | } |
337 | 343 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -352,6 +358,7 @@ |
353 | 359 | $counter = 0; |
354 | 360 | while ( $row = $dbr->fetchObject( $ret ) ) { |
355 | 361 | if ( $counter >= 5000 ) { |
| 362 | + // FIXME: addWikiMSG |
356 | 363 | $wgOut->addHTML( wfMsgExt( 'checkuser-limited', array( 'parse' ) ) ); |
357 | 364 | break; |
358 | 365 | } |
— | — | @@ -440,6 +447,7 @@ |
441 | 448 | * @param string $ip |
442 | 449 | * @param bool $xfor |
443 | 450 | * @param string $reason |
| 451 | + * FIXME: $period ??? |
444 | 452 | * Shows all edits in Recent Changes by this IP (or range) and who made them |
445 | 453 | */ |
446 | 454 | protected function doIPEditsRequest( $ip, $xfor = false, $reason = '', $period = 0 ) { |
— | — | @@ -501,6 +509,7 @@ |
502 | 510 | $s .= '<ol>'; |
503 | 511 | while ( $row = $ret->fetchObject() ) { |
504 | 512 | if ( $counter >= 5000 ) { |
| 513 | + // FIXME: addWikiMsg |
505 | 514 | $wgOut->addHTML( wfMsgExt( 'checkuser-limited', array( 'parse' ) ) ); |
506 | 515 | break; |
507 | 516 | } |
— | — | @@ -559,6 +568,7 @@ |
560 | 569 | $s = '<div id="checkuserresults">'; |
561 | 570 | while ( $row = $ret->fetchObject() ) { |
562 | 571 | if ( $counter >= 5000 ) { |
| 572 | + // FIXME: addWikiMsg |
563 | 573 | $wgOut->addHTML( wfMsgExt( 'checkuser-limited', array( 'parse' ) ) ); |
564 | 574 | break; |
565 | 575 | } |