• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/main.php
  • Класс: CAllMain
  • Вызов: CAllMain::GetTemplatePath
public function GetTemplatePath($rel_path)
{
	if(mb_substr($rel_path, 0, 1) != "/")
	{
		if(defined("SITE_TEMPLATE_ID"))
		{
			$path = getLocalPath("templates/".SITE_TEMPLATE_ID."/".$rel_path, BX_PERSONAL_ROOT);
			if($path !== false)
				return $path;
		}

		$path = getLocalPath("templates/.default/".$rel_path, BX_PERSONAL_ROOT);
		if($path !== false)
			return $path;

		//we don't use /local folder for components 1.0
		$module_id = mb_substr($rel_path, 0, mb_strpos($rel_path, "/"));
		if($module_id <> '')
		{
			$path = "/bitrix/modules/".$module_id."/install/templates/".$rel_path;
			if(file_exists($_SERVER["DOCUMENT_ROOT"].$path))
				return $path;
		}

		return false;
	}

	return $rel_path;
}