- Модуль: socialnetwork
- Путь к файлу: ~/bitrix/modules/socialnetwork/classes/general/functions.php
- Класс: CSocNetAllowed
- Вызов: CSocNetAllowed::addAllowedFeature
static function addAllowedFeature($strFeatureCode, $arFeature)
{
$strFeatureCode = trim($strFeatureCode);
if (
$strFeatureCode == ''
|| !is_array($arFeature)
)
{
return false;
}
if (
!CBXFeatures::IsFeatureEnabled("Workgroups")
&& array_key_exists("subscribe_events", $arFeature)
)
{
foreach ($arFeature["subscribe_events"] as $event_id_tmp => $arEventTmp)
{
if (
array_key_exists("ENTITIES", $arEventTmp)
&& array_key_exists(SONET_SUBSCRIBE_ENTITY_GROUP, $arEventTmp["ENTITIES"])
)
{
unset($arFeature["subscribe_events"][$event_id_tmp]["ENTITIES"][SONET_SUBSCRIBE_ENTITY_GROUP]);
}
}
}
if (!array_key_exists($strFeatureCode, self::$arAllowedFeatures))
{
self::$arAllowedFeatures[$strFeatureCode] = $arFeature;
}
else
{
if (
array_key_exists("operations", $arFeature)
&& is_array($arFeature["operations"])
)
{
if (!array_key_exists("operations", self::$arAllowedFeatures[$strFeatureCode]))
{
self::$arAllowedFeatures[$strFeatureCode]["operations"] = array();
}
foreach ($arFeature["operations"] as $strOpCode => $arOperation)
{
if (is_array($arOperation))
{
if (!array_key_exists($strOpCode, self::$arAllowedFeatures[$strFeatureCode]["operations"]))
{
self::$arAllowedFeatures[$strFeatureCode]["operations"][$strOpCode] = array();
}
foreach ($arOperation as $key => $value)
{
self::$arAllowedFeatures[$strFeatureCode]["operations"][$strOpCode][$key] = $value;
}
}
}
}
if (
array_key_exists("subscribe_events", $arFeature)
&& is_array($arFeature["subscribe_events"])
)
{
if (!array_key_exists("subscribe_events", self::$arAllowedFeatures[$strFeatureCode]))
{
self::$arAllowedFeatures[$strFeatureCode]["subscribe_events"] = array();
}
foreach ($arFeature["subscribe_events"] as $strEventCode => $arEvent)
{
if (is_array($arEvent))
{
self::$arAllowedFeatures[$strFeatureCode]["subscribe_events"][$strEventCode] = $arEvent;
}
}
}
}
return true;
}