- Модуль: landing
- Путь к файлу: ~/bitrix/modules/landing/lib/subtype/menu.php
- Класс: BitrixLandingSubtypeMenu
- Вызов: Menu::getCatalogMenu
static function getCatalogMenu($siteId, $count)
{
$menuItems = array();
if (!BitrixMainLoader::includeModule('iblock'))
{
return $menuItems;
}
BitrixLandingHook::setEditMode(true);
$settings = Settings::getDataForSite($siteId);
if ($settings['IBLOCK_ID'])
{
$res = CIBlockSection::getList(
array(),
array(
'IBLOCK_ID' => $settings['IBLOCK_ID'],
'SECTION_ID' => $settings['SECTION_ID']
? $settings['SECTION_ID']
: false
),
false,
array(
'ID', 'NAME'
),
array(
'nTopCount' => $count
)
);
while ($row = $res->fetch())
{
$menuItems[] = array(
'text' => $row['NAME'],
'href' => '#catalogSection' . $row['ID'],
'attrs' => array(
'data-url' => '#catalogSection' . $row['ID']
)
);
}
}
return $menuItems;
}