• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/lib/contactcenter.php
  • Класс: BitrixIntranetContactCenter
  • Вызов: ContactCenter::getAdsFormListItems
private function getAdsFormListItems($filter = array())
{

	$formsDb = BitrixCrmWebFormInternalsFormTable::query()
		->setSelect(["ID"])
		->setCacheTtl(300)
		->exec();

	if ($formsDb->getSelectedRowsCount() === 0)
	{
		return [];
	}

	$codeMap = BitrixCrmAdsAdsForm::getAdsIconMap();
	$cisCheck = $this->cisCheck() && (!isset($filter["CHECK_REGION"]) || $filter["CHECK_REGION"] !== "N");
	$isRuPortal = $this->isRuZone() && (!isset($filter["CHECK_REGION"]) || $filter["CHECK_REGION"] !== "N");

	$itemsList = [];
	foreach (BitrixCrmAdsAdsForm::getServiceTypes() as $type)
	{
		if ($cisCheck && $type === BitrixSeoLeadAdsService::TYPE_VKONTAKTE)
		{
			continue;
		}

		if ($isRuPortal && $type === BitrixSeoLeadAdsService::TYPE_FACEBOOK)
		{
			continue;
		}

		$linkedFormsIds = BitrixCrmAdsAdsForm::getLinkedForms($type);
		$selected = count($linkedFormsIds) > 0;
		$typeCaption = Loc::getMessage("CONTACT_CENTER_ADS_FORM_".mb_strtoupper($type));

		$itemsList["{$type}ads"] = [
			"NAME" => $typeCaption?: BitrixCrmAdsAdsForm::getServiceTypeName($type),
			"SELECTED" => $selected,
			"LOGO_CLASS" => "ui-icon ui-icon-service-{$codeMap[$type]}"
		];
	}

	return $itemsList;
}