top.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. $listMenu = [];
  3. // $listMenu[] = [ 'label' => "Faktury", 'url' => "index.php?_route=ViewTableAjax&namespace=default_db/api_produkty_103075_view", 'ns' => "default_db/api_produkty_103075_view" ];
  4. $activeViewTableNS = ('ViewTableAjax' === V::get('_route', '', $_GET)) ? V::get('namespace', '', $_GET) : '';
  5. $changePassLink = 'index.php?_route=UrlAction_RemindPasswd';
  6. // $changePassLink = 'index.php?_route=UrlAction_ChangePassword'; // TODO
  7. ?>
  8. <nav class="navbar navbar-inverse" style="border-radius:0">
  9. <div class="container-fluid">
  10. <div class="navbar-header">
  11. <a href="index.php" class="navbar-brand" style="padding:2px">
  12. <img src="<?= $this->asset("assets/logo-biall-net.png"); ?>" alt="BIALL-NET" style="height:46px"/>
  13. </a>
  14. </div>
  15. <div class="collapse navbar-collapse">
  16. <?= UI::h('ul', [ 'class' => "nav navbar-nav" ], array_map(function ($itemMenu) use ($activeViewTableNS) {
  17. $ns = $itemMenu['ns'];
  18. return UI::h('li', array_merge(
  19. [],
  20. (!empty($activeViewTableNS) && $ns === $activeViewTableNS) ? [ 'class' => "active" ] : []
  21. ), [
  22. UI::h('a', [ 'href' => $itemMenu['url'] ], $itemMenu['label']),
  23. ]);
  24. }, $listMenu)); ?>
  25. <div class="navbar-form navbar-right">
  26. <div class="btn-group">
  27. <button type="button" class="btn btn-link" style="margin:0; padding:6px 8px 4px 8px;"><?php S::show_session_timer(); ?></button>
  28. <div class="btn-group">
  29. <button id="ProcesMenuLoginDropdownLink" type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><?= User::getName(); ?> <span class="caret"></span></button>
  30. <ul class="dropdown-menu" role="menu">
  31. <li><a href="<?= $changePassLink; ?>"><i class="glyphicon glyphicon-lock"></i> Zmień hasło</a></li>
  32. <li class="divider"></li>
  33. <li><a href="index.php?LOGIN=LOGOUT"><i class="glyphicon glyphicon-off"></i> Wyloguj</a></li>
  34. </ul>
  35. </div>
  36. <div class="btn-group">
  37. <a class="btn btn-link" href="index.php?LOGIN=LOGOUT"><i class="glyphicon glyphicon-off"></i> Wyloguj</a>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </nav>