• Модуль: webdav
  • Путь к файлу: ~/bitrix/modules/webdav/classes/file.php
  • Класс: CWebDavFile
  • Вызов: CWebDavFile::__get_folder_tree
function __get_folder_tree($path, $path_chunc, $deep, &$arSection)
		{
			static $io = false;

			if ($io === false)
				$io = CBXVirtualIo::GetInstance();

			if (!is_array($arSection))
				$arSection = array();

			if($path === false)
			{
				return false;
			}

			if ($io->DirectoryExists($path))
			{
				$oDir = $io->GetDirectory($path);
				$arChildren = $oDir->GetChildren();
				foreach($arChildren as $node)
				{
					$deep++;
					$filename = $node->GetName();
					$tmp_path = $node->GetPathWithName();

					if ($io->DirectoryExists($tmp_path))
					{
						$filename = $this->MetaNamesReverse($filename);
						$arSection[] = array(
							"ID" => str_replace($path_chunc, "", $tmp_path),
							"DEPTH_LEVEL" => $deep,
							"NAME" => $filename);
						__get_folder_tree($tmp_path, $path_chunc, $deep, $arSection);
					}
				}
			}
		}