<?php if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die; } require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/extranet/classes/general/wizard_utils.php"; $arTemplates = array(); $templatesPath = CWizardUtil::GetRepositoryPath() . CWizardUtil::MakeWizardPath("bitrix:extranet") . "/site/templates"; $arTemplates = CExtranetWizardServices::GetTemplates($templatesPath); $arSteps = array("WelcomeStep"); if (!empty($arTemplates)) { $arSteps[] = "SelectTemplateStep"; $arSteps[] = "SelectThemeStep"; } $arSteps[] = "SiteSettingsStep"; $arSteps[] = "DataInstallStep"; $arSteps[] = "FinishStep"; $arWizardDescription = array("NAME" => GetMessage("EXTRANET_WIZARD_NAME"), "DESCRIPTION" => GetMessage("EXTRANET_WIZARD_DESC"), "VERSION" => "1.0.0", "START_TYPE" => "WINDOW", "TEMPLATES" => array(array("SCRIPT" => "scripts/template.php", "CLASS" => "ExtranetWizardTemplate")), "STEPS" => $arSteps);
function InstallService($serviceID, $serviceStage) { $wizard =& $this->GetWizard(); $siteID = COption::GetOptionString("main", "wizard_site_code_extranet"); $siteFolder = COption::GetOptionString("main", "wizard_site_folder_extranet"); $siteName = COption::GetOptionString("main", "wizard_site_name_extranet"); if (COption::GetOptionString("main", "wizard_extranet_rerun") == "Y") { define("WIZARD_IS_RERUN", true); } if (WIZARD_IS_RERUN === true) { $rsSites = CSite::GetByID(COption::GetOptionString("extranet", "extranet_site")); if ($arSite = $rsSites->Fetch()) { define("WIZARD_SITE_ID", $arSite["ID"]); define("WIZARD_SITE_DIR", $arSite["DIR"]); define("WIZARD_SITE_NAME", $siteName); define("WIZARD_SITE_PATH", $_SERVER["DOCUMENT_ROOT"] . $arSite["DIR"]); $bFound = true; } } if (!$bFound) { define("WIZARD_SITE_ID", $siteID); define("WIZARD_SITE_DIR", $siteFolder); define("WIZARD_SITE_NAME", $siteName); define("WIZARD_SITE_PATH", $_SERVER["DOCUMENT_ROOT"] . $siteFolder); } $wizardPath = $wizard->GetPath(); define("WIZARD_RELATIVE_PATH", $wizardPath); define("WIZARD_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . $wizardPath); $templatesPath = ""; $templatesPath = CExtranetWizardServices::GetTemplatesPath(WIZARD_RELATIVE_PATH . "/site"); $arTemplates = CExtranetWizardServices::GetTemplates($templatesPath); $templateID = $wizard->GetVar("templateID"); if ($templateID == "current_intranet_template") { $rsDefSiteTemplates = CSite::GetTemplateList(CSite::GetDefSite()); while ($arDefSiteTemplates = $rsDefSiteTemplates->Fetch()) { if ($arDefSiteTemplates["CONDITION"] == "") { $templateID = $arDefSiteTemplates["TEMPLATE"]; break; } } } define("WIZARD_TEMPLATE_ID", $templateID); if (in_array($templateID, array("bright_extranet", "classic_extranet", "modern_extranet"))) { define("WIZARD_TEMPLATE_RELATIVE_PATH", $templatesPath . "/" . WIZARD_TEMPLATE_ID); define("WIZARD_TEMPLATE_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . WIZARD_TEMPLATE_RELATIVE_PATH); $themeID = $wizard->GetVar($templateID . "_themeID"); $arThemes = CExtranetWizardServices::GetThemes(WIZARD_TEMPLATE_RELATIVE_PATH . "/themes"); define("WIZARD_THEME_ID", $themeID); define("WIZARD_THEME_RELATIVE_PATH", WIZARD_TEMPLATE_RELATIVE_PATH . "/themes/" . WIZARD_THEME_ID); define("WIZARD_THEME_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . WIZARD_THEME_RELATIVE_PATH); } $servicePath = WIZARD_RELATIVE_PATH . "/site/services/" . $serviceID; define("WIZARD_SERVICE_RELATIVE_PATH", $servicePath); define("WIZARD_SERVICE_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . $servicePath); $b24ToCp = file_exists(WIZARD_SITE_PATH . ".superleft.menu.php") ? true : false; define("WIZARD_B24_TO_CP", $b24ToCp); define("WIZARD_SITE_LOGO", intval($wizard->GetVar("siteLogo"))); if (!file_exists(WIZARD_SERVICE_ABSOLUTE_PATH . "/" . $serviceStage)) { return false; } if (LANGUAGE_ID != "en" && LANGUAGE_ID != "ru") { if (file_exists(WIZARD_SERVICE_ABSOLUTE_PATH . "/lang/en/" . $serviceStage)) { __IncludeLang(WIZARD_SERVICE_ABSOLUTE_PATH . "/lang/en/" . $serviceStage); } } $dbGroups = CGroup::GetList($by = "id", $order = "asc", array("ACTIVE" => "Y")); while ($arGroup = $dbGroups->Fetch()) { define("WIZARD_" . $arGroup["STRING_ID"] . "_GROUP", $arGroup["ID"]); } if (file_exists(WIZARD_SERVICE_ABSOLUTE_PATH . "/lang/" . LANGUAGE_ID . "/" . $serviceStage)) { __IncludeLang(WIZARD_SERVICE_ABSOLUTE_PATH . "/lang/" . LANGUAGE_ID . "/" . $serviceStage); } @set_time_limit(3600); global $DB, $DBType, $APPLICATION, $USER, $CACHE_MANAGER; include WIZARD_SERVICE_ABSOLUTE_PATH . "/" . $serviceStage; }