• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/wizard_site.php
  • Класс: CWizard
  • Вызов: CWizard::__SetTemplate
function __SetTemplate()
{
	if (!array_key_exists("TEMPLATES", $this->arDescription) || !is_array($this->arDescription["TEMPLATES"]))
		return;

	foreach ($this->arDescription["TEMPLATES"] as $arTemplate)
	{
		if($arTemplate["SCRIPT"]=="wizard_sol")
		{
			$lang = LANGUAGE_ID;
			$wizardPath = $_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main";
			$relativePath = "install/wizard_sol/template.php";

			if ($lang != "en" && $lang != "ru")
			{
				if (file_exists(($fname = $wizardPath."/lang/".LangSubst($lang)."/".$relativePath)))
					__IncludeLang($fname, false, true);
			}

			if (file_exists(($fname = $wizardPath."/lang/".$lang."/".$relativePath)))
				__IncludeLang($fname, false, true);

			include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/install/wizard_sol/template.php");

			$stepID = ($arTemplate["STEP"] ?? null);
			$this->wizard->SetTemplate(new WizardTemplate, $stepID);
			$this->wizard->DisableAdminTemplate();
		}
		else
		{
			if (!isset($arTemplate["SCRIPT"]) || !isset($arTemplate["CLASS"]))
				continue;

			$pathToFile = $_SERVER["DOCUMENT_ROOT"].$this->path."/".$arTemplate["SCRIPT"];

			if (!is_file($pathToFile))
				continue;

			$this->IncludeWizardLang($arTemplate["SCRIPT"]);

			include_once($pathToFile);

			if (!class_exists($arTemplate["CLASS"]))
				continue;

			$stepID = ($arTemplate["STEP"] ?? null);
			$this->wizard->SetTemplate(new $arTemplate["CLASS"], $stepID);
			$this->wizard->DisableAdminTemplate();
		}
	}

}