• Модуль: webdav
  • Путь к файлу: ~/bitrix/modules/webdav/classes/virtual.php
  • Класс: CWebDavVirtual
  • Вызов: CWebDavVirtual::GetNavChain
function GetNavChain($options = array(), $for_url = false)
{
	static $nav_chain = array(); 
	$for_url = ($for_url === true); 
	$id = md5(serialize($options)); 
	
	if (!is_set($nav_chain, $id))
	{
		if ($this->CACHE_OBJ && $this->CACHE_OBJ->InitCache($this->CACHE_TIME, $id, $this->CACHE_PATH."nav_chain"))
		{
			$nav_chain[$id] = $this->CACHE_OBJ->GetVars();
		}
		else 
		{
			$this->IsDir($options);
			$nav_chain[$id] = array("URL" => array(), "SITE" => array()); 
			if ($this->arParams["not_found"] == false && !empty($this->arParams["item_id"]))
			{
				$res = explode("/", $this->arParams["item_id"]); 
				if (empty($res) && !empty($this->arParams["item_id"]))
					$res = array($this->arParams["item_id"]); 

				foreach ($res as $val)
				{
					if (empty($val))
						continue; 
					if (SITE_CHARSET != "UTF-8")
						$nav_chain["Y".$id][] = $GLOBALS["APPLICATION"]->ConvertCharset($val, SITE_CHARSET, "UTF-8");
					else
						$nav_chain["Y".$id][] = $val;
					$nav_chain["N".$id][] = $val;
				}

				//$arFile = array(); 
				//$section_id = $this->arParams["item_id"];
				//if ($this->arParams["is_file"])
				//{
					//$arFile = $this->arParams["element_array"]; 
					//$section_id = $arFile["IBLOCK_SECTION_ID"]; 
				//}
				//$db_res = CIBlockSection::GetNavChain($this->IBLOCK_ID, $section_id);
				//$bRootFounded = (empty($this->arRootSection) ? true : false);
				//while($res = $db_res->Fetch())
				//{
					//if (!$bRootFounded && $res["ID"] == $this->arRootSection["ID"])
					//{
						//$bRootFounded = true;
						//continue;
					//}
					//if (!$bRootFounded)
						//continue;
					
					//$nav_chain[$id]["URL"][] = $this->_uencode($res["NAME"], array("utf8" => "Y", "convert" => "full"));
					//$nav_chain[$id]["SITE"][] = $res["NAME"];
				//}
				//if (!empty($arFile))
				//{
					//$nav_chain[$id]["URL"][] = $this->_uencode($res["NAME"], array("utf8" => "Y", "convert" => "full"));
					//$nav_chain[$id]["SITE"][] = $arFile["NAME"];
				//}
			}
			if ($this->CACHE_OBJ)
			{
				$this->CACHE_OBJ->StartDataCache($this->CACHE_TIME, $id, $this->CACHE_PATH."_nav_chain");
				$this->CACHE_OBJ->EndDataCache($nav_chain[$id]);
			}
		}
	}
	$res = $nav_chain[($for_url ? "Y" : "N").$id]; 
	return (is_array($res) ? $res : array()); 
	return array(); 
}