<ul class="<?= $this->level ?> <?php if ($this->level == 'level_1'): ?>nav navbar-nav navbar-right<?php endif; ?> <?php if ($this->level != 'level_1'): ?>dropdown-menu<?php endif; ?>">
<?php foreach ($this->items as $item): ?>
<?php if ($item['isActive']): ?>
<?php if ( $this->level == 'level_1' && $item['subitems'] != '')
{
$liDropdownclass = 'dropdown';
$ahrefDropdownclass='dropdown-toggle js-activated';
$ahrefDatafields = 'data-toggle="dropdown" role="button" aria-expanded="false"';
}
?>
<li class="<?= $liDropdownclass; ?> <?= $item['class'] ?>"><a class="<?= $ahrefDropdownclass; ?> <?= $item['class'] ?>"<?php if (!empty($item['subitems'])) echo ' aria-haspopup="true"'; ?> <?= $ahrefDatafields; ?>><?= $item['link'] ?></a><?= $item['subitems'] ?></li>
<?php else: ?>
<?php
$liDropdownclass = '';
$ahrefDropdownclass='';
$ahrefDatafields = '';
?>
<?php if ( $this->level == 'level_1' && $item['subitems'] != '')
{
$liDropdownclass = 'dropdown';
$ahrefDropdownclass='dropdown-toggle js-activated';
$ahrefDatafields = 'data-toggle="dropdown" role="button" aria-expanded="false"';
}
?>
<li<?php if ($item['class']) echo ' class="' . $item['class'] . ' '.$liDropdownclass.'"'; ?>>
<a href="<?= $item['href'] ?: './' ?>" title="<?= $item['pageTitle'] ?: $item['title'] ?>"<?php if ($item['class']) echo ' class="' . $item['class'] . ' '.$ahrefDropdownclass.'" '.$ahrefDatafields.''; ?><?php if ($item['accesskey']) echo ' accesskey="' . $item['accesskey'] . '"'; ?><?php if ($item['tabindex']) echo ' tabindex="' . $item['tabindex'] . '"'; ?><?php if ($item['nofollow']) echo ' rel="nofollow"'; ?><?= $item['target'] ?><?php if (!empty($item['subitems'])) echo ' aria-haspopup="true"'; ?>><?= $item['link'] ?>
</a>
<?= $item['subitems'] ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
<?php if ($this->level == 'level_1'): ?>
<li class="search-toggle"><a href="javascript:void(0)"><i class="fa fa-search" aria-hidden="true"></i></a>
<form class="search-form">
<input type="text" class="form-control" placeholder="Suchbegriff eingeben">
<button type="submit" style="display: none">Search</button>
</form>
</li>
<?php endif; ?>
</ul>