<?php
/*
* @package LabCMS
* @copyright (c) 2006 Alexander Levin aka Loki (loki_angel@mail.ru)
* @support http://labcms.ru
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
	$mod_template='default.tpl';
	//не придумал пока что тут использовать в качестве id
	//if (LabCMS::i()->is_cached($mod_template, 60*10, )) return;

	$breadcrumb=array();
	
	$crumbs=Db::i()->select("-- CACHE:24h
						SELECT path, tree_name as name FROM ?_tree WHERE tree_id IN (?a) AND `show`=1 ORDER BY FIELD(tree_id, ?a)", LabCMS::i()->parents, LabCMS::i()->parents);
	
	if ($crumbs)
	{
		foreach($crumbs as $crumb)
		{
			$breadcrumb[]=array(
								'path'=>isset($crumb['path'])?_url(false, false, false, $crumb['path']):'',
								'name'=>isset($crumb['name'])?$crumb['name']:'');
		}
	}
	
	if (is_array(LabVars::$breadcrumb) && count(LabVars::$breadcrumb))
	{
		foreach(LabVars::$breadcrumb as $val)
		{
			$breadcrumb[]=array(
							'path'=>isset($val['path'])?$val['path']:'',
							'name'=>isset($val['name'])?$val['name']:'',
							'name_html'=>isset($val['name_html'])?$val['name_html']:'');
		}
	}
	if (count($breadcrumb)>1) Tpl::i()->assign('breadcrumb', $breadcrumb);
