<?php
/**
* XS2:
*
* This file is developed by Solutecs, LLC for the purpose of the company
* and is provided together with XS2 Framework as and inherent part of the
* system. This file can be used on the terms of License Agreement.
*
* +7 (495) 585-0833 / 13 Rusakovskaya street, Moscow 107140 Russia
*
* @link http://www.solutecs.com
* @copyright ©1998-2007 Solutecs, LLC
* @package XS2-MODCOM
* @subpackage proc-menu
* @version 1.XX
*/
// Выбор блока меню
$currentMenu = xs2GetNode(array('mod'=>'menu',
'NType'=>'menu',
'NodId'=>2));
$itemList = xs2GetNodes(array('NType'=>'item', 'mod'=>"menu"));
$currentItem = array();
foreach ($itemList as $item) {
if ($item['pattern'] && preg_match('/'.$item['pattern'].'/ix', $_THE['REQUEST_URI'])) {
// Текущий пункт меню
$currentItem = $item;
break;
}
}
$_HTML->assign('currentMenu', $currentMenu);
$_HTML->assign('currentItem', $currentItem);
function isAncestor($params, &$smarty) {
global $_HTML;
if ($smarty) {
extract($params);
}
$result = ($node['LtCnt'] < $currentItem['LtCnt'] && $node['RtCnt'] > $currentItem['RtCnt']);
if ($smarty && $var) {
$_HTML->assign($var, $result);
}
else {
return $result;
}
}
$_HTML->register_function('isAncestor', 'isAncestor');
?>
|
|