• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/connector/socialnetwork.php
  • Класс: BitrixLandingConnectorSocialNetwork
  • Вызов: SocialNetwork::getTabUrl
static function getTabUrl(int $groupId, ?string $pagePath = null, bool $generalPath = false): ?string
{
	static $groupPath = null;

	if ($groupPath === null)
	{
		$groupPath = Option::get('socialnetwork', 'group_path_template', '', SITE_ID);
		if (mb_substr($groupPath, -1) == '/')
		{
			$groupPath .= 'general/';
		}
	}

	if ($groupId && $groupPath)
	{
		$groupPath = str_replace('#group_id#', $groupId, $groupPath);
	}

	if ($generalPath)
	{
		return $groupPath;
	}

	if ($groupId && $groupPath)
	{
		$uri = new BitrixMainWebUri($groupPath);
		$uri->addParams([
			'tab' => self::SETTINGS_CODE_SHORT
		]);
		if ($pagePath)
		{
			$uri->addParams([
				'page' => $pagePath
			]);
		}
		return $uri->getUri();
	}

	return null;
}