G
N
I
D
A
O
L

Получить ИНФОБЛОК по КОДУ

if(!function_exists('GetIblockByCode')){ 
    function GetIblockByCode($code='', $type='') {
        if(CModule::IncludeModule('iblock') ) {return 0;}
        $filter = Array(
            'SITE_ID' => SITE_ID,
            'ACTIVE' => 'Y',
            "CODE" => $code
        );
        if (!empty($type))
            $filter['TYPE'] = $type;

        $res = CIBlock::GetList(
            Array(),
            $filter, true
        );
        if ($ar_res = $res->Fetch())
            return $ar_res;
        else
            return 0;
    }
}