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


PHP CIBlock::GetarrayByID方法代码示例

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


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

示例1: groupSectionCreate

 protected static function groupSectionCreate($groupId)
 {
     $groupLib = CWebDavIblock::LibOptions('group_files', false, SITE_ID);
     if (!$groupLib || !isset($groupLib['id']) || !($iblockId = intval($groupLib['id']))) {
         return false;
     }
     $result = CIBlockWebdavSocnet::GetSectionID($iblockId, 'group', $groupId);
     if (intval($result) > 0) {
         return $result;
     }
     $dbRes = CUserTypeEntity::GetList(array($by => $order), array("ENTITY_ID" => "IBLOCK_" . $iblockId . "_SECTION", "FIELD_NAME" => "UF_USE_BP"));
     if (!$dbRes || !($res = $dbRes->GetNext())) {
         $arFields = array("ENTITY_ID" => "IBLOCK_" . $iblockId . "_SECTION", "FIELD_NAME" => "UF_USE_BP", "USER_TYPE_ID" => "string", "MULTIPLE" => "N", "MANDATORY" => "N", "SETTINGS" => array("DEFAULT_VALUE" => "Y"));
         $arFieldName = array();
         $rsLanguage = CLanguage::GetList($by, $order, array());
         while ($arLanguage = $rsLanguage->Fetch()) {
             $dir = str_replace(array("\\", "//"), "/", dirname(__FILE__));
             $dirs = explode("/", $dir);
             array_pop($dirs);
             $file = trim(implode("/", $dirs) . "/lang/" . $arLanguage["LID"] . "/include/webdav_settings.php");
             $tmp_mess = __IncludeLang($file, true);
             $arFieldName[$arLanguage["LID"]] = empty($tmp_mess["SONET_UF_USE_BP"]) ? "Use Business Process" : $tmp_mess["SONET_UF_USE_BP"];
         }
         $arFields["EDIT_FORM_LABEL"] = $arFieldName;
         $obUserField = new CUserTypeEntity();
         $obUserField->Add($arFields);
         $GLOBALS["USER_FIELD_MANAGER"]->arFieldsCache = array();
     }
     $arFields = array("IBLOCK_ID" => $iblockId, "ACTIVE" => "Y", "SOCNET_GROUP_ID" => false, "IBLOCK_SECTION_ID" => 0, "UF_USE_BP" => "N");
     $arFields["SOCNET_GROUP_ID"] = $groupId;
     $arFields["NAME"] = GetMessage("SONET_GROUP_PREFIX") . $groupId;
     $dbGroup = CSocNetGroup::GetList(array(), array("ID" => (int) $groupId), false, false, array("ID", "SITE_ID", "NAME"));
     if ($arGroup = $dbGroup->Fetch()) {
         $arFields["NAME"] = GetMessage("SONET_GROUP_PREFIX") . $arGroup["NAME"];
     }
     if (CIBlock::GetarrayByID($iblockId, "RIGHTS_MODE") === "E") {
         $arTasks = CWebDavIblock::GetTasks();
         $arFields['RIGHTS'] = array('n0' => array('GROUP_CODE' => 'SG' . $arFields["SOCNET_GROUP_ID"] . '_A', 'TASK_ID' => $arTasks['X']), 'n1' => array('GROUP_CODE' => 'SG' . $arFields["SOCNET_GROUP_ID"] . '_E', 'TASK_ID' => $arTasks['W']), 'n2' => array('GROUP_CODE' => 'SG' . $arFields["SOCNET_GROUP_ID"] . '_K', 'TASK_ID' => $arTasks['W']));
     }
     $GLOBALS["UF_USE_BP"] = $arFields["UF_USE_BP"];
     $GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("IBLOCK_" . $iblockId . "_SECTION", $arFields);
     $bs = new CIBlockSection();
     $sectionId = $bs->Add($arFields);
     if (!$sectionId) {
         return false;
     }
     return $sectionId;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:48,代码来源:iblocksocnet.php


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