• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/site.php
  • Класс: CAllSite
  • Вызов: CAllSite::GetNameFormat
static function GetNameFormat($dummy = null, $site_id = "")
{
	static $siteFormat = [];
	$format = '';

	$context = MainContext::getCurrent();

	if ($site_id == "" || $context->getSite() == $site_id)
	{
		// from current site or language
		$format = $context->getCulture()->getFormatName();
	}

	//site value
	if ($format == "")
	{
		if (!isset($siteFormat[$site_id]))
		{
			$db_res = CSite::GetByID($site_id);
			if ($res = $db_res->Fetch())
			{
				$format = $res["FORMAT_NAME"];
				$siteFormat[$site_id] = $format;
			}
		}
		else
		{
			$format = $siteFormat[$site_id];
		}
	}

	//if not found - trying to get value for the language
	if ($format == "")
	{
		$format = $context->getCulture()->getFormatName();
	}

	//if not found - trying to get default values
	if ($format == "")
	{
		$format = self::GetDefaultNameFormat();
	}

	$format = str_replace(array("#NOBR#","#/NOBR#"), "", $format);

	return $format;
}