From: Alexandre Emsenhuber Date: Fri, 10 Feb 2012 19:46:04 +0000 (+0000) Subject: * Use local context instead of global variables X-Git-Tag: 1.31.0-rc.0~24792 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22lang_raccourcis%22%2C%22module=%24nom_module%22%29%20.%20%22?a=commitdiff_plain;h=998b97c07dfd9b8a43898c5e5003e299cf19f196;p=lhc%2Fweb%2Fwiklou.git * Use local context instead of global variables * Same for messages * Pass the Message object to OutputPage::setPageTitle() and OutputPage::setSubtitle() * Fixed casing of OutputPage::setPageTitle() --- diff --git a/includes/specials/SpecialJavaScriptTest.php b/includes/specials/SpecialJavaScriptTest.php index 87221186f1..71623930eb 100644 --- a/includes/specials/SpecialJavaScriptTest.php +++ b/includes/specials/SpecialJavaScriptTest.php @@ -44,26 +44,24 @@ class SpecialJavaScriptTest extends SpecialPage { // No framework specified if ( $par == '' ) { - $out->setPagetitle( wfMsgHtml( 'javascripttest' ) ); + $out->setPageTitle( $this->msg( 'javascripttest' ) ); $summary = $this->wrapSummaryHtml( - wfMsgHtml( 'javascripttest-pagetext-noframework' ) . $this->getFrameworkListHtml(), + $this->msg( 'javascripttest-pagetext-noframework' )->escaped() . $this->getFrameworkListHtml(), 'noframework' ); $out->addHtml( $summary ); // Matched! Display proper title and initialize the framework } elseif ( isset( self::$frameworks[$framework] ) ) { - $out->setPagetitle( wfMsgHtml( 'javascripttest-title', wfMsgHtml( "javascripttest-$framework-name" ) ) ); - $out->setSubtitle( - wfMessage( 'javascripttest-backlink' )->rawParams( Linker::linkKnown( $this->getTitle() ) )->escaped() - ); + $out->setPageTitle( $this->msg( 'javascripttest-title', $this->msg( "javascripttest-$framework-name" )->plain() ) ); + $out->setSubtitle( $this->msg( 'javascripttest-backlink' )->rawParams( Linker::linkKnown( $this->getTitle() ) ) ); $this->{self::$frameworks[$framework]}(); // Framework not found, display error } else { - $out->setPagetitle( wfMsgHtml( 'javascripttest' ) ); + $out->setPageTitle( $this->msg( 'javascripttest' ) ); $summary = $this->wrapSummaryHtml( '

' - . wfMsgHtml( 'javascripttest-pagetext-unknownframework', $par ) + . $this->msg( 'javascripttest-pagetext-unknownframework', $par )->escaped() . '

' . $this->getFrameworkListHtml(), 'unknownframework' @@ -82,11 +80,11 @@ class SpecialJavaScriptTest extends SpecialPage { $list .= Html::rawElement( 'li', array(), - Linker::link( $this->getTitle( $framework ), wfMsgHtml( "javascripttest-$framework-name" ) ) + Linker::link( $this->getTitle( $framework ), $this->msg( "javascripttest-$framework-name" )->escaped() ) ); } $list .= ''; - $msg = wfMessage( 'javascripttest-pagetext-frameworks' )->rawParams( $list )->parseAsBlock(); + $msg = $this->msg( 'javascripttest-pagetext-frameworks' )->rawParams( $list )->parseAsBlock(); return $msg; } @@ -114,7 +112,7 @@ class SpecialJavaScriptTest extends SpecialPage { * Initialize the page for QUnit. */ private function initQUnitTesting() { - global $wgJavaScriptTestConfig, $wgLang; + global $wgJavaScriptTestConfig; $out = $this->getOutput(); @@ -122,11 +120,11 @@ class SpecialJavaScriptTest extends SpecialPage { $qunitTestModules = $out->getResourceLoader()->getTestModuleNames( 'qunit' ); $out->addModules( $qunitTestModules ); - $summary = wfMessage( 'javascripttest-qunit-intro' ) + $summary = $this->msg( 'javascripttest-qunit-intro' ) ->params( $wgJavaScriptTestConfig['qunit']['documentation'] ) ->parseAsBlock(); - $header = wfMessage( 'javascripttest-qunit-heading' )->escaped(); - $userDir = $wgLang->getDir(); + $header = $this->msg( 'javascripttest-qunit-heading' )->escaped(); + $userDir = $this->getLanguage()->getDir(); $baseHtml = <<