From 7f405134c710ca823782fdffc6f1e281d0183957 Mon Sep 17 00:00:00 2001 From: Niharika Kohli Date: Thu, 6 Mar 2014 16:22:37 +0000 Subject: [PATCH] Put new compact language links Beta Feature behind a feature flag Add new $wgULSCompactLinks feature flag, defaulting to false (as is standard for Beta Features). Only allow enabling of the feature if ULS position is 'interlanguage'. Change-Id: Ia268c3a49b5aa14b6a00e33c7f01a61eba48e776 --- UniversalLanguageSelector.hooks.php | 4 +++- UniversalLanguageSelector.php | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/UniversalLanguageSelector.hooks.php b/UniversalLanguageSelector.hooks.php index f740f528..b7e73556 100644 --- a/UniversalLanguageSelector.hooks.php +++ b/UniversalLanguageSelector.hooks.php @@ -63,7 +63,9 @@ class UniversalLanguageSelectorHooks { $out->addModules( 'ext.uls.init' ); // If compact ULS beta feature is enabled - if ( class_exists( 'BetaFeatures' ) && + if ( $wgULSCompactLinks && + $wgULSPosition === 'interlanguage' && + class_exists( 'BetaFeatures' ) && BetaFeatures::isFeatureEnabled( $out->getUser(), 'uls-compact-links' ) ) { $out->addModules( 'ext.uls.compactlinks' ); diff --git a/UniversalLanguageSelector.php b/UniversalLanguageSelector.php index 7f9ec456..c7c78bb5 100644 --- a/UniversalLanguageSelector.php +++ b/UniversalLanguageSelector.php @@ -172,6 +172,16 @@ $GLOBALS['wgULSNoWebfontsSelectors'] = array( '#p-lang li.interlanguage-link > a */ $GLOBALS['wgULSFontRepositoryBasePath'] = false; +/** + * Whether the "Compact language links" Beta Feature is exposed. Requires + * $wgULSPosition to be 'interlanguage'. + * + * Defaults to false. + * + * @since 2014.03 + */ +$GLOBALS['wgULSCompactLinks'] = false; + // Internationalization $GLOBALS['wgExtensionMessagesFiles']['UniversalLanguageSelector'] = __DIR__ . '/UniversalLanguageSelector.i18n.php';