12 private const DISCOUNT_CONSTRUCTOR =
'sale_discount_constructor';
13 private const CUMULATIVE_DISCOUNTS =
'sale_cumulative_discounts';
15 private static $bitrix24Included =
null;
17 private static $featureList = [];
19 private static $tranferList = [
20 self::CUMULATIVE_DISCOUNTS =>
'CatDiscountSave'
23 private static $retailExist = [
24 self::CUMULATIVE_DISCOUNTS => true
27 private static $bitrix24exist = [
28 self::CUMULATIVE_DISCOUNTS =>
true,
29 self::DISCOUNT_CONSTRUCTOR => true
33 private static $bitrix24helpCodes = [
34 self::DISCOUNT_CONSTRUCTOR =>
'limit_shop_discount_builder',
35 self::CUMULATIVE_DISCOUNTS =>
'limit_shop_cumulative_discounts'
38 private static $helpCodesCounter = 0;
39 private static $initUi =
false;
43 return self::isFeatureEnabled(self::CUMULATIVE_DISCOUNTS);
48 return self::isFeatureEnabled(self::DISCOUNT_CONSTRUCTOR);
58 return self::getHelpLink(self::CUMULATIVE_DISCOUNTS);
68 return self::getHelpLink(self::DISCOUNT_CONSTRUCTOR);
79 if (!self::isBitrix24())
83 if (self::$helpCodesCounter <= 0 || self::$initUi)
88 $APPLICATION->IncludeComponent(
89 'bitrix:ui.info.helper',
95 private static function isFeatureEnabled($featureId)
97 $featureId = (string)$featureId;
98 if ($featureId ===
'')
100 if (!isset(self::$featureList[$featureId]))
102 if (self::isBitrix24())
104 if (isset(self::$bitrix24exist[$featureId]))
105 self::$featureList[$featureId] = Bitrix24\Feature::isFeatureEnabled($featureId);
107 self::$featureList[$featureId] =
true;
111 if (isset(self::$retailExist[$featureId]))
112 self::$featureList[$featureId] = \CBXFeatures::IsFeatureEnabled(self::$tranferList[$featureId]);
114 self::$featureList[$featureId] =
true;
117 return self::$featureList[$featureId];
126 private static function getHelpLink(
string $featureId): ?array
128 if (!self::isBitrix24())
132 if (!isset(self::$bitrix24helpCodes[$featureId]))
136 self::$helpCodesCounter++;
139 'LINK' =>
'BX.UI.InfoHelper.show(\''.self::$bitrix24helpCodes[$featureId].
'\');
'
143 private static function isBitrix24()
145 if (self::$bitrix24Included === null)
146 self::$bitrix24Included = Loader::includeModule('bitrix24
');
147 return self::$bitrix24Included;
static loadMessages($file)