Your IP : 216.73.216.86


Current Path : /var/www/homesaver/www/bitrix/modules/ram.calc/install/
Upload File :
Current File : /var/www/homesaver/www/bitrix/modules/ram.calc/install/events.php

<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();

$dbEvent = CEventMessage::GetList($b="ID", $order="ASC", Array("EVENT_NAME" => "RAM_CALC_REQUEST"));
if (!($dbEvent->Fetch()))
{
	$langs = CLanguage::GetList(($b=""), ($o=""));
	while ($lang = $langs->Fetch())
	{
		$lid = $lang["LID"];
		IncludeModuleLangFile(__FILE__, $lid);

		$et = new CEventType;
		$et->Add(Array(
			"LID" => $lid,
			"EVENT_NAME" => "RAM_CALC_REQUEST",
			"NAME" => GetMessage("RAM_CALC_REQUEST_NAME"),
			"DESCRIPTION" => GetMessage("RAM_CALC_REQUEST_DESC"),
		));
		
		$arSites = Array();
		$sites = CSite::GetList(($b=""), ($o=""), Array("LANGUAGE_ID"=>$lid));
		while ($site = $sites->Fetch()) $arSites[] = $site["LID"];

		if (count($arSites) > 0)
		{
			$emess = new CEventMessage;
			$emess->Add(Array(
				"ACTIVE" => "Y",
				"EVENT_NAME" => "RAM_CALC_REQUEST",
				"LID" => $arSites,
				"LANGUAGE_ID" => $lang["LID"],
				"EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#",
				"EMAIL_TO" => "#EMAIL#",
				"BCC" => "",
				"SUBJECT" => GetMessage("RAM_CALC_REQUEST_SUBJECT"),
				"MESSAGE" => GetMessage("RAM_CALC_REQUEST_MESSAGE"),
				"BODY_TYPE" => "text",
			));
		}
	}
}


?>