本文整理汇总了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"]);
}
示例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"];