function getSitesByMessage($ID) { $sites = array(); $eventMessage = new CEventMessage(); $getSites = $eventMessage->GetSite($ID); while ($site = $getSites->Fetch()) { $sites[] = $site['WIZARD_SITE_ID']; } return $sites; }
function GetLang($event_message_id) { return CEventMessage::GetSite($event_message_id); }
if (!$res) { $bVarsFromForm = true; } else { $em = new CEventMessage(); if ($_POST["SITE_MESSAGE_LINK"] == "C" && $_POST["SITE_MESSAGE_LINK_C_SITE"] != '') { $db_msg = CEventMessage::GetList($o = "", $b = "", array("SITE_ID" => $_POST["SITE_MESSAGE_LINK_C_SITE"])); while ($ar_msg = $db_msg->Fetch()) { unset($ar_msg["TIMESTAMP_X"]); $ar_msg["LID"] = $LID; $em->Add($ar_msg); } } elseif ($_POST["SITE_MESSAGE_LINK"] == "E" && $_POST["SITE_MESSAGE_LINK_E_SITE"] != '') { $db_msg = CEventMessage::GetList($o = "", $b = "", array("SITE_ID" => $_POST["SITE_MESSAGE_LINK_E_SITE"])); while ($ar_msg = $db_msg->Fetch()) { $msg_id = $ar_msg["ID"]; $db_msg_sites = CEventMessage::GetSite($ar_msg["ID"]); $ar_msg = array("NAME" => $ar_msg["NAME"], "LID" => array($LID)); while ($ar_msg_sites = $db_msg_sites->Fetch()) { $ar_msg["LID"][] = $ar_msg_sites["SITE_ID"]; } $em->Update($msg_id, $ar_msg); } } if ($bNew && $_POST["START_SITE_WIZARD"] == "Y") { $rsSite = CSite::GetList($by = "sort", $order = "asc", array("ID" => $LID)); $arSite = $rsSite->GetNext(); $siteDir = "/" . ltrim(rtrim($arSite["DIR"], "/") . "/", "/"); $p = CSite::GetSiteDocRoot($LID) . $siteDir; CheckDirPath($p); $indexContent = '<' . '?' . 'define("B_PROLOG_INCLUDED", true);' . 'define("WIZARD_DEFAULT_SITE_ID", "' . $LID . '");' . 'define("WIZARD_DEFAULT_TONLY", true);' . 'define("PRE_LANGUAGE_ID","' . $arSite["LANGUAGE_ID"] . '");' . 'define("PRE_INSTALL_CHARSET","' . $arSite["CHARSET"] . '");' . 'include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/install/wizard/wizard.php");' . '?' . '>'; $handler = fopen($p . "index.php", "wb");