• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/lib/contactcenter.php
  • Класс: BitrixIntranetContactCenter
  • Вызов: ContactCenter::getDynamicItems
private function getDynamicItems()
{
	$items = [];
	$userLang = LANGUAGE_ID ?? 'en';
	$cache = BitrixMainDataCache::createInstance();
	$cache_time = 86400;
	$cache_id = 'ccActionsRest' . $userLang;
	$cache_path = 'restItems';

	if ($cache_time > 0 && $cache->InitCache($cache_time, $cache_id, $cache_path))
	{
		$res = $cache->GetVars();

		if (is_array($res) && (count($res) > 0))
		{
			$items = $res;
		}
	}

	if (count($items) <= 0)
	{
		$marketplace = new BitrixRestMarketplaceMarketplaceActions();
		$restItems = $marketplace->getItems('contactcenter', $userLang);

		if (!empty($restItems) && count($restItems) > 0)
		{
			$items = $this->prepareRestItems($restItems);

			if (!is_null($items))
			{
				$cache->StartDataCache($cache_time, $cache_id, $cache_path);
				$cache->EndDataCache($items);
			}
		}

	}

	return $items;
}