if ($arParams["CACHE_TYPE"] == "Y" || $arParams["CACHE_TYPE"] == "A" && COption::GetOptionString("main", "component_cache_on", "Y") == "Y") { $arParams["CACHE_TIME"] = intval($arParams["CACHE_TIME"]); } else { $arParams["CACHE_TIME"] = 0; } $arParams["SET_TITLE"] = $arParams["SET_TITLE"] == "N" ? "N" : "Y"; /******************************************************************** /Input params ********************************************************************/ $arResult["MESSAGE"] = array(); if ($mode != "new") { if (!CForumPrivateMessage::CheckPermissions($arParams["MID"])) { ShowError(GetMessage("F_ACCESS_DENIED")); return false; } $db_res = CForumPrivateMessage::GetById($arParams["MID"]); if ($db_res && ($res = $db_res->GetNext())) { $arResult["MESSAGE"] = $res; } else { ShowError(GetMessage("F_MESSAGE_NOT_FOUND")); return false; } } /******************************************************************** Default params ********************************************************************/ $bVarsFromForm = false; $arResult["CURRENT_PAGE"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PM_EDIT"], array("FID" => $arParams["FID"], "MID" => $arParams["MID"], "mode" => $mode, "UID" => $arParams["UID"])); $arResult["pm_list"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PM_LIST"], array("FID" => $arParams["FID"])); $arResult["pm_search"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PM_SEARCH"], array()); $arResult["pm_search_for_js"] = ForumAddPageParams(CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_PM_SEARCH"], array()), array("search_by_login" => "#LOGIN#"), false, false);