<!--
main navigation view partial
should only be called by the navigation view helper
-->

<nav class="navbar navbar-default" role="navigation">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navigation-collapse">
            <span class="sr-only"><?php echo $this->_('Toggle navigation'); ?></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="main-navigation-collapse">
        <ul class="nav navbar-nav navbar-right">
            <?php foreach ($this->menu->pages as $page) { ?>
                <?php if ((!$page->settings || (intval($this->settings[(string)$page->settings['name']]) == $page->settings['value'])) ||
                       ($this->navigation()->accept($page))
                ) {
                    ?>
                    <li <?php echo ($page->isActive(true)) ? 'class="active"' : ''; ?>>
                        <a href="<?php echo $this->url($page->params); ?>">
                            <?php echo $page->label; ?>
                        </a>
                    </li>
                <?php } ?>
            <?php } ?>
        </ul>
    </div>
    <!-- /.navbar-collapse -->
</nav>
