$dbSites = CSite::GetList($b = "", $o = "", array("ACTIVE" => "Y")); while ($arSite = $dbSites->Fetch()) { //BXClearCache(True, "/".$arSite["LID"]."/blog/"); foreach ($arType as $type) { if (IntVal($arPaths[$arSite["LID"]][$type]) > 0) { if (strlen(${"SITE_PATH_" . $arSite["LID"] . "_" . $type}) > 0) { if ($arPaths[$arSite["LID"]][$type]["PATH"] != ${"SITE_PATH_" . $arSite["LID"] . "_" . $type}) { $affectedRows++; } CSitePath::Update($arPaths[$arSite["LID"]][$type]["ID"], array("PATH" => ${"SITE_PATH_" . $arSite["LID"] . "_" . $type}, "TYPE" => $type)); } else { CSitePath::Delete($arPaths[$arSite["LID"]][$type]["ID"]); $affectedRows++; } } else { CSitePath::Add(array("SITE_ID" => $arSite["LID"], "PATH" => ${"SITE_PATH_" . $arSite["LID"] . "_" . $type}, "TYPE" => $type)); $affectedRows++; } } unset($arPaths[$arSite["LID"]]); } if ($affectedRows && IsModuleInstalled('search') && CModule::IncludeModule("search")) { CSearch::ReindexModule("learning"); } foreach ($arPaths as $key) { foreach ($key as $val) { CSitePath::Delete($val); } } } ?>
return; } // paths templates for correct indexing $urls = array(array(WIZARD_SITE_DIR . 'services/learning/course.php?COURSE_ID=#COURSE_ID#&INDEX=Y', 'C'), array(WIZARD_SITE_DIR . 'services/learning/course.php?COURSE_ID=#COURSE_ID#&CHAPTER_ID=#CHAPTER_ID#', 'H'), array(WIZARD_SITE_DIR . 'services/learning/course.php?COURSE_ID=#COURSE_ID#&LESSON_ID=#LESSON_ID#', 'L')); // If method not exists => new data model used if (!method_exists('CCourse', 'SetPermission')) { $urls[] = array(WIZARD_SITE_DIR . 'services/learning/course.php?LESSON_PATH=#LESSON_PATH#', 'U'); } $dbPath = CSitePath::GetList(array(), array("SITE_ID" => WIZARD_SITE_ID)); while ($arPath = $dbPath->Fetch()) { unset($GLOBALS["LEARNING_SITE_PATH"]["LEARNING_SITE_PATH1_CACHE_" . $arPath["SITE_ID"]]); unset($GLOBALS["LEARNING_SITE_PATH"]["LEARNING_SITE_PATH_CACHE_" . $arPath["ID"]]); $DB->Query("DELETE FROM b_learn_site_path WHERE ID = '" . $arPath["ID"] . "'", true); } foreach ($urls as $url) { CSitePath::Add(array("SITE_ID" => WIZARD_SITE_ID, "PATH" => $url[0], "TYPE" => $url[1])); } $arCourses = array("new_employee", "portal"); $arCoursesSite = array("new_employee_" . WIZARD_SITE_ID, "portal_" . WIZARD_SITE_ID); if (!WIZARD_NEW_2011 && WIZARD_SITE_ID == 's1') { $arCoursesSite = array("new_employee", "portal"); } foreach ($arCourses as $key => $courseCode) { try { $dbResult = CCourse::GetList(array(), array("CODE" => $arCoursesSite[$key])); $pathToService = WIZARD_SERVICE_ABSOLUTE_PATH; if (!($arCourse = $dbResult->Fetch())) { $pathToCourse = WIZARD_SERVICE_RELATIVE_PATH . "/" . LANGUAGE_ID . "/" . $courseCode . "/"; $package = new CCourseImport($pathToCourse, array(WIZARD_SITE_ID)); if (strlen($package->LAST_ERROR) > 0) { return;