• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/connector/socialnetwork.php
  • Класс: BitrixLandingConnectorSocialNetwork
  • Вызов: SocialNetwork::onFillSocNetMenu
static function onFillSocNetMenu(&$result)
{
	// allowed only for groups
	if (!isset($result['Group']['ID']))
	{
		return;
	}
	if (!isset($result['Urls']['View']))
	{
		return;
	}

	// is enabled in features or not
	if (!empty($result['ActiveFeatures']))
	{
		$enable = array_key_exists(
			self::SETTINGS_CODE,
			$result['ActiveFeatures']
		);
	}
	else
	{
		$enable = false;
	}

	if ($enable)
	{
		$url = self::getSocNetMenuUrl($result['Group']['ID']);
		if (!$url)
		{
			$enable = false;
		}
		$title = self::getSocNetMenuTitle($result['Group']['ID']);
		if ($title !== '')
		{
			$title = ' - ' . $title;
		}
	}
	else
	{
		$url = '';
		$title = '';
	}

	// build menu params
	$result['CanView'][self::SETTINGS_CODE] = $enable;
	$result['Title'][self::SETTINGS_CODE] = Loc::getMessage('LANDING_CONNECTOR_SN_TITLE') . $title;
	$result['Urls'][self::SETTINGS_CODE] = $url;
}