22 if (!isset($manifest[
'attrs']) || !is_array($manifest[
'attrs']))
24 $manifest[
'attrs'] = array();
26 if (!isset($manifest[
'attrs'][
'.navbar-collapse']))
28 $manifest[
'attrs'][
'.navbar-collapse'] = array(
35 if (!isset($manifest[
'attrs'][
'button.navbar-toggler']))
37 $manifest[
'attrs'][
'button.navbar-toggler'] = array(
40 'attribute' =>
'aria-controls',
44 'attribute' =>
'data-target',
50 $manifest[
'callbacks'] = array(
53 $manifest = $block->getManifest();
58 if (isset($params[
'selector']))
60 $selector = $params[
'selector'];
64 $selector =
'.landing-block-node-menu-list-item-link';
66 $count = isset($params[
'count']) ? $params[
'count'] : 5;
67 $source = isset($params[
'source']) ? $params[
'source'] :
null;
72 if (isset($manifest[
'nodes'][$selector]))
75 if ($source ==
'catalog')
77 $site = $block->getSite();
78 if ($site[
'TYPE'] ==
'STORE')
80 $menuItems = self::getCatalogMenu(
86 else if ($source ==
'personal')
88 $menuItems = self::getPersonalMenu();
92 if (!empty($menuItems))
94 $block->updateNodes(array(
95 $selector => $menuItems
100 else if ($source ==
'structure')
103 \Bitrix\Landing\Subtype\Menu::redrawStructureMenu($block);
105 $eventManager = \Bitrix\Main\EventManager::getInstance();
106 $eventManager->addEventHandler(
'landing',
'onAfterDemoCreate',
109 \Bitrix\Landing\Subtype\Menu::redrawStructureMenu($block);
116 $navbarCollapseSection = $params[
'navbarCollapseSection'] ??
'.navbar-collapse';
117 $navbarTogglerButton = $params[
'navbarTogglerButton'] ??
'button.navbar-toggler';
120 isset($manifest[
'attrs'][$navbarCollapseSection])
121 && isset($manifest[
'attrs'][$navbarTogglerButton])
124 $newId =
'navBar' . $block->getId();
125 $block->setAttributes(array(
126 $navbarCollapseSection => array(
'id' => $newId),
127 $navbarTogglerButton => array(
128 'aria-controls' => $newId,
129 'data-target' =>
'#' . $newId,