/** * @deprecated Use LPA::ComponentChecker() */ public static function LPAComponentChecker(&$arParams, &$arPHPparams, $parentParamName = false) { LPA::ComponentChecker($arParams, $arPHPparams, $parentParamName); }
$bVarsFromForm = true; $bSessIDRefresh = true; } elseif ((CFileman::IsPHP($filesrc) || $isScriptExt) && !($USER->CanDoOperation('edit_php') || $limit_php_access)) { $strWarning = GetMessage("FILEMAN_FILEEDIT_CHANGE"); $bVarsFromForm = true; } else { if ($limit_php_access) { // ofp - original full path :) $ofp = $_SESSION['arOFP'][$ofp_id]; $ofp = $io->CombinePath("/", $ofp); $abs_ofp = $DOC_ROOT . $ofp; $f = $io->GetFile($abs_ofp); $old_filesrc_tmp = $f->GetContents(); $old_res = CFileman::ParseFileContent($old_filesrc_tmp, true); $old_filesrc = $old_res["CONTENT"]; $filesrc = LPA::Process($filesrc, $old_filesrc); } $res = CFileman::ParseFileContent($filesrc_tmp, true); $prolog = CFileman::SetTitle($res["PROLOG"], $title); for ($i = 0; $i <= $maxind; $i++) { if (strlen(Trim($_POST["CODE_" . $i])) > 0) { if ($_POST["CODE_" . $i] != $_POST["H_CODE_" . $i]) { $prolog = CFileman::SetProperty($prolog, Trim($_POST["H_CODE_" . $i]), ""); $prolog = CFileman::SetProperty($prolog, Trim($_POST["CODE_" . $i]), Trim($_POST["VALUE_" . $i])); } else { $prolog = CFileman::SetProperty($prolog, Trim($_POST["CODE_" . $i]), Trim($_POST["VALUE_" . $i])); } } else { $prolog = CFileman::SetProperty($prolog, Trim($_POST["H_CODE_" . $i]), ""); } }
// Id of the edited record $MAILING_ID = intval($MAILING_ID); $message = null; $bVarsFromForm = false; if ($_SERVER['REQUEST_METHOD'] == "POST" && ($save != "" || $apply != "") && $POST_RIGHT == "W" && check_bitrix_sessid()) { $arError = array(); $DAYS_OF_WEEK = empty($DAYS_OF_WEEK) ? '' : implode(',', $DAYS_OF_WEEK); if (!$isUserHavePhpAccess) { $MESSAGE_OLD = false; if ($ID > 0) { $mailingChainOld = \Bitrix\Sender\MailingChainTable::getRowById(array('ID' => $ID)); if ($mailingChainOld) { $MESSAGE_OLD = $mailingChainOld['MESSAGE']; } } $MESSAGE = LPA::Process($MESSAGE, $MESSAGE_OLD); } $arFields = array("MAILING_ID" => $MAILING_ID, "SUBJECT" => $SUBJECT, "EMAIL_FROM" => $EMAIL_FROM, "MESSAGE" => $MESSAGE, "TEMPLATE_TYPE" => $TEMPLATE_TYPE, "TEMPLATE_ID" => $TEMPLATE_ID, "PRIORITY" => $PRIORITY, "LINK_PARAMS" => $LINK_PARAMS, "CREATED_BY" => $USER->GetID(), "REITERATE" => "N", "AUTO_SEND_TIME" => "", "DAYS_OF_WEEK" => "", "DAYS_OF_MONTH" => "", "TIMES_OF_DAY" => ""); if (empty($MESSAGE) && isset($IS_TEMPLATE_LIST_SHOWN) && $IS_TEMPLATE_LIST_SHOWN == 'Y') { $arError[] = GetMessage("sender_chain_edit_error_select_template"); } switch ($SEND_TYPE) { case 'MANUAL': break; case 'TIME': if (empty($AUTO_SEND_TIME)) { $arError[] = GetMessage("sender_chain_edit_error_empty_time"); } if (!\Bitrix\Main\Type\DateTime::isCorrect($AUTO_SEND_TIME)) { $arError[] = GetMessage("sender_chain_edit_error_time_format"); } else {
CComponentUtil::PrepareVariables($arParams); //ReturnPHPStr $params = PHPParser::ReturnPHPStr2($arParams, $arParameters); $code .= "\t" . 'Array(' . $br . "\t" . $params . $br . "\t" . ')' . $br . ');'; } else { $code .= "\t" . 'Array()' . $br . ');'; } $code = '<?' . $code . '?>'; $new_content .= $code; } } } $new_content .= LPA::EncodePHPTags(substr($content_, $end)); $CONTENT = $new_content; } else { $CONTENT = LPA::EncodePHPTags($new_content); } // Get array of PHP scripts from original template src if (strlen($ID) > 0) { $templ = CSiteTemplate::GetByID($ID); if (!$templ->ExtractFields("str_")) { $strWarning = GetMessage('templ_create_err', array('#ID#' => $ID)); } } else { $strWarning = GetMessage('templ_create_err1'); } checkError($strWaring); $old_content = htmlspecialcharsback($str_CONTENT); $arPHP = PHPParser::ParseFile($old_content); $l = count($arPHP); $s1 = "";
$arEventMessageFile[] = $arFileFetch; } } } if ($bVarsFromForm) { $str_LID = $LID; $DB->InitTableVarsForEdit("b_event_message", "", "str_"); $str_ADDITIONAL_FIELD = $ADDITIONAL_FIELD; } $arMailSiteTemplate = array(); $mailSiteTemplateDb = CSiteTemplate::GetList(null, array('TYPE' => 'mail')); while ($mailSiteTemplate = $mailSiteTemplateDb->GetNext()) { $arMailSiteTemplate[] = $mailSiteTemplate; } if (!$isUserHavePhpAccess) { $str_MESSAGE = htmlspecialcharsbx(LPA::PrepareContent(htmlspecialcharsback($str_MESSAGE))); } if ($ID > 0 && $COPY_ID <= 0) { $APPLICATION->SetTitle(str_replace("#ID#", "{$ID}", GetMessage("EDIT_MESSAGE_TITLE"))); } else { $APPLICATION->SetTitle(GetMessage("NEW_MESSAGE_TITLE")); } require $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/prolog_admin_after.php"; ?> <form method="POST" action="<?php echo $APPLICATION->GetCurPage(); ?> " name="form1" enctype="multipart/form-data"> <?php echo bitrix_sessid_post(); ?>
$templFields = array(); if (strlen($ID) > 0 && $_REQUEST['edit'] != "N") { $templ = CSiteTemplate::GetByID($ID); if ($templFields = $templ->ExtractFields("str_")) { $bEdit = true; } } $aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("MAIN_TAB1"), "ICON" => "template_edit", "TITLE" => $isEditingMessageThemePage ? GetMessage("MAIN_TAB1_TITLE_THEME") : GetMessage("MAIN_TAB1_TITLE")), array("DIV" => "edit2", "TAB" => GetMessage("MAIN_TAB2"), "ICON" => "template_edit", "TITLE" => GetMessage("MAIN_TAB2_TITLE")), array("DIV" => "edit3", "TAB" => GetMessage("MAIN_TAB4"), "ICON" => "template_edit", "TITLE" => GetMessage("MAIN_TAB4_TITLE"))); if ($bEdit) { $aTabs[] = array("DIV" => "edit4", "TAB" => GetMessage("MAIN_TAB3"), "ICON" => "template_edit", "TITLE" => GetMessage("MAIN_TAB3_TITLE")); } $tabControl = new CAdminTabControl("tabControl", $aTabs); if ($_SERVER["REQUEST_METHOD"] == "POST" && ($_POST["save"] != '' || $_POST["apply"] != '') && check_bitrix_sessid() && ($edit_php || $lpa)) { $strError = ""; if ($lpa) { $CONTENT = LPA::Process($_POST["CONTENT"], htmlspecialcharsback($str_CONTENT)); //Add ..->ShowPanel() and WORK_AREA $ucont = strtolower($CONTENT); $sp = '<?$APPLICATION->ShowPanel();?>'; $body = '<body>'; $wa = '#WORK_AREA#'; $body_pos = strpos($ucont, $body); $sp_pos = strpos($ucont, strtolower($sp)); $wa_pos = strpos($ucont, strtolower($wa), $body_pos); if ($body_pos !== false && $sp_pos === false) { // Add $APPLICATION->ShowPanel(); $CONTENT = substr($CONTENT, 0, $body_pos + strlen($body)) . $sp . substr($CONTENT, $body_pos + strlen($body)); } if ($wa_pos === false) { $CONTENT .= $wa; }