本文整理汇总了PHP中CIBlockSection::CheckFields方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockSection::CheckFields方法的具体用法?PHP CIBlockSection::CheckFields怎么用?PHP CIBlockSection::CheckFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlockSection
的用法示例。
在下文中一共展示了CIBlockSection::CheckFields方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if ($arParams["ACTION"] == "EDIT") {
if (!empty($arResult["GALLERIES"]) && $_REQUEST["ACTIVE"] == "Y" && $arResult["GALLERY"]["UF_DEFAULT"] != "Y") {
$arr = array("IBLOCK_ID" => $arParams["IBLOCK_ID"], "UF_DEFAULT" => "N");
$GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("IBLOCK_" . $arParams["IBLOCK_ID"] . "_SECTION", $arr);
$GLOBALS["UF_DEFAULT"] = "N";
foreach ($arResult["GALLERIES"] as $res) {
if ($res["ID"] != $ID) {
$res = $bs->Update($res["ID"], $arr, false, false);
}
}
}
$arFields = array("IBLOCK_ID" => $arParams["IBLOCK_ID"], "NAME" => $_REQUEST["NAME"], "CODE" => $_REQUEST["CODE"], "DESCRIPTION" => $_REQUEST["DESCRIPTION"], "UF_DEFAULT" => $_REQUEST["ACTIVE"]);
if (!empty($arFiles)) {
$arFields["PICTURE"] = $arFiles["PICTURE"];
}
if ($bs->CheckFields($arFields, $ID)) {
if (!empty($arFiles)) {
$arFields["DETAIL_PICTURE"] = $arFiles["DETAIL_PICTURE"];
}
$GLOBALS["UF_DEFAULT"] = $arFields["UF_DEFAULT"];
$GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("IBLOCK_" . $arParams["IBLOCK_ID"] . "_SECTION", $arFields);
$res = $bs->Update($ID, $arFields);
} else {
$res = false;
}
} elseif ($arParams["ACTION"] == "CREATE") {
if (!empty($arResult["GALLERIES"]) && $_REQUEST["ACTIVE"] == "Y") {
$arr = array("IBLOCK_ID" => $arParams["IBLOCK_ID"], "UF_DEFAULT" => "N");
$GLOBALS["UF_DEFAULT"] = "N";
$GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("IBLOCK_" . $arParams["IBLOCK_ID"] . "_SECTION", $arr);
foreach ($arResult["GALLERIES"] as $res) {
示例2: GetMessage
$arFields["CODE"] = "user_" . $arResult["VARIABLES"]["user_id"];
} else {
$res = CSocNetGroup::GetByID($arResult["VARIABLES"]["group_id"]);
if (!$res) {
$arParams["ERROR_MESSAGE"] = GetMessage("SONET_GROUP_NOT_EXISTS");
return 0;
}
$arFields["SOCNET_GROUP_ID"] = $arResult["VARIABLES"]["group_id"];
$arFields["NAME"] = GetMessage("SONET_GROUP_PREFIX") . $res["NAME"];
$arFields["CODE"] = "group_" . $arResult["VARIABLES"]["group_id"];
}
if (!empty($arFiles)) {
$arFields["PICTURE"] = $arFiles["PICTURE"];
}
$bs = new CIBlockSection();
if ($bs->CheckFields($arFields)) {
if (!empty($arFiles)) {
$arFields["DETAIL_PICTURE"] = $arFiles["DETAIL_PICTURE"];
}
$GLOBALS["UF_DEFAULT"] = $arFields["UF_DEFAULT"];
$GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("IBLOCK_" . $arParams["IBLOCK_ID"] . "_SECTION", $arFields);
$res = $bs->Add($arFields);
$db_res = $bs->GetByID($res);
if ($db_res && ($res = $db_res->Fetch())) {
$arResult["VARIABLES"]["GALLERY"] = $res;
$arUserIds = array();
if ($object == "user") {
$arUserIds[] = $USER->GetId();
}
PClearComponentCacheEx($arParams["IBLOCK_ID"], array(0, $res['ID']), array(0, $res['CODE']), $arUserIds);
}