- Модуль: webdav
- Путь к файлу: ~/bitrix/modules/webdav/classes/iblock.php
- Класс: CWebDavIblock
- Вызов: CWebDavIblock::CleanUpDropped
function CleanUpDropped()
{
$dropTargetID = $this->GetMetaID("DROPPED");
// remove empty 'dropped' folders
$ise = new CIBlockSection;
//if (!$checked)
//{
$rsParentSection = $ise->GetByID($dropTargetID);
if ($arParentSection = $rsParentSection->GetNext())
{
$arFilter = array('IBLOCK_ID' => $this->IBLOCK_ID,
'>LEFT_MARGIN' => $arParentSection['LEFT_MARGIN'],
' $arParentSection['RIGHT_MARGIN'],
'>DEPTH_LEVEL' => $arParentSection['DEPTH_LEVEL'],
'CHECK_PERMISSIONS' => 'N'
);
$dbFolders = $ise->GetList(array(),$arFilter, false, array('ID', 'IBLOCK_ID'));
while($arFolder = $dbFolders->Fetch())
{
$count = CIBlockElement::GetList(array(), array(
'IBLOCK_SECTION_ID' => $arFolder['ID'],
'IBLOCK_ID' => $arFolder['IBLOCK_ID'],
'INCLUDE_SUBSECTIONS' => 'Y'), array(), false, array('ID'));
if(intval($count) < 1)
{
$ise->Delete($arFolder['ID']);
}
}
}
//}
}