header.phtml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <header class="header">
  2. <div class="item title">
  3. <a href="<?= _url('index', 'index') ?>">
  4. <?php if (FreshRSS_Context::$system_conf->logo_html == '') { ?>
  5. <img class="logo" src="<?= _i('FreshRSS-logo', FreshRSS_Themes::ICON_URL) ?>" alt="FreshRSS" />
  6. <?php
  7. } else {
  8. echo FreshRSS_Context::$system_conf->logo_html;
  9. }
  10. ?>
  11. </a>
  12. </div>
  13. <div class="item search">
  14. <?php if (FreshRSS_Auth::hasAccess() || FreshRSS_Context::$system_conf->allow_anonymous) { ?>
  15. <form action="<?= _url('index', 'index') ?>" method="get">
  16. <div class="stick">
  17. <input type="search" name="search" id="search" class="extend"
  18. value="<?= htmlspecialchars(htmlspecialchars_decode(FreshRSS_Context::$search, ENT_QUOTES), ENT_COMPAT, 'UTF-8') ?>"
  19. placeholder="<?= _t('gen.menu.search') ?>" />
  20. <?php $get = Minz_Request::param('get', ''); ?>
  21. <?php if ($get != '') { ?>
  22. <input type="hidden" name="get" value="<?= $get ?>" />
  23. <?php } ?>
  24. <?php $order = Minz_Request::param('order', ''); ?>
  25. <?php if ($order != '') { ?>
  26. <input type="hidden" name="order" value="<?= $order ?>" />
  27. <?php } ?>
  28. <?php $state = Minz_Request::param('state', ''); ?>
  29. <?php if ($state != '') { ?>
  30. <input type="hidden" name="state" value="<?= $state ?>" />
  31. <?php } ?>
  32. <button class="btn" type="submit"><?= _i('search') ?></button>
  33. </div>
  34. </form>
  35. <?php } ?>
  36. </div>
  37. <?php if (FreshRSS_Auth::hasAccess()) { ?>
  38. <nav class="item configure">
  39. <div class="dropdown">
  40. <div id="dropdown-configure" class="dropdown-target"></div>
  41. <a class="btn dropdown-toggle" href="#dropdown-configure"><?= _i('configure') ?></a>
  42. <ul class="dropdown-menu scrollbar-thin">
  43. <li class="dropdown-header-close"><a class="toggle_aside" href="#close"><?= _i('close') ?></a></li>
  44. <li class="item dropdown-section">
  45. <div class="dropdown-section-title">
  46. <?= _t('gen.menu.account') ?>: <?= htmlspecialchars(Minz_Session::param('currentUser', '_'), ENT_NOQUOTES, 'UTF-8') ?>
  47. </div>
  48. <ul>
  49. <li class="item"><a href="<?= _url('user', 'profile') ?>"><?= _t('gen.menu.user_profile') ?></a></li>
  50. <?php if (FreshRSS_Auth::accessNeedsAction()): ?>
  51. <li class="item"><a class="signout" href="<?= _url('auth', 'logout') ?>"><?= _t('gen.auth.logout'); ?><?= _i('logout') ?></a></li>
  52. <?php else: ?>
  53. <li class="item"><span class="signout">(<?= htmlspecialchars(Minz_Session::param('currentUser', '_'), ENT_NOQUOTES, 'UTF-8') ?>)</span></li>
  54. <?php endif; ?>
  55. </ul>
  56. </li>
  57. <li class="item dropdown-section">
  58. <div class="dropdown-section-title">
  59. <?= _t('gen.menu.configuration') ?>
  60. </div>
  61. <ul>
  62. <li class="item"><a href="<?= _url('configure', 'display') ?>"><?= _t('gen.menu.display') ?></a></li>
  63. <li class="item"><a href="<?= _url('configure', 'reading') ?>"><?= _t('gen.menu.reading') ?></a></li>
  64. <li class="item"><a href="<?= _url('configure', 'archiving') ?>"><?= _t('gen.menu.archiving') ?></a></li>
  65. <li class="item"><a href="<?= _url('configure', 'integration') ?>"><?= _t('gen.menu.sharing') ?></a></li>
  66. <li class="item"><a href="<?= _url('configure', 'shortcut') ?>"><?= _t('gen.menu.shortcuts') ?></a></li>
  67. <li class="item"><a href="<?= _url('configure', 'queries') ?>"><?= _t('gen.menu.queries') ?></a></li>
  68. <li class="item"><a href="<?= _url('extension', 'index') ?>"><?= _t('gen.menu.extensions') ?></a></li>
  69. <?= Minz_ExtensionManager::callHook('menu_configuration_entry') ?>
  70. </ul>
  71. </li>
  72. <?php if (FreshRSS_Auth::hasAccess('admin')) { ?>
  73. <li class="item dropdown-section">
  74. <div class="dropdown-section-title">
  75. <?= _t('gen.menu.admin') ?>
  76. </div>
  77. <ul>
  78. <li class="item"><a href="<?= _url('configure', 'system') ?>"><?= _t('gen.menu.system') ?></a></li>
  79. <li class="item"><a href="<?= _url('user', 'manage') ?>"><?= _t('gen.menu.user_management') ?></a></li>
  80. <li class="item"><a href="<?= _url('auth', 'index') ?>"><?= _t('gen.menu.authentication') ?></a></li>
  81. <li class="item"><a href="<?= _url('update', 'checkInstall') ?>"><?= _t('gen.menu.check_install') ?></a></li>
  82. <?php if (!FreshRSS_Context::$system_conf->disable_update) { ?>
  83. <li class="item"><a href="<?= _url('update', 'index') ?>"><?= _t('gen.menu.update') ?></a></li>
  84. <?php } ?>
  85. <?= Minz_ExtensionManager::callHook('menu_admin_entry') ?>
  86. </ul>
  87. </li>
  88. <?php } ?>
  89. <li class="item dropdown-section">
  90. <ul>
  91. <li class="item"><a href="<?= _url('index', 'logs') ?>"><?= _t('gen.menu.logs') ?></a></li>
  92. <li class="item"><a href="<?= _url('index', 'about') ?>"><?= _t('gen.menu.about') ?></a></li>
  93. <?= Minz_ExtensionManager::callHook('menu_other_entry') ?>
  94. </ul>
  95. </li>
  96. </ul>
  97. <a class="dropdown-close" href="#close">❌</a>
  98. </div>
  99. </nav>
  100. <?php } elseif (FreshRSS_Auth::accessNeedsAction()) { ?>
  101. <div class="item configure">
  102. <a class="signin" href="<?= _url('auth', 'login') ?>"><?= _i('login') ?><?= _t('gen.auth.login') ?></a>
  103. </div>
  104. <?php } ?>
  105. </header>