header.phtml 5.1 KB

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