• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/component/base.php
  • Класс: BitrixIblockComponentBase
  • Вызов: Base::checkTemplateTheme
protected function checkTemplateTheme()
{
	$theme =& $this->arParams['TEMPLATE_THEME'];
	$theme = (string)$theme;

	if ($theme != '')
	{
		$theme = preg_replace('/[^a-zA-Z0-9_-()!]/', '', $theme);
		if ($theme === 'site')
		{
			$siteId = $this->getSiteId();
			$templateId = MainConfigOption::get('main', 'wizard_template_id', 'eshop_bootstrap', $siteId);
			$templateId = preg_match('/^eshop_adapt/', $templateId) ? 'eshop_adapt' : $templateId;
			$theme = MainConfigOption::get('main', 'wizard_'.$templateId.'_theme_id', 'blue', $siteId);
		}

		if ($theme != '')
		{
			$documentRoot = MainApplication::getDocumentRoot();
			$templateFolder = $this->getTemplate()->GetFolder();

			$themesFolder = new MainIODirectory($documentRoot.$templateFolder.'/themes/');

			if ($themesFolder->isExists())
			{
				$file = new MainIOFile($documentRoot.$templateFolder.'/themes/'.$theme.'/style.css');

				if (!$file->isExists())
				{
					$theme = '';
				}
			}
		}
	}

	if ($theme == '')
	{
		$theme = 'blue';
	}
}