• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/file_dialog.php
  • Класс: CAdminFileDialog
  • Вызов: CAdminFileDialog::GetItemsRecursively
static function GetItemsRecursively($Params)
{
	global $APPLICATION;

	$io = CBXVirtualIo::GetInstance();

	$path = $io->CombinePath("/", $APPLICATION->UnJSEscape($Params['path']));
	$rootPath = CSite::GetSiteDocRoot($Params['site']);

	if (!$io->FileExists($rootPath.$path) && !$io->DirectoryExists($rootPath.$path))
	{
		if ($Params['bThrowException'] === true)
		{
			$APPLICATION->ThrowException(GetMessage('BX_FD_ERROR').': '.GetMessage('BX_FD_PATH_CORRUPT'), 'path_corrupt');
			return;
		}
		$path = '/';
	}

	$arPath = explode('/', $path);

	if ($Params['loadRoot'] !== false)
	{
		$Params['path'] = '/';
		self::GetItems($Params);
	}

	$curPath = '';
	for ($i = 0, $l = count($arPath); $i < $l; $i++)
	{
		$catalog = trim($arPath[$i], "/\");

		if ($catalog != "")
		{
			$curPath .= '/'.$catalog;
			$Params['path'] = $curPath;
			self::GetItems($Params);
		}
	}
}