<?php
if(!defined('APPLICATION_VERSION')){
    die("Permission denied!");
}
?>
<nav id="nav-menu" class="navbar navbar-default">
  <div class="container-fluid">
    <div id="nav-menu-header" class="navbar-header">
      <a id="nav-app-title" class="navbar-brand" href="#"><?php echo APPLICATION_NAME;?></a>
    </div>
    <ul id="nav-buttons" class="nav navbar-nav">
        <?php
            foreach($route::getModules()['modules'] as $page) {
                $class = $module === $page['url'] ? 'class="active"' : '';
                echo '<li id="nav-button-'.$page['url'].'" ' . $class . '><a  href="' . $page['url'] . '">{{ "main.menu.' . $page['name'] . '" | translate }}</a></li>';
            }
        ?>
    </ul>
    <ul id="nav-right" class="nav navbar-nav navbar-right">
        <?php
        if($user->getUserType() === USER_TYPES['CUSTOMER']){
            require_once('templates/ShopCartIconTemplate.php');
        }
        ?>
        <li><a><translate-main ng-controller="translateCtrl"></translate-main></a></li>
        <li id="nav-settings">
            <a href="profileSettings">
                <span class="glyphicon glyphicon-user"></span><?php echo ' ' . $user->getUserFullName() . ' (' . $user->getUserType() . ')';?>
                <span class='glyphicon glyphicon-cog'></span>
            </a>
        </li>
        <li id="nav-logout">
            <a href="logout.php"><span class="glyphicon glyphicon-log-out"></span> {{ 'main.LOGOUT' | translate }}</a>
        </li>
    </ul>
  </div>
</nav>
