X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSkinTemplate.php;h=77ea307303a7582f5f43a77a098a9d658c46fd0b;hb=636c64482dc740e05b3a114927655a62acd1eca6;hp=e5b8872c8aa5fc5809c14f68c0137c6448fea2eb;hpb=72c70affc0a4036e74946339268f5ab7abf57eaf;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index e5b8872c8a..77ea307303 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -159,7 +159,7 @@ class SkinTemplate extends Skin { $language_urls[] = array( 'href' => $languageLinkTitle->getFullURL(), 'text' => $ilLangName, - 'title' => wfMessage( 'tooltip-iwiki', $languageLinkTitle->getText(), $ilLangLocalName )->escaped(), + 'title' => wfMessage( 'interlanguage-link-title', $languageLinkTitle->getText(), $ilLangLocalName )->text(), 'class' => $class, 'lang' => wfBCP47( $ilInterwikiCode ), 'hreflang' => wfBCP47( $ilInterwikiCode ), @@ -217,15 +217,6 @@ class SkinTemplate extends Skin { * @param $out OutputPage */ function outputPage( OutputPage $out = null ) { - global $wgContLang; - global $wgScript, $wgStylePath; - global $wgMimeType, $wgJsMimeType; - global $wgXhtmlNamespaces, $wgHtml5Version; - global $wgDisableCounters, $wgSitename, $wgLogo; - global $wgMaxCredits, $wgShowCreditsIfMax; - global $wgPageShowWatchingUsers; - global $wgArticlePath, $wgScriptPath, $wgServer; - wfProfileIn( __METHOD__ ); Profiler::instance()->setTemplated( true ); @@ -237,14 +228,45 @@ class SkinTemplate extends Skin { } $out = $this->getOutput(); - $request = $this->getRequest(); $user = $this->getUser(); - $title = $this->getTitle(); wfProfileIn( __METHOD__ . '-init' ); $this->initPage( $out ); wfProfileOut( __METHOD__ . '-init' ); + $tpl = $this->prepareQuickTemplate( $out ); + // execute template + wfProfileIn( __METHOD__ . '-execute' ); + $res = $tpl->execute(); + wfProfileOut( __METHOD__ . '-execute' ); + + // result may be an error + $this->printOrError( $res ); + + if ( $oldContext ) { + $this->setContext( $oldContext ); + } + + wfProfileOut( __METHOD__ ); + } + + /** + * initialize various variables and generate the template + * + * @since 1.23 + * @param $out OutputPage + * @return QuickTemplate the template to be executed by outputPage + */ + protected function prepareQuickTemplate( OutputPage $out = null ) { + global $wgContLang, $wgScript, $wgStylePath, + $wgMimeType, $wgJsMimeType, $wgXhtmlNamespaces, $wgHtml5Version, + $wgDisableCounters, $wgSitename, $wgLogo, $wgMaxCredits, + $wgShowCreditsIfMax, $wgPageShowWatchingUsers, $wgArticlePath, + $wgScriptPath, $wgServer; + + wfProfileIn( __METHOD__ ); + $title = $this->getTitle(); + $request = $this->getRequest(); $tpl = $this->setupTemplateForOutput(); wfProfileIn( __METHOD__ . '-stuff-head' ); @@ -523,18 +545,8 @@ class SkinTemplate extends Skin { $tpl->set( 'dataAfterContent', $this->afterContentHook() ); wfProfileOut( __METHOD__ . '-stuff5' ); - // execute template - wfProfileIn( __METHOD__ . '-execute' ); - $res = $tpl->execute(); - wfProfileOut( __METHOD__ . '-execute' ); - - // result may be an error - $this->printOrError( $res ); - - if ( $oldContext ) { - $this->setContext( $oldContext ); - } wfProfileOut( __METHOD__ ); + return $tpl; } /** @@ -1998,9 +2010,10 @@ abstract class BaseTemplate extends QuickTemplate { * body and html tags. */ function printTrail() { ?> +getSkin()->getContext() ); ?> html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?> html( 'reporttime' ) ?> -getSkin()->getContext() ); +