Your IP : 18.225.7.8


Current Path : /var/www/admin_ftp_12/data/www/httpdocs/services/
Upload File :
Current File : /var/www/admin_ftp_12/data/www/httpdocs/services/.left.menu_ext.php

<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<?
global $APPLICATION; 
$arMenuLinksExt = array();

if(CModule::IncludeModule("iblock") ) {

    $IBLOCK_ID = 7; // инфоблок с элементами 
    $arSections = array();

//    echo '<pre>';
    $rsParentSection = CIBlockSection::GetByID($_REQUEST['SECTION_ID']);
    if ($arParentSection = $rsParentSection->GetNext())
    {
        $APPLICATION->SetTitle($arParentSection['NAME']);
        $arFilter = array('IBLOCK_ID' => $arParentSection['IBLOCK_ID'], "ACTIVE"=>"Y",'>LEFT_MARGIN' => $arParentSection['LEFT_MARGIN'],'<RIGHT_MARGIN' => $arParentSection['RIGHT_MARGIN'],'>DEPTH_LEVEL' => $arParentSection['DEPTH_LEVEL']); // выберет потомков без учета активности
        $rsSect = CIBlockSection::GetList(array('left_margin' => 'asc'),$arFilter);
        while ($arSect = $rsSect->GetNext())
        {
            // получаем подразделы
//               print_r($arSect);
//               pre($arSect);
            $arMenuLinksExt[] = array($arSect['NAME'], $arSect['SECTION_PAGE_URL'], array(), array(), "");
        }
    }
//    echo '</pre>';

    if(count($arMenuLinksExt) < 1){
        $arOrder = Array("SORT"=>"ASC"); 
        $arSelect = Array("ID", "NAME", "IBLOCK_ID", "DETAIL_PAGE_URL"); 
        $arFilter = Array("IBLOCK_ID"=>$IBLOCK_ID, "ACTIVE"=>"Y");
        if(isset($_REQUEST['SECTION_ID'])){
                $arFilter['SECTION_ID'] = $_REQUEST['SECTION_ID'];
        }

        $res = CIBlockElement::GetList($arOrder, $arFilter, false, false, $arSelect); 
        while($ob = $res->GetNextElement()) // наполнение массива меню пунктами меню 
        { 
                $arFields = $ob->GetFields(); 
                $arMenuLinksExt[] = Array( 
                                $arFields['NAME'], 
                                $arFields['DETAIL_PAGE_URL'], 
                                Array(), 
                                Array(), 
                                "" 
                ); 
        }
    }
}

$aMenuLinks = array_merge($arMenuLinksExt, $aMenuLinks); // меню сформировано