Only show in beta feature list when enabled as a betafeature

Bug: T149092
Change-Id: Iab021a8699845cfc302353c453ebdc1c125d7fd9
This commit is contained in:
addshore 2016-10-25 15:21:32 +01:00
parent bb4666ae88
commit c824428d41

View file

@ -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 ) {