<?$this->setFrameMode(true);?>
<?global $bShowToogle;?>
<?if(!function_exists("ShowSubItems")){
function ShowSubItems($arItem){
?>
<?if($arItem["CHILD"]):?>
<?$noMoreSubMenuOnThisDepth = false;?>
<div class="submenu-wrapper hidden-block"<?=($arItem["SELECTED"] ? ' style="display:block;"' : '')?>>
<ul class="submenu">
<?foreach($arItem["CHILD"] as $arSubItem):?>
<li class="item font_xs<?=($arSubItem["SELECTED"] ? " active opened" : "")?><?=($arSubItem["CHILD"] ? " child" : " no_child")?>">
<a href="<?=$arSubItem["LINK"]?>"><?=$arSubItem["TEXT"]?><?=(isset($arSubItem['CHILD']) && $arSubItem['CHILD'] ? '<span class="arrow'.($arSubItem['SELECTED'] ? ' opened' : '').'"></span>' : '')?></a>
<?if(!$noMoreSubMenuOnThisDepth):?>
<?ShowSubItems($arSubItem);?>
<?endif;?>
</li>
<?$noMoreSubMenuOnThisDepth |= CPriority::isChildsSelected($arSubItem["CHILD"]);?>
<?endforeach;?>
</ul>
</div>
<?endif;?>
<?
}
}
?>
<?if($arResult):?>
<aside class="sidebar<?=($bShowToogle && isset($_COOKIE['MENU_CLOSED']) && $_COOKIE['MENU_CLOSED'] == 'Y' ? ' closed' : '')?>">
<?if($bShowToogle):?>
<?foreach($arResult as $arItem):?>
<?if($arItem['PARAMS']['TYPE'] == 'PRODUCT'):?>
<div class="switcher<?=(isset($_COOKIE['LEFT_CONTENT_CLOSED']) && $_COOKIE['LEFT_CONTENT_CLOSED'] == 'Y' ? ' collapsed' : '')?>"><span title="<?=GetMessage('SWITCHER_CLOSE');?>"><span class="circle"></span></span></div>
<div class="catalog_opener"><span><?=$arItem['TEXT']?><span class="arrow"></span></span></div>
<?endif;?>
<?endforeach;?>
<?endif;?>
<ul class="nav nav-list side-menu">
<?foreach($arResult as $arItem):?>
<?
if($arItem['PARAMS']['TYPE'] == 'PRODUCT')
continue;
?>
<li class="item<?=($arItem["SELECTED"] ? " active opened" : "")?> <?=($arItem["CHILD"] ? " child" : "")?>">
<a href="<?=$arItem["LINK"]?>"><?=(isset($arItem["PARAMS"]["BLOCK"]) && $arItem["PARAMS"]["BLOCK"] ? $arItem["PARAMS"]["BLOCK"] : "");?><?=$arItem["TEXT"]?><?=(isset($arItem['CHILD']) && $arItem['CHILD'] ? '<span class="arrow'.($arItem['SELECTED'] ? ' opened' : '').'"></span>' : '')?></a>
<?ShowSubItems($arItem);?>
</li>
<?endforeach;?>
</ul>
</aside>
<?
if(!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) die();
$aMenuLinksExt = array();
if($arMenuParametrs = CPriority::GetDirMenuParametrs(__DIR__)){
if($arMenuParametrs['MENU_SHOW_SECTIONS'] == 'Y' || $arMenuParametrs['MENU_SHOW_ELEMENTS'] == 'Y'){
global $APPLICATION, $arRegion, $arTheme;
}
if($arMenuParametrs['MENU_SHOW_SECTIONS'] == 'Y'){
$arSections = CCache::CIBlockSection_GetList(array('SORT' => 'ASC', 'ID' => 'ASC', 'CACHE' => array('TAG' => CCache::GetIBlockCacheTag(CCache::$arIBlocks[SITE_ID]['aspro_priority_catalog']['aspro_priority_catalog'][0]), 'MULTI' => 'Y')), array('IBLOCK_ID' => CCache::$arIBlocks[SITE_ID]['aspro_priority_catalog']['aspro_priority_catalog'][0], 'ACTIVE' => 'Y', 'GLOBAL_ACTIVE' => 'Y', 'ACTIVE_DATE' => 'Y'), false, array('IBLOCK_ID', 'ID', 'IBLOCK_SECTION_ID', 'NAME', 'SECTION_PAGE_URL', 'PICTURE', 'DEPTH_LEVEL', 'UF_ICON', 'UF_BACKGROUND'));
$arSectionsByParentSectionID = CCache::GroupArrayBy($arSections, array('MULTI' => 'Y', 'GROUP' => array('IBLOCK_SECTION_ID')));
}
if($arMenuParametrs['MENU_SHOW_ELEMENTS'] == 'Y' || ($arTheme['SHOW_SECTIONS_REGION']['VALUE'] == 'Y' && $arTheme['USE_REGIONALITY']['VALUE'] === 'Y' && $arTheme['USE_REGIONALITY']['DEPENDENT_PARAMS']['REGIONALITY_FILTER_ITEM']['VALUE'] === 'Y')){
$arItems = CCache::CIBlockElement_GetList(array('SORT' => 'ASC', 'ID' => 'DESC', 'CACHE' => array('TAG' => CCache::GetIBlockCacheTag(CCache::$arIBlocks[SITE_ID]['aspro_priority_catalog']['aspro_priority_catalog'][0]), 'MULTI' => 'Y')), array('IBLOCK_ID' => CCache::$arIBlocks[SITE_ID]['aspro_priority_catalog']['aspro_priority_catalog'][0], 'ACTIVE' => 'Y', 'SECTION_GLOBAL_ACTIVE' => 'Y', 'ACTIVE_DATE' => 'Y', 'INCLUDE_SUBSECTIONS' => 'Y'));
if($arMenuParametrs['MENU_SHOW_SECTIONS'] == 'Y'){
$arItemsBySectionID = CCache::GroupArrayBy($arItems, array('MULTI' => 'Y', 'GROUP' => array('IBLOCK_SECTION_ID')));
}
else{
$arItemsRoot = CCache::CIBlockElement_GetList(array('SORT' => 'ASC', 'ID' => 'DESC', 'CACHE' => array('TAG' => CCache::GetIBlockCacheTag(CCache::$arIBlocks[SITE_ID]['aspro_priority_catalog']['aspro_priority_catalog'][0]), 'MULTI' => 'Y')), array('IBLOCK_ID' => CCache::$arIBlocks[SITE_ID]['aspro_priority_catalog']['aspro_priority_catalog'][0], 'ACTIVE' => 'Y', 'ACTIVE_DATE' => 'Y', 'SECTION_ID' => 0));
$arItems = array_merge((array)$arItems, (array)$arItemsRoot);
}
if($arItems && $arRegion)
{
foreach($arItems as $key => $arItem)
{
$arTmpProp = array();
$rsPropRegion = CIBlockElement::GetProperty($arItem['IBLOCK_ID'], $arItem['ID'], array('sort' => 'asc'), Array('CODE'=>'LINK_REGION'));
while($arPropRegion = $rsPropRegion->Fetch())
{
if($arPropRegion['VALUE'])
$arTmpProp[] = $arPropRegion['VALUE'];
}
$arItems[$key]['LINK_REGION'] = $arTmpProp;
}
}
}
if($arSections){
CPriority::getSectionChilds(false, $arSections, $arSectionsByParentSectionID, $arItemsBySectionID, $aMenuLinksExt, CCache::$arIBlocks[SITE_ID]['aspro_priority_catalog']['aspro_priority_catalog'][0]);
}
if($arItems && $arMenuParametrs['MENU_SHOW_SECTIONS'] != 'Y'){
foreach($arItems as $arItem){
$arExtParam = array('FROM_IBLOCK' => 1, 'DEPTH_LEVEL' => 1);
if(isset($arItem['LINK_REGION'])){
$arExtParam['LINK_REGION'] = $arItem['LINK_REGION'];
}
$aMenuLinksExt[] = array($arItem['NAME'], $arItem['DETAIL_PAGE_URL'], array(), $arExtParam);
}
}
}
$aMenuLinks = array_merge($aMenuLinks, $aMenuLinksExt);
?>