• Модуль: webdav
  • Путь к файлу: ~/bitrix/modules/webdav/classes/iblock.php
  • Класс: CWebDavIblock
  • Вызов: CWebDavIblock::_isInMeta
function _isInMeta($id, $metaId, $type = 'FILE')
{
	if($type == 'FILE')
	{
		$elementData = $this->GetObject(array('element_id' => intval($id)));
		if ($elementData['not_found'])
		{
			return false;
		}
		$sectionId = $elementData['parent_id'];
	}
	else
	{
		$sectionData = $this->GetObject(array('section_id' => intval($id)));
		$sectionId = $sectionData['item_id'];
	}

	list($contextType, $contextEntityId) = $this->getContextData();
	$sectionData = $this->getSectionDataForLinkAnalyze($sectionId, array(), false);
	if(CWebDavSymlinkHelper::isLink($contextType, $contextEntityId, $sectionData))
	{
		$parentSectionData = CWebDavSymlinkHelper::getLinkData($contextType, $contextEntityId, $sectionData);
		if($parentSectionData)
		{
			$linkWebdav = new self($parentSectionData[self::UF_LINK_IBLOCK_ID], $this->base_url . $this->_path, array(
				'ROOT_SECTION_ID' => $parentSectionData[self::UF_LINK_ROOT_SECTION_ID],
				'symlinkMode' => true,
				'symlinkSectionData' => $parentSectionData,
				'symlinkRealRootSectionData' => $this->arRootSection,
			));
			return $linkWebdav->_isInMeta($id, $metaId, $type);
		}
	}

	$sectionMetaId = $this->GetMetaID($metaId, false);
	foreach (CWebDavSymlinkHelper::getNavChain($this->IBLOCK_ID, $sectionId) as $res)
	{
		if($sectionMetaId == $res['ID'])
		{
			return true;
		}
	}
	unset($res);

	return false;
}