private function getSectionDataByAttachObject(array $attachObject)
 {
     if (empty($attachObject['type'])) {
         throw new \Bitrix\Main\ArgumentException('type', 'attachObject');
     }
     if (!isset($attachObject['id'])) {
         throw new \Bitrix\Main\ArgumentException('id', 'attachObject');
     }
     if ($attachObject['type'] == \CWebDavSymlinkHelper::ENTITY_TYPE_GROUP) {
         $data = \CWebDavIblock::getRootSectionDataForGroup((int) $attachObject['id']);
         $data['SOCNET_GROUP_ID'] = $attachObject['id'];
         return $data;
     }
     if ($attachObject['type'] == \CWebDavSymlinkHelper::ENTITY_TYPE_USER) {
         $sectionId = (int) $attachObject['id'];
         $sectionData = \CIBlockSection::getList(array(), array('ID' => $sectionId, 'CHECK_PERMISSIONS' => 'Y'), false, array('SOCNET_GROUP_ID', 'IBLOCK_ID', 'CREATED_BY', 'NAME'));
         if (!$sectionData || !($sectionData = $sectionData->fetch())) {
             return array();
         }
         $allowableIblock = false;
         $iblockType = false;
         foreach (array('user_files', 'group_files', 'shared_files') as $type) {
             $wdIblockOptions = \CWebDavIblock::libOptions($type, false, SITE_ID);
             if (is_set($wdIblockOptions, 'id') && intval($wdIblockOptions['id']) > 0) {
                 if ($sectionData['IBLOCK_ID'] == $wdIblockOptions['id']) {
                     $allowableIblock = true;
                     $iblockType = $type;
                 }
             }
         }
         if (!$allowableIblock) {
             return array();
         }
         \CWebDavSymlinkHelper::setIblockIdForSectionId($sectionId, $sectionData['IBLOCK_ID']);
         return array('NAME' => $sectionData['NAME'], 'IBLOCK_ID' => $sectionData['IBLOCK_ID'], 'IBLOCK_TYPE' => $iblockType, 'SECTION_ID' => $sectionId, 'CREATED_BY' => $sectionData['CREATED_BY'], 'SOCNET_GROUP_ID' => isset($sectionData['SOCNET_GROUP_ID']) ? $sectionData['SOCNET_GROUP_ID'] : null);
     }
     throw new \Bitrix\Main\ArgumentException('Wrong type', 'attachObject');
 }
Exemple #2
0
 if (!$bDialog && $arParams["PAGE_ELEMENTS"] > 0) {
     $pageID = false;
     if (isset($hilightID)) {
         $hilightPos = array_search($hilightID, array_keys($arResult["NAV_RESULT"]->arResult));
         $pageID = intval($hilightPos / $arParams["PAGE_ELEMENTS"]) + 1;
     }
     $arResult["NAV_RESULT"]->NavStart($arParams["PAGE_ELEMENTS"], false, $pageID);
     $arResult["NAV_STRING"] = $arResult["NAV_RESULT"]->GetPageNavStringEx($navComponentObject, GetMessage("WD_DOCUMENTS"), $arParams["PAGE_NAVIGATION_TEMPLATE"], true);
 }
 $sTaskUrl = "";
 $arIconHash = array();
 $allowableIblockForSymlink = false;
 $possibleIblockCode = array('user_files', 'group_files', 'shared_files');
 $currentIblockCode = '';
 foreach ($possibleIblockCode as $type) {
     $wdIblockOptions = \CWebDavIblock::libOptions($type, false, SITE_ID);
     if (is_set($wdIblockOptions, 'id') && intval($wdIblockOptions['id']) > 0) {
         if ($ob->IBLOCK_ID == $wdIblockOptions['id']) {
             CWebDavIblock::$possibleUseSymlinkByInternalSections = $allowableIblockForSymlink = $type != 'group_files';
             $currentIblockCode = $type;
         }
     }
 }
 $selfSharedSections = $sectionsIds = $dataNavResults = array();
 while ($res = $arResult["NAV_RESULT"]->Fetch()) {
     $dataNavResults[] = $res;
     if ($res["TYPE"] == "S") {
         $sectionsIds[] = $res['ID'];
     }
 }
 if ($sectionsIds) {