<script src="app/view/js/Menu.js"></script>
<nav class="navbar navbar-default navbar-fixed-top" style="background-color: #149bdf;">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
              <span class="sr-only">Toggle navigation</span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
          </button>
            <a class="navbar-brand" href="#/default"><img src="imgs/logo-atos.png" width="100" /></a>
        </div>
        <div style="height: 1px;" aria-expanded="false" id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav">  
             <script type="text/javascript">
                function f(filhos){
                   if(typeof filhos === 'object'){
                       window.document.write('<ul class="dropdown-menu">');
                       for(var c in filhos){
                            if(typeof filhos[c].Filhos == 'object'){
                                window.document.write('<li class="menu-item dropdown dropdown-submenu">');
                                window.document.write('<a href="" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'+filhos[c].Nome+'</a>');
                                f(filhos[c].Filhos);
                                window.document.write('</li>');
                                //window.document.write('<li class="divider"></li>');
                            }else{
                                window.document.write('<li><a href="'+filhos[c].Link+'">'+filhos[c].Nome+'</a></li>');
                                f(filhos[c].Filhos);
                            }
                       }
                       window.document.write('</ul>');
                   } 
                }

                if(typeof Menus === 'object'){
                    Menus.forEach(function(menu){
                       window.document.write('<li class=""menu-item dropdown">');
                       window.document.write('<a href="" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'+menu.Nome+'</a>');
                       f(menu.Filhos, 1);
                       window.document.write('</li>');
                    });
                }
          </script>
          </ul>
          <!--/ Menu -->
          <style>
            ul{
                list-style: none;
            }
          </style>
          <div>
            <ul class="nav navbar-nav navbar-right menu-modulo">
                <!-- Seleção de Modulos -->
                <li id="modulos" class="dropdown">
                    <a href="" class="dropdown-toggle well-modulos " data-toggle="dropdown"><?php echo $this->login->ModuloAtual->Nome;?></a>
                  <ul class="dropdown-menu dropdown-menu-right">
                      <?php if(is_array($this->login->Modulos)){
                                foreach($this->login->Modulos as $modulo){ 
                                    if($modulo['id'] != $this->login->ModuloAtual->id){?>
                      <li class="menu-item">
                          <a href="#/Modulo/mudarModuloAtual/<?php echo $modulo['id'];?>"><?php echo $modulo['Nome']; ?></a>
                      </li>
                    <?php }
                        }
                     } ?>
                  </ul>
                </li>
                <!--/. Seleção de modulos -->
                <li class="dropdown">
                    <a href="" class="dropdown-toggle" style="color:#FFF;" data-toggle="dropdown"><!--<img src="imgs/avatar-masc.png" width="40" />--> <i class="fa fa-user" aria-hidden="true"></i> <?php echo $this->login->Nome;?> <span class="caret"></span></a>
                    <ul class="dropdown-menu dropdown-menu-right dropdown-user">
                        <li>
                            <a href="#"><i class="fa fa-user fa-fw"></i> Perfil</a>
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-gear fa-fw"></i> Configurações</a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="?secao=sair"><i class="fa fa-sign-out fa-fw"></i> Sair</a>
                        </li>
                    </ul>
                </li>
            </ul>
          </div>
        </div><!--/.nav-collapse -->
      </div>
    </nav>

<!-- Dependencias Gerais -->
<script src="libs/angular/angular.min.js"></script>
<script src="libs/angular-route/angular-route.min.js"></script>
<script src="libs/angular-messages/angular-messages.min.js"></script>
<script src="libs/angular-auto-validate/dist/jcs-auto-validate.js"></script>
<script src="libs/ladda/dist/spin.min.js"></script>
<script src="libs/ladda/dist/ladda.min.js"></script>
<script src="libs/angular-ladda/dist/angular-ladda.min.js"></script>
<script src="app/view/js/bootstrap.min.js"></script>

<script src="app/view/js/ng/app-sisatos.js"></script>
<script src="app/view/js/ng/app-config.js"></script>
<script src="app/view/js/ng/app-controllers.js"></script>


<!--./ Dependecias Gerais -->
<br clear="all" />

<div id="conteudo" class="container" ng-view> 