• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/classes/general/log_destination.php
  • Класс: CSocNetLogDestination
  • Вызов: CSocNetLogDestination::GetLastSocnetGroup
static function GetLastSocnetGroup()
{
	$arLastSelected = CUserOptions::GetOption("socialnetwork", "log_destination", array());
	$arLastSelected = (
		is_array($arLastSelected)
		&& $arLastSelected['sonetgroups'] <> ''
		&& $arLastSelected['sonetgroups'] !== '"{}"'
			? array_reverse(CUtil::JsObjectToPhp($arLastSelected['sonetgroups']))
			: array()
	);

	$count = 0;
	$arSocnetGroups = Array();
	foreach ($arLastSelected as $sgId)
	{
		if ($count <= 4)
		{
			$count++;
		}
		else
		{
			break;
		}

		$arSocnetGroups[$sgId] = $sgId;
	}
	return array_reverse($arSocnetGroups);
}