require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php"); IncludeModuleLangFile(__FILE__); $popupWindow = new CJSPopup(GetMessage("PAGE_PROP_WINDOW_TITLE"), array("SUFFIX"=>($_GET['subdialog'] == 'Y'? 'subdialog':''))); if (IsModuleInstalled("fileman")) { if (!$USER->CanDoOperation('fileman_admin_files') && !$USER->CanDoOperation('fileman_edit_existent_files')) $popupWindow->ShowError(GetMessage("PAGE_PROP_ACCESS_DENIED")); } $io = CBXVirtualIo::GetInstance(); //Page path $path = "/"; if (isset($_REQUEST["path"]) && $_REQUEST["path"] <> '') $path = $io->CombinePath("/", $_REQUEST["path"]); //Lang if (!isset($_REQUEST["lang"]) || $_REQUEST["lang"] == '') $lang = LANGUAGE_ID; //BackUrl $back_url = ($_REQUEST["back_url"] ?? ""); //Site ID $site = SITE_ID; if (isset($_REQUEST["site"]) && $_REQUEST["site"] <> '') { $obSite = CSite::GetByID($_REQUEST["site"]); if ($arSite = $obSite->Fetch()) $site = $_REQUEST["site"]; } $documentRoot = CSite::GetSiteDocRoot($site); $absoluteFilePath = $documentRoot.$path; //Check permissions if (!$io->FileExists($absoluteFilePath) && !$io->DirectoryExists($absoluteFilePath)) $popupWindow->ShowError(GetMessage("PAGE_PROP_FILE_NOT_FOUND")." (".htmlspecialcharsbx($path).")"); elseif (!$USER->CanDoFileOperation('fm_edit_existent_file',Array($site, $path))) $popupWindow->ShowError(GetMessage("PAGE_PROP_ACCESS_DENIED")); $f = $io->GetFile($absoluteFilePath); $fileContent = $f->GetContents(); $strWarning = ""; //Save page settings if ($_SERVER["REQUEST_METHOD"] == "POST" && !check_bitrix_sessid()) { CUtil::JSPostUnescape(); $strWarning = GetMessage("MAIN_SESSION_EXPIRED"); } elseif ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_REQUEST["save"])) { CUtil::JSPostUnescape(); //Title if (isset($_POST["pageTitle"]) && $_POST["pageTitle"] <> '') $fileContent = SetPrologTitle($fileContent, $_POST["pageTitle"]); //Properties if (isset($_POST["PROPERTY"]) && is_array($_POST["PROPERTY"])) { foreach ($_POST["PROPERTY"] as $arProperty) { $arProperty["CODE"] = (isset($arProperty["CODE"]) ? trim($arProperty["CODE"]) : ""); $arProperty["VALUE"] = (isset($arProperty["VALUE"]) ? trim($arProperty["VALUE"]) : ""); if (preg_match("/[a-zA-Z_-~]+/i", $arProperty["CODE"])) $fileContent = SetPrologProperty($fileContent, $arProperty["CODE"], $arProperty["VALUE"]); } } //Tags if (isset($_POST["TAGS"]) && IsModuleInstalled("search")) $fileContent = SetPrologProperty($fileContent, COption::GetOptionString("search", "page_tag_property","tags"), $_POST["TAGS"]); $f = $io->GetFile($absoluteFilePath); $arUndoParams = array( 'module' => 'fileman', 'undoType' => 'edit_file', 'undoHandler' => 'CFileman::UndoEditFile', 'arContent' => array( 'absPath' => $absoluteFilePath, 'content' => $f->GetContents() ) ); $success = $APPLICATION->SaveFileContent($absoluteFilePath, $fileContent); if ($success === false && ($exception = $APPLICATION->GetException())) $strWarning = $exception->msg; else { CUndo::ShowUndoMessage(CUndo::Add($arUndoParams)); if (isset($_GET['subdialog']) && $_GET['subdialog'] == 'Y') echo ""; $popupWindow->Close($bReload=($_GET['subdialog'] <> 'Y'), $back_url); die(); } } //Properties from fileman settings $arFilemanProperties = Array(); if (CModule::IncludeModule("fileman") && is_callable(Array("CFileMan", "GetPropstypes"))) $arFilemanProperties = CFileMan::GetPropstypes($site); //Properties from page $arDirProperties = Array(); if ($strWarning != "") { //Restore post values if error occured $pageTitle = (isset($_POST["pageTitle"]) && $_POST["pageTitle"] <> '' ? $_POST["pageTitle"] : ""); if (isset($_POST["PROPERTY"]) && is_array($_POST["PROPERTY"])) { foreach ($_POST["PROPERTY"] as $arProperty) { if (isset($arProperty["VALUE"]) && $arProperty["VALUE"] <> '') $arDirProperties[$arProperty["CODE"]] = $arProperty["VALUE"]; } } } else { $arPageSlice = ParseFileContent($fileContent); $arDirProperties = $arPageSlice["PROPERTIES"]; $pageTitle = $arPageSlice["TITLE"]; } //All properties for file. Includes properties from root folders $arInheritProperties = $APPLICATION->GetDirPropertyList(Array($site, $path)); if ($arInheritProperties === false) $arInheritProperties = Array(); //Tags if (IsModuleInstalled("search")) { $tagPropertyCode = COption::GetOptionString("search", "page_tag_property","tags"); $tagPropertyValue = ""; if ($strWarning != "" && isset($_POST["TAGS"]) && $_POST["TAGS"] <> '') //Restore post value if error occured $tagPropertyValue = $_POST["TAGS"]; elseif (array_key_exists($tagPropertyCode, $arDirProperties)) $tagPropertyValue = $arDirProperties[$tagPropertyCode]; unset($arFilemanProperties[$tagPropertyCode]); unset($arDirProperties[$tagPropertyCode]); unset($arInheritProperties[mb_strtoupper($tagPropertyCode)]); } //Delete equal properties $arGlobalProperties = Array(); foreach ($arFilemanProperties as $propertyCode => $propertyDesc) { if (array_key_exists($propertyCode, $arDirProperties)) $arGlobalProperties[$propertyCode] = $arDirProperties[$propertyCode]; else $arGlobalProperties[$propertyCode] = ""; unset($arDirProperties[$propertyCode]); unset($arInheritProperties[mb_strtoupper($propertyCode)]); } foreach ($arDirProperties as $propertyCode => $propertyValue) unset($arInheritProperties[mb_strtoupper($propertyCode)]); ?> //HTML Output $popupWindow->ShowTitlebar(GetMessage("PAGE_PROP_WINDOW_TITLE")); $popupWindow->StartDescription("bx-property-page"); if ($strWarning != "") $popupWindow->ShowValidationError($strWarning); ?>
Fatal error: Uncaught Error: Call to undefined function GetMessage() in D:\ktt\ttepla.com\public_html\bitrix\modules\main\public\file_property.php:184
Stack trace:
#0 {main}
thrown in D:\ktt\ttepla.com\public_html\bitrix\modules\main\public\file_property.php on line 184