jenkins-bot has submitted this change and it was merged. Change subject: Load ext.cx.base module only on special page ......................................................................
Load ext.cx.base module only on special page * Only load ext.cx.base on special page * ContentTranslation.hooks.php no longer needed Change-Id: I5701caa5d18ddb22c2a81e21a234f156b666b6d8 --- D ContentTranslation.hooks.php M ContentTranslation.php M specials/SpecialContentTranslation.php 3 files changed, 3 insertions(+), 28 deletions(-) Approvals: Amire80: Looks good to me, approved jenkins-bot: Verified diff --git a/ContentTranslation.hooks.php b/ContentTranslation.hooks.php deleted file mode 100644 index c62ece1..0000000 --- a/ContentTranslation.hooks.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -/** - * ContentTranslation extension - * A tool that allows editors to translate pages from one language - * to another with the help of machine translation and other translation aids - * - * @file - * @ingroup Extensions - * @copyright 2014 ContentTranslation Team and others; see AUTHORS.txt - * @license GPL-2.0+; see LICENSE.txt - */ - -class ContentTranslationHooks { - /** - * This is attached to the MediaWiki 'BeforePageDisplay' hook. - * @param OutputPage $out - * @param Skin $skin - * @return bool - * Hook: BeforePageDisplay - */ - public static function onBeforePageDisplay( &$output, &$skin ) { - $output->addModules( 'ext.cx.base' ); - return true; - } -} diff --git a/ContentTranslation.php b/ContentTranslation.php index 5c4ceef..37a2481 100644 --- a/ContentTranslation.php +++ b/ContentTranslation.php @@ -46,6 +46,5 @@ $GLOBALS['wgExtensionMessagesFiles']['ContentTranslationAlias'] = "$dir/ContentTranslation.alias.php"; -$GLOBALS['wgHooks']['BeforePageDisplay'][] = 'ContentTranslationHooks::onBeforePageDisplay'; // Special pages $GLOBALS['wgSpecialPages']['ContentTranslation'] = 'SpecialContentTranslation'; diff --git a/specials/SpecialContentTranslation.php b/specials/SpecialContentTranslation.php index 5b3ca65..0307c84 100644 --- a/specials/SpecialContentTranslation.php +++ b/specials/SpecialContentTranslation.php @@ -3,8 +3,8 @@ * Contains special page Special:ContentTranslation. * * @file - * @copyright 2014 ContentTranslation Team and others; see AUTHORS.txt - * @license GPL-2.0+; see LICENSE.txt + * @copyright See AUTHORS.txt + * @license GPL-2.0+ */ /** @@ -23,6 +23,7 @@ public function execute( $parameters ) { $out = $this->getOutput(); + $out->addModules( 'ext.cx.base' ); $skin = $this->getSkin(); $this->setHeaders(); $out->setArticleBodyOnly( true ); -- To view, visit https://gerrit.wikimedia.org/r/106734 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5701caa5d18ddb22c2a81e21a234f156b666b6d8 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: KartikMistry <kartik.mis...@gmail.com> Gerrit-Reviewer: Amire80 <amir.ahar...@mail.huji.ac.il> Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits