当前位置: 首页>>代码示例>>PHP>>正文


PHP CList::DeleteField方法代码示例

本文整理汇总了PHP中CList::DeleteField方法的典型用法代码示例。如果您正苦于以下问题:PHP CList::DeleteField方法的具体用法?PHP CList::DeleteField怎么用?PHP CList::DeleteField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CList的用法示例。


在下文中一共展示了CList::DeleteField方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

$arResult["~LISTS_URL"] = str_replace(array("#group_id#"), array($arParams["SOCNET_GROUP_ID"]), $arParams["~LISTS_URL"]);
$arResult["LISTS_URL"] = htmlspecialcharsbx($arResult["~LISTS_URL"]);
$arResult["~LIST_URL"] = CHTTP::urlAddParams(str_replace(array("#list_id#", "#section_id#", "#group_id#"), array($arResult["IBLOCK_ID"], 0, $arParams["SOCNET_GROUP_ID"]), $arParams["~LIST_URL"]), array("list_section_id" => ""));
$arResult["LIST_URL"] = htmlspecialcharsbx($arResult["~LIST_URL"]);
$arResult["~LIST_EDIT_URL"] = str_replace(array("#list_id#", "#group_id#"), array($arResult["IBLOCK_ID"], $arParams["SOCNET_GROUP_ID"]), $arParams["~LIST_EDIT_URL"]);
$arResult["LIST_EDIT_URL"] = htmlspecialcharsbx($arResult["~LIST_EDIT_URL"]);
$arResult["~LIST_FIELDS_URL"] = str_replace(array("#list_id#", "#group_id#"), array($arResult["IBLOCK_ID"], $arParams["SOCNET_GROUP_ID"]), $arParams["~LIST_FIELDS_URL"]);
$arResult["LIST_FIELDS_URL"] = htmlspecialcharsbx($arResult["~LIST_FIELDS_URL"]);
$arResult["~LIST_FIELD_EDIT_URL"] = str_replace(array("#list_id#", "#field_id#", "#group_id#"), array($arResult["IBLOCK_ID"], "0", $arParams["SOCNET_GROUP_ID"]), $arParams["~LIST_FIELD_EDIT_URL"]);
$arResult["LIST_FIELD_EDIT_URL"] = htmlspecialcharsbx($arResult["~LIST_FIELD_EDIT_URL"]);
//Form submitted
if ($_SERVER["REQUEST_METHOD"] == "POST" && check_bitrix_sessid() && isset($_POST["action_button_" . $arResult["GRID_ID"]])) {
    $obList = new CList($arIBlock["ID"]);
    if ($_POST["action_button_" . $arResult["GRID_ID"]] == "delete" && isset($_POST["ID"]) && is_array($_POST["ID"])) {
        foreach ($_POST["ID"] as $ID) {
            $obList->DeleteField($ID);
        }
        //Clear components cache
        $CACHE_MANAGER->ClearByTag("lists_list_" . $arResult["IBLOCK_ID"]);
    }
    if ($_POST["action_button_" . $arResult["GRID_ID"]] == "edit" && isset($_POST["FIELDS"]) && is_array($_POST["FIELDS"])) {
        foreach ($_POST["FIELDS"] as $ID => $tmp) {
            $arField = array("SORT" => $_POST["FIELDS"][$ID]["SORT"], "NAME" => $_POST["FIELDS"][$ID]["NAME"], "IS_REQUIRED" => $_POST["FIELDS"][$ID]["IS_REQUIRED"], "MULTIPLE" => $_POST["FIELDS"][$ID]["MULTIPLE"]);
            $obList->UpdateField($ID, $arField);
        }
        //Clear components cache
        $CACHE_MANAGER->ClearByTag("lists_list_" . $arResult["IBLOCK_ID"]);
    }
    if (!isset($_POST["AJAX_CALL"])) {
        LocalRedirect($arResult["LIST_FIELDS_URL"]);
    }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例2: LocalRedirect

            //And go to proper page
            if (isset($_POST["save"])) {
                LocalRedirect($arResult["~LIST_FIELDS_URL"]);
            } elseif ($arResult["FIELD_ID"]) {
                LocalRedirect(CHTTP::urlAddParams(str_replace(array("#list_id#", "#field_id#", "#group_id#"), array($arResult["IBLOCK_ID"], $arResult["FIELD_ID"], $arParams["SOCNET_GROUP_ID"]), $arParams["~LIST_FIELD_EDIT_URL"]), array($tab_name => $_POST[$tab_name]), array("skip_empty" => true, "encode" => true)));
            } else {
                LocalRedirect($arResult["~LIST_FIELDS_URL"]);
            }
        } else {
            ShowError($strError);
            $bVarsFromForm = true;
        }
    } elseif (isset($_POST["action"]) && $_POST["action"] === "type_changed") {
        $bVarsFromForm = true;
    } elseif ($arResult["FIELD_ID"] && isset($_POST["action"]) && $_POST["action"] === "delete") {
        $obList->DeleteField($arResult["FIELD_ID"]);
        $obList->Save();
        //Clear components cache
        $CACHE_MANAGER->ClearByTag("lists_list_" . $arIBlock["ID"]);
        LocalRedirect($arResult["~LIST_FIELDS_URL"]);
    } else {
        //Go to lists page
        LocalRedirect($arResult["~LISTS_URL"]);
    }
}
$arResult["TYPES"] = $obList->GetAvailableTypes($arResult["FIELD_ID"]);
$data = array();
if ($bVarsFromForm) {
    //There was an error so display form values
    $data["SORT"] = $_POST["SORT"];
    $data["NAME"] = $_POST["NAME"];
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php


注:本文中的CList::DeleteField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。