Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php |
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | $this->editable = $wgUser->isAllowed( 'centralnotice-admin' ); |
32 | 32 | |
33 | 33 | // Show summary |
34 | | - $wgOut->addWikiText( wfMsg( 'centralnotice-summary' ) ); |
| 34 | + $wgOut->addWikiMsg( 'centralnotice-summary' ); |
35 | 35 | |
36 | 36 | // Show header |
37 | 37 | CentralNotice::printHeader(); |
— | — | @@ -64,6 +64,7 @@ |
65 | 65 | } |
66 | 66 | |
67 | 67 | // Handle adding |
| 68 | + // FIXME: getText()? weak comparison |
68 | 69 | if ( $wgRequest->getVal( 'wpMethod' ) == 'addTemplate' ) { |
69 | 70 | $this->addTemplate( |
70 | 71 | $wgRequest->getVal( 'templateName' ), |
— | — | @@ -266,7 +267,7 @@ |
267 | 268 | if ( $this->editable ) { |
268 | 269 | $htmlOut .= Xml::openElement( 'form', array( 'method' => 'post' ) ); |
269 | 270 | } |
270 | | - $htmlOut .= Xml::fieldset( wfMsgHtml( 'centralnotice-translate-heading', $currentTemplate ) ); |
| 271 | + $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-translate-heading', $currentTemplate ) ); |
271 | 272 | $htmlOut .= Xml::openElement( 'table', |
272 | 273 | array ( |
273 | 274 | 'cellpadding' => 9, |
— | — | @@ -348,7 +349,7 @@ |
349 | 350 | $htmlOut .= Xml::hidden( 'wpUserLanguage', $wpUserLang ); |
350 | 351 | $htmlOut .= Xml::openElement( 'tr' ); |
351 | 352 | $htmlOut .= Xml::tags( 'td', array( 'colspan' => 4 ), |
352 | | - Xml::submitButton( wfMsg( 'centralnotice-modify', array( 'name' => 'update' ) ) ) |
| 353 | + Xml::submitButton( wfMsg( 'centralnotice-modify' ), array( 'name' => 'update' ) ) |
353 | 354 | ); |
354 | 355 | $htmlOut .= Xml::closeElement( 'tr' ); |
355 | 356 | } |
— | — | @@ -362,7 +363,7 @@ |
363 | 364 | * Show language selection form |
364 | 365 | */ |
365 | 366 | $htmlOut .= Xml::openElement( 'form', array( 'method' => 'post' ) ); |
366 | | - $htmlOut .= Xml::fieldset( wfMsgHtml( 'centralnotice-change-lang' ) ); |
| 367 | + $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-change-lang' ) ); |
367 | 368 | $htmlOut .= Xml::openElement( 'table', array ( 'cellpadding' => 9 ) ); |
368 | 369 | list( $lsLabel, $lsSelect ) = Xml::languageSelector( $wpUserLang ); |
369 | 370 | |
— | — | @@ -377,7 +378,7 @@ |
378 | 379 | ); |
379 | 380 | $htmlOut .= Xml::tags( 'tr', null, |
380 | 381 | Xml::tags( 'td', null, '' ) . |
381 | | - Xml::tags( 'td', null, $sk->makeLinkObj( $newPage, wfMsg( 'centralnotice-preview-all-template-translations' ), "template=$currentTemplate&wpUserLanguage=all" ) ) |
| 382 | + Xml::tags( 'td', null, $sk->makeLinkObj( $newPage, wfMsgHtml( 'centralnotice-preview-all-template-translations' ), "template=$currentTemplate&wpUserLanguage=all" ) ) |
382 | 383 | ); |
383 | 384 | $htmlOut .= Xml::closeElement( 'table' ); |
384 | 385 | $htmlOut .= Xml::closeElement( 'fieldset' ); |
— | — | @@ -390,7 +391,7 @@ |
391 | 392 | $htmlOut .= Xml::openElement( 'form', array( 'method' => 'post' ) ); |
392 | 393 | $htmlOut .= Xml::hidden( 'wpMethod', 'editTemplate' ); |
393 | 394 | } |
394 | | - $htmlOut .= Xml::fieldset( wfMsgHtml( 'centralnotice-edit-template' ) ); |
| 395 | + $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-edit-template' ) ); |
395 | 396 | $htmlOut .= Xml::openElement( 'table', |
396 | 397 | array( |
397 | 398 | 'cellpadding' => 9, |
— | — | @@ -402,7 +403,7 @@ |
403 | 404 | ); |
404 | 405 | if ( $this->editable ) { |
405 | 406 | $htmlOut .= Xml::tags( 'tr', null, |
406 | | - Xml::tags( 'td', null, Xml::submitButton( wfMsgHtml( 'centralnotice-modify' ) ) ) |
| 407 | + Xml::tags( 'td', null, Xml::submitButton( wfMsg( 'centralnotice-modify' ) ) ) |
407 | 408 | ); |
408 | 409 | } |
409 | 410 | $htmlOut .= Xml::closeElement( 'table' ); |
— | — | @@ -425,6 +426,7 @@ |
426 | 427 | $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-clone-notice' ) ); |
427 | 428 | $htmlOut .= Xml::openElement( 'table', array( 'cellpadding' => 9 ) ); |
428 | 429 | $htmlOut .= Xml::openElement( 'tr' ); |
| 430 | + // FIXME: hardcoded text? |
429 | 431 | $htmlOut .= Xml::inputLabel( 'Name:', 'newTemplate', 'newTemplate, 25' ); |
430 | 432 | $htmlOut .= Xml::submitButton( wfMsg( 'centralnotice-clone' ), array ( 'id' => 'clone' ) ); |
431 | 433 | $htmlOut .= Xml::hidden( 'oldTemplate', $currentTemplate ); |
— | — | @@ -516,7 +518,9 @@ |
517 | 519 | private function removeTemplate ( $name ) { |
518 | 520 | global $wgOut, $egCentralNoticeTables; |
519 | 521 | |
| 522 | + // FIXME: weak comparison |
520 | 523 | if ( $name == '' ) { |
| 524 | + // FIXME: message not defined? |
521 | 525 | $wgOut->addHTML( wfMsg( 'centralnotice-template-doesnt-exist' ) ); |
522 | 526 | return; |
523 | 527 | } |
— | — | @@ -526,7 +530,7 @@ |
527 | 531 | $res = $dbr->select( 'cn_assignments', 'asn_id', array( 'tmp_id' => $id ), __METHOD__ ); |
528 | 532 | |
529 | 533 | if ( $dbr->numRows( $res ) > 0 ) { |
530 | | - $wgOut->addHTML( wfMsg( 'centralnotice-template-still-bound' ) ); |
| 534 | + $wgOut->addWikiMsg( 'centralnotice-template-still-bound' ); |
531 | 535 | return; |
532 | 536 | } else { |
533 | 537 | $dbw = wfGetDB( DB_MASTER ); |
— | — | @@ -548,7 +552,7 @@ |
549 | 553 | global $wgOut, $egCentralNoticeTables; |
550 | 554 | |
551 | 555 | if ( $body == '' || $name == '' ) { |
552 | | - $wgOut->addHTML( wfMsg( 'centralnotice-null-string' ) ); |
| 556 | + $wgOut->addWikiMsg( 'centralnotice-null-string' ); |
553 | 557 | return; |
554 | 558 | } |
555 | 559 | |
— | — | @@ -562,7 +566,7 @@ |
563 | 567 | ); |
564 | 568 | |
565 | 569 | if ( $dbr->numRows( $res ) > 0 ) { |
566 | | - $wgOut->addHTML( wfMsg( 'centralnotice-template-exists' ) ); |
| 570 | + $wgOut->addWikiMsg( 'centralnotice-template-exists' ); |
567 | 571 | return false; |
568 | 572 | } else { |
569 | 573 | $dbw = wfGetDB( DB_MASTER ); |
— | — | @@ -588,7 +592,7 @@ |
589 | 593 | global $wgOut, $egCentralNoticeTables; |
590 | 594 | |
591 | 595 | if ( $body == '' || $name == '' ) { |
592 | | - $wgOut->addHTML( wfMsg( 'centralnotice-null-string' ) ); |
| 596 | + $wgOut->addWikiMsg( 'centralnotice-null-string' ); |
593 | 597 | return; |
594 | 598 | } |
595 | 599 | |