Your IP : 3.144.91.197


Current Path : /home/bitrix/ext_www/xn--80atde5a3i.com/include/header/
Upload File :
Current File : /home/bitrix/ext_www/xn--80atde5a3i.com/include/header/mobile_navi.php

<?
CModule::IncludeModule('iblock');

$virtualCategories = array();

foreach ($arGResult as $item){
    $virtualCategories [$item["UF_CATEGORY"]] [] = array(
        "NAME"=>$item["UF_NAME"],"LINK"=>$item["UF_LINK"],"TYPE"=>$item["UF_TYPE"]-3
    );
}


$arFilter = array('IBLOCK_ID' => 149, 'SECTION_ID' => false);
$rsSections = CIBlockSection::GetList(array('LEFT_MARGIN' => 'ASC'), $arFilter);

$sections = array();
while ($arSection = $rsSections->GetNext()) {
    $sections [$arSection['ID']] = array(
        "ID" => $arSection['ID'],
        "NAME" => $arSection['NAME'],
        "LINK" => $arSection['SECTION_PAGE_URL']
    );
}

$tree = CIBlockSection::GetTreeList(
    $arFilter = Array('IBLOCK_ID' => 6),
    $arSelect = Array()
);
$thirtLevelSectons = array();
while ($section = $tree->GetNext()) {
    if ($section["DEPTH_LEVEL"] == 3) {
        $thirtLevelSectons [$section["IBLOCK_SECTION_ID"]][] = array(
            "ID" => $section["ID"],
            "NAME" => $section["NAME"],
            "LINK" => $section["SECTION_PAGE_URL"]);
    }
}
$tree = CIBlockSection::GetTreeList(
    $arFilter = Array('IBLOCK_ID' => 149),
    $arSelect = Array()
);
while ($section = $tree->GetNext()) {
    if ($section["DEPTH_LEVEL"] == 1) continue;

    $sub = $thirtLevelSectons[$section["ID"]];
    $virtuals = $virtualCategories[$section["ID"]];

    if (!is_array($sub))
        $sub = "";
    if (!is_array($virtuals))
        $virtuals = "";

    if ($section["DEPTH_LEVEL"] == 2) {
        $sections[$section["IBLOCK_SECTION_ID"]]["SECTIONS"][$section["ID"]] = array(
            "ID" => $section["ID"],
            "NAME" => $section["NAME"],
            "LINK" => $section["SECTION_PAGE_URL"],
            "SECTIONS" => $sub,
            "VIRTUALS" => $virtuals,
        );
    }
}

//pre($sections);
?>

<!---->
<!--<div id="mobile-menu">-->
<!--    <ul>-->
<!--        --><?//foreach ($sections as $section):?>
<!--            <li><a href="--><?//=$section["LINK"]?><!--">--><?//=$section["NAME"]?><!--</a>-->
<!--                --><?//if($section["SECTIONS"]):?>
<!--                    <ul>-->
<!--                    --><?//foreach ($section["SECTIONS"] as $sub_section):?>
<!--                        <li><a href="--><?//=$sub_section["LINK"]?><!--">--><?//=$sub_section["NAME"]?><!--</a>-->
<!--                            --><?//if($sub_section["SECTIONS"]):?>
<!--                            <ul>-->
<!--                                --><?//foreach ($sub_section["SECTIONS"] as $sub_sub_section):?>
<!--                                    <li><a href="--><?//=$sub_sub_section["LINK"]?><!--"><span>--><?//=$sub_sub_section["NAME"]?><!--</span></a></li>-->
<!--                                --><?//endforeach;?>
<!--                            </ul>-->
<!--                            --><?//endif;?>
<!--                        </li>-->
<!--                    --><?//endforeach;?>
<!--                    </ul>-->
<!--                --><?//endif;?>
<!--            </li>-->
<!--        --><?//endforeach;?>
<!--    </ul>-->
<!--</div>-->