display.menu.php
Список подразделов
Вызывается из:
Исходный код
<?php
$html = '';
foreach ($menu as $row) {
$href = $row['href'];
$title = htmlspecialchars($row['title']);
$active = $row['menu'];
$target = null;
if ($row['id']) {
if ($Item = $Main->load($row['id'])) {
if (!$href) $href = $Item->href ? $Item->href : $Item->href();
if (!$title || $title === $Item->title) $title = $Item->displayTitle();
} elseif (is_array($item = $row['item'])) {
if (!$href) $href = isset($item['href']) ? $item['href'] : $Main->href($row['id']);
if (!$title) $title = htmlspecialchars($item['title']);
}
}
if (!isset($active)) $active = 'Y';
elseif (!$active && !$Auth->admin) continue;
if (strpos($href, '://') !== false) $target = '_blank';
$html .= '<li><a href="' . $href . '">' . $title . ($active ? '' : ' <span class="uk-text-small uk-text-muted">(скрыто)</span>') . '</a></li>';
}
if (!$html) return;
$classNames = array( 'uk-card', 'uk-card-default', 'uk-card-body', 'uk-margin-bottom' );
if (is_array($block) && is_array($block['data'])) {
if ($block['data']['section']) $classNames[] = 'uk-margin-remove-bottom';
foreach (is_array($block['data']['card-options']) ? $block['data']['card-options'] : explode('|', $block['data']['card-options']) as $option) if ($option) {
if (substr($option, 0, 3) === 'uk-') $classNames[] = $option;
}
}
print '<div class="' . implode(' ', $classNames) . '">';
$classNames = array( 'page-menu', 'uk-nav' );
if (is_array($block) && is_array($block['data'])) {
foreach (is_array($block['data']['nav-options']) ? $block['data']['nav-options'] : explode('|', $block['data']['nav-options']) as $option) if ($option) {
if (substr($option, 0, 3) === 'uk-') $classNames[] = $option;
}
}
print '<ul class="' . implode(' ', $classNames) . '" uk-nav>';
print $html;
print '</ul>';
print '</div>';
?>