From c824428d413985cd9f57ac4e35cba9b79c30bccf Mon Sep 17 00:00:00 2001 From: addshore Date: Tue, 25 Oct 2016 15:21:32 +0100 Subject: [PATCH] Only show in beta feature list when enabled as a betafeature Bug: T149092 Change-Id: Iab021a8699845cfc302353c453ebdc1c125d7fd9 --- RevisionSlider.hooks.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/RevisionSlider.hooks.php b/RevisionSlider.hooks.php index 5ee781a9..cd8d43f4 100644 --- a/RevisionSlider.hooks.php +++ b/RevisionSlider.hooks.php @@ -116,18 +116,21 @@ class RevisionSliderHooks { } public static function getBetaFeaturePreferences( User $user, array &$prefs ) { - global $wgExtensionAssetsPath; + $config = MediaWikiServices::getInstance()->getMainConfig(); + $extensionAssetsPath = $config->get( 'ExtensionAssetsPath' ); - $prefs['revisionslider'] = [ - 'label-message' => 'revisionslider-beta-feature-message', - 'desc-message' => 'revisionslider-beta-feature-description', - 'screenshot' => [ - 'ltr' => "$wgExtensionAssetsPath/RevisionSlider/resources/RevisionSlider-beta-features-ltr.svg", - 'rtl' => "$wgExtensionAssetsPath/RevisionSlider/resources/RevisionSlider-beta-features-rtl.svg", - ], - 'info-link' => 'https://www.mediawiki.org/wiki/Extension:RevisionSlider', - 'discussion-link' => 'https://www.mediawiki.org/wiki/Extension_talk:RevisionSlider', - ]; + if ( $config->get( 'RevisionSliderBetaFeature' ) ) { + $prefs['revisionslider'] = [ + 'label-message' => 'revisionslider-beta-feature-message', + 'desc-message' => 'revisionslider-beta-feature-description', + 'screenshot' => [ + 'ltr' => "$extensionAssetsPath/RevisionSlider/resources/RevisionSlider-beta-features-ltr.svg", + 'rtl' => "$extensionAssetsPath/RevisionSlider/resources/RevisionSlider-beta-features-rtl.svg", + ], + 'info-link' => 'https://www.mediawiki.org/wiki/Extension:RevisionSlider', + 'discussion-link' => 'https://www.mediawiki.org/wiki/Extension_talk:RevisionSlider', + ]; + } } public static function onResourceLoaderTestModules( array &$testModules, ResourceLoader $rl ) {