-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.php
28 lines (18 loc) · 1.11 KB
/
menu.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<ul class="<?php echo if_or($level === 1, 'nav navbar-nav', 'dropdown-menu'); ?>">
<?php foreach ($menu as $link): ?>
<li class="<?php echo empty($link[ 'submenu' ]) ? '' : 'dropdown-submenu'; ?> <?php echo $link[ 'link_active' ]; ?>">
<?php if (empty($link[ 'submenu' ])): ?>
<a href="<?php echo $link[ 'link' ]; ?>" <?php echo if_or($link[ 'target_link' ], 'target="_blank" rel="noopener noreferrer"'); ?>>
<?php echo if_or($link['icon'], '<i class="' . htmlspecialchars($link['icon']) . '" aria-hidden="true"></i>'); ?>
<?php echo htmlspecialchars($link[ 'title_link' ]); ?>
</a>
<?php else: ?>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<?php echo if_or($link['icon'], '<i class="' . htmlspecialchars($link['icon']) . '" aria-hidden="true"></i>'); ?>
<?php echo htmlspecialchars($link[ 'title_link' ]); ?> <span class="caret"></span>
</a>
<?php echo $link[ 'submenu' ]; ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>