• Модуль: webdav
  • Путь к файлу: ~/bitrix/modules/webdav/classes/diskdispatcher.php
  • Класс: CWebDavDiskDispatcher
  • Вызов: CWebDavDiskDispatcher::markDeleteBatch
static function markDeleteBatch($deleteInviteOnSection = true)
{
	if(empty(static::$dataDeletingMark))
	{
		return false;
	}

	/** @var CWebDavDiskDispatcher $component */
	$component = new static();
	/** @var CWebDavAbstractStorage $storage  */
	$storage = $component->getStorageObject();

	global $USER;
	$userId = $USER->getId();
	$keeper = array();
	$sectionIds = array();
	foreach (static::$dataDeletingMark as $key => $data)
	{
		list($userIds, $sectionOwnersElement) = $data['ownerData'];

		foreach ($sectionOwnersElement as $ownerSection)
		{
			if(empty($ownerSection['IBLOCK_ID']) || empty($ownerSection['SECTION_ID']))
			{
				continue;
			}
			$storage->setStorageId(array(
				'IBLOCK_ID' => $ownerSection['IBLOCK_ID'],
				'IBLOCK_SECTION_ID' => $ownerSection['SECTION_ID'],
			));

			$uniqueId = $storage->generateId(array('FILE' => !$data['isSection'], 'ID' => $data['ID']));
			$keeper[] = array(
				'IBLOCK_ID' => $ownerSection['IBLOCK_ID'],
				'SECTION_ID'=> $ownerSection['SECTION_ID'],
				'ELEMENT_ID'=> $uniqueId,
				'USER_ID'=> $userId,
				'IS_DIR'=> (int)$data['isSection'],
			);

			if($data['isSection'] && !isset($sectionIds[$data['ID']]))
			{
				$sectionIds[$data['ID']] = $data['ID'];
			}
		}
		unset($ownerSection);

		unset(static::$dataDeletingMark[$key]);
	}
	unset($data);

	if($deleteInviteOnSection && $sectionIds)
	{
		BitrixWebdavFolderInviteTable::deleteByFilter(array(
			'=SECTION_ID' => $sectionIds,
		));
	}

	CWebDavLogDeletedElement::addBatch($keeper);
}