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


PHP CIBlockSection::CheckFields方法代码示例

本文整理汇总了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) {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例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);
     }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:photogallery.php


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