menu.php 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. /**
  3. * Bibliotheca
  4. *
  5. * Copyright 2018-2024 Johannes Keßler
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0.
  19. */
  20. ## optional context action
  21. # the key has to match the column contextaction of the menuentry
  22. # $_collection comes from the $Viewscript
  23. $_contextActions = array();
  24. if(!empty($_collection)) {
  25. $_contextActions['collection'] = $_collection;
  26. }
  27. $_menuShow = $Gorenest->get('show');
  28. $_menuManage = $Gorenest->get('manage', false, $_contextActions);
  29. ?>
  30. <nav class="uk-container uk-container-expand uk-navbar-container" uk-navbar>
  31. <div class="uk-navbar-left">
  32. <ul class="uk-navbar-nav">
  33. <li class="uk-parent">
  34. <a href=""><?php echo $I18n->t('menu.show'); ?></a>
  35. <div class="uk-navbar-dropdown">
  36. <ul class="uk-nav uk-navbar-dropdown-nav">
  37. <?php foreach($_menuShow as $entry) { ?>
  38. <li>
  39. <a href="index.php?p=<?php echo $entry['action']; ?>">
  40. <span class="uk-icon uk-margin-small-right" uk-icon="icon: <?php echo $entry['icon']; ?>"></span>
  41. <?php echo $I18n->t($entry['text']); ?>
  42. </a>
  43. </li>
  44. <?php } ?>
  45. </ul>
  46. </div>
  47. </li>
  48. <?php if(!empty($_menuManage)) { ?>
  49. <li class="uk-parent">
  50. <a href=""><?php echo $I18n->t('menu.manage'); ?></a>
  51. <div class="uk-navbar-dropdown">
  52. <ul class="uk-nav uk-navbar-dropdown-nav">
  53. <?php foreach($_menuManage as $entry) { ?>
  54. <li>
  55. <a href="index.php?p=<?php echo $entry['action']; ?>">
  56. <span class="uk-icon uk-margin-small-right" uk-icon="icon: <?php echo $entry['icon']; ?>"></span>
  57. <?php echo $I18n->t($entry['text']); ?>
  58. </a>
  59. </li>
  60. <?php } ?>
  61. </ul>
  62. </div>
  63. </li>
  64. <?php } ?>
  65. <li>
  66. <a href="index.php?p=auth">
  67. <?php if($Doomguy->isSignedIn() === true) {
  68. echo $I18n->t('auth.logout');
  69. }
  70. else { echo $I18n->t('global.login'); } ?>
  71. </a>
  72. </li>
  73. </ul>
  74. </div>
  75. <div class="uk-navbar-right">
  76. <div>
  77. <a class="uk-navbar-toggle" uk-search-icon href="#"></a>
  78. <div class="uk-drop" uk-drop="mode: click; pos: left-center; offset: 0">
  79. <form class="uk-search uk-search-navbar uk-width-1-1" method="get" action="index.php">
  80. <?php
  81. if(isset($TemplateData['navSearchAction'])) {
  82. foreach($TemplateData['navSearchAction'] as $param=>$pValue) {
  83. echo '<input type="hidden" name="'.$param.'" value="'.$pValue.'" />';
  84. }
  85. }
  86. ?>
  87. <input class="uk-search-input" type="search" placeholder="<?php echo $I18n->t('menu.search'); ?>" name="navSearch" autofocus>
  88. <small><a href="index.php?p=advancedsearch"><?php echo $I18n->t('menu.search.advanced'); ?></a></small>
  89. </form>
  90. </div>
  91. </div>
  92. </div>
  93. </nav>