function DoInstall() { global $APPLICATION, $USER, $step, $arSitesList; if ($USER->IsAdmin()) { $arSitesList = array(); $rsSites = CSite::GetList($by = "sort", $order = "desc", array()); while ($arSite = $rsSites->Fetch()) { $arSitesList[$arSite['ID']] = $arSite['NAME']; } $step = IntVal($step); if ($step < 2) { $APPLICATION->IncludeAdminFile(GetMessage("CONTENT_INCLUDER_MODULE_INSTALL_TITLE") . $this->MODULE_ID, $this->sModuleInstallFullPath . "step1.php"); } elseif ($step == 2) { RegisterModule($this->MODULE_ID); RegisterModuleDependences("main", "OnEndBufferContent", $this->MODULE_ID, '\\Bit\\Includer\\Handlers', "OnEndBufferContentHandler"); RegisterModuleDependences("fileman", "OnIncludeHTMLEditorScript", $this->MODULE_ID, '\\Bit\\Includer\\Handlers', "OnIncludeHTMLEditorScriptHandler"); $this->InstallFiles(); $sSiteId = array_key_exists($_REQUEST['site_id'], $arSitesList) ? $_REQUEST['site_id'] : SITE_ID; if ($_REQUEST['install_sample_iblock'] === "Y") { $this->createSampleIblock($sSiteId); } if ($_REQUEST['disable_new_editor'] === "Y") { COption::setOptionString("fileman", "use_editor_3", ""); } COption::SetOptionString("bit.includer", "include_jquery", $_REQUEST['include_jquery_for_component'] === "Y" ? "Y" : "N"); $APPLICATION->IncludeAdminFile(GetMessage("CONTENT_INCLUDER_MODULE_INSTALL_TITLE"), $this->sModuleInstallFullPath . "step2.php"); } } }