예제 #1
0
}
if ($REQUEST_METHOD == "POST" && strlen($Update) > 0 && $isAdmin && check_bitrix_sessid()) {
    if (StrLen($CONDITION) <= 0) {
        $aMsg[] = array("id" => "CONDITION", "text" => GetMessage("MURL_NO_USL"));
    }
    if (empty($aMsg)) {
        if ($CONDITION_OLD != $CONDITION) {
            $arResult = CUrlRewriter::GetList(array("SITE_ID" => $site_id, "CONDITION" => $CONDITION));
            if (count($arResult) > 0) {
                $aMsg[] = array("id" => "CONDITION", "text" => str_replace("#CONDITION#", htmlspecialcharsbx($CONDITION), GetMessage("MURL_DUPL_CONDITION")));
            }
        }
    }
    if (empty($aMsg)) {
        if (StrLen($CONDITION_OLD) > 0) {
            CUrlRewriter::Update(array("SITE_ID" => $site_id, "CONDITION" => $CONDITION_OLD), array("CONDITION" => $CONDITION, "ID" => $ID, "PATH" => $FILE_PATH, "RULE" => $RULE));
        } else {
            CUrlRewriter::Add(array("SITE_ID" => $site_id, "CONDITION" => $CONDITION, "ID" => $ID, "PATH" => $FILE_PATH, "RULE" => $RULE));
        }
    }
    if (empty($aMsg)) {
        if (strlen($apply) <= 0) {
            LocalRedirect("/bitrix/admin/urlrewrite_list.php?lang=" . LANG . "&filter_site_id=" . UrlEncode($site_id) . "&" . GetFilterParams("filter_", false));
        }
    } else {
        $message = new CAdminMessage(GetMessage("SAE_ERROR"), new CAdminException($aMsg));
        $bVarsFromForm = true;
    }
}
if (StrLen($CONDITION) > 0) {
    $APPLICATION->SetTitle(GetMessage("MURL_EDIT"));