- Модуль: webdav
- Путь к файлу: ~/bitrix/modules/webdav/classes/iblocksocnetbizproc.php
- Класс: CIBlockDocumentWebdavSocnet
- Вызов: CIBlockDocumentWebdavSocnet::GetDocumentType
static function GetDocumentType($documentId)
{
$diskId = self::processGetDiskIdByDocId($documentId);
if($diskId !== null)
{
return self::proxyToDisk(__FUNCTION__, array($diskId));
}
$result = '';
$dbResult = CIBlockElement::GetList(array(), array("ID" => $documentId, "SHOW_NEW" => "Y", "SHOW_HISTORY" => "Y"), false, false);
$arResult = $dbResult->Fetch();
if (!$arResult)
throw new Exception("Element is not found");
$nav = CIBlockSection::GetNavChain(intval($arResult['IBLOCK_ID']), intval($arResult['IBLOCK_SECTION_ID']));
if ($nav && $arSection = $nav->GetNext())
{
$result = implode('_', array(
'iblock',
intval($arResult['IBLOCK_ID']),
($arSection["SOCNET_GROUP_ID"] > 0 ? "group" : "user"),
($arSection["SOCNET_GROUP_ID"] > 0 ? $arSection["SOCNET_GROUP_ID"] : $arSection["CREATED_BY"])
));
}
return $result;
}