• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/classes/general/functions.php
  • Класс: CSocNetAllowed
  • Вызов: CSocNetAllowed::addAllowedLogEvent
static function addAllowedLogEvent($strEventCode, $arLogEvent)
{
	$strEventCode = trim($strEventCode);

	if (
		$strEventCode == ''
		|| array_key_exists($strEventCode, self::$arAllowedLogEvents)
		|| !is_array($arLogEvent)
	)
	{
		return false;
	}
	
	if (!CBXFeatures::IsFeatureEnabled("Workgroups"))
	{
		if ($strEventCode == "system_groups")
		{
			return false;
		}

		if (
			array_key_exists("ENTITIES", $arLogEvent)
			&& array_key_exists(SONET_SUBSCRIBE_ENTITY_GROUP, $arLogEvent["ENTITIES"])
		)
		{
			unset($arLogEvent["ENTITIES"][SONET_SUBSCRIBE_ENTITY_GROUP]);
		}

		if ($strEventCode == "system")
		{
			foreach($arLogEvent["FULL_SET"] as $i => $event_id_tmp)
			{
				if ($event_id_tmp == "system_groups")
				{
					unset($arLogEvent["FULL_SET"][$i]);
				}
			}
		}
	}

	if (!CBXFeatures::IsFeatureEnabled("Friends"))
	{
		if ($strEventCode == "system_friends")
		{
			return false;
		}

		if ($strEventCode == "system")
		{
			foreach($arLogEvent["FULL_SET"] as $i => $event_id_tmp)
			{
				if ($event_id_tmp == "system_friends")
				{
					unset($arLogEvent["FULL_SET"][$i]);
				}
			}
		}
	}

	self::$arAllowedLogEvents[$strEventCode] = $arLogEvent;

	return true;
}