header.phtml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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" loading="lazy" />
  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"
  18. value="<?= htmlspecialchars(htmlspecialchars_decode(FreshRSS_Context::$search, ENT_QUOTES), ENT_COMPAT, 'UTF-8') ?>"
  19. placeholder="<?= _t('gen.menu.search') ?>" />
  20. <?php $param_a = Minz_Request::actionName(); ?>
  21. <?php if (in_array($param_a, ['normal', 'global', 'reader'])) { ?>
  22. <input type="hidden" name="a" value="<?= $param_a ?>" />
  23. <?php } ?>
  24. <?php $get = Minz_Request::paramString('get'); ?>
  25. <?php if ($get !== '') { ?>
  26. <input type="hidden" name="get" value="<?= $get ?>" />
  27. <?php } ?>
  28. <?php $order = Minz_Request::paramString('order'); ?>
  29. <?php if ($order !== '') { ?>
  30. <input type="hidden" name="order" value="<?= $order ?>" />
  31. <?php } ?>
  32. <?php $state = Minz_Request::paramString('state'); ?>
  33. <?php if ($state !== '') { ?>
  34. <input type="hidden" name="state" value="<?= $state ?>" />
  35. <?php } ?>
  36. <button class="btn" type="submit"><?= _i('search') ?></button>
  37. </div>
  38. </form>
  39. <?php } ?>
  40. </div>
  41. <?php if (FreshRSS_Auth::hasAccess()) { ?>
  42. <nav class="item configure">
  43. <div class="dropdown">
  44. <div id="dropdown-configure" class="dropdown-target"></div>
  45. <a class="btn dropdown-toggle" href="#dropdown-configure"><?= _i('configure') ?></a>
  46. <ul class="dropdown-menu scrollbar-thin">
  47. <li class="dropdown-header-close"><a class="toggle_aside" href="#close"><?= _i('close') ?></a></li>
  48. <li class="item dropdown-section">
  49. <div class="dropdown-section-title">
  50. <?= _t('gen.menu.account') ?>: <?= htmlspecialchars(Minz_User::name() ?? '', ENT_NOQUOTES, 'UTF-8') ?>
  51. </div>
  52. <ul>
  53. <li class="item"><a href="<?= _url('user', 'profile') ?>"><?= _t('gen.menu.user_profile') ?></a></li>
  54. <?php if (FreshRSS_Auth::accessNeedsAction()): ?>
  55. <li class="item"><a class="signout" href="<?= _url('auth', 'logout') ?>"><?= _t('gen.auth.logout'); ?><?= _i('logout') ?></a></li>
  56. <?php else: ?>
  57. <li class="item"><span class="signout">(<?= htmlspecialchars(Minz_User::name() ?? '', ENT_NOQUOTES, 'UTF-8') ?>)</span></li>
  58. <?php endif; ?>
  59. </ul>
  60. </li>
  61. <li class="item dropdown-section">
  62. <div class="dropdown-section-title">
  63. <?= _t('gen.menu.configuration') ?>
  64. </div>
  65. <ul>
  66. <li class="item"><a href="<?= _url('configure', 'display') ?>"><?= _t('gen.menu.display') ?></a></li>
  67. <li class="item"><a href="<?= _url('configure', 'reading') ?>"><?= _t('gen.menu.reading') ?></a></li>
  68. <li class="item"><a href="<?= _url('configure', 'archiving') ?>"><?= _t('gen.menu.archiving') ?></a></li>
  69. <li class="item"><a href="<?= _url('configure', 'integration') ?>"><?= _t('gen.menu.sharing') ?></a></li>
  70. <li class="item"><a href="<?= _url('configure', 'shortcut') ?>"><?= _t('gen.menu.shortcuts') ?></a></li>
  71. <li class="item"><a href="<?= _url('configure', 'queries') ?>"><?= _t('gen.menu.queries') ?></a></li>
  72. <li class="item"><a href="<?= _url('extension', 'index') ?>"><?= _t('gen.menu.extensions') ?></a></li>
  73. <?= Minz_ExtensionManager::callHook('menu_configuration_entry') ?>
  74. </ul>
  75. </li>
  76. <?php if (FreshRSS_Auth::hasAccess('admin')) { ?>
  77. <li class="item dropdown-section">
  78. <div class="dropdown-section-title">
  79. <?= _t('gen.menu.admin') ?>
  80. </div>
  81. <ul>
  82. <li class="item"><a href="<?= _url('configure', 'system') ?>"><?= _t('gen.menu.system') ?></a></li>
  83. <li class="item"><a href="<?= _url('user', 'manage') ?>"><?= _t('gen.menu.user_management') ?></a></li>
  84. <li class="item"><a href="<?= _url('auth', 'index') ?>"><?= _t('gen.menu.authentication') ?></a></li>
  85. <li class="item"><a href="<?= _url('update', 'checkInstall') ?>"><?= _t('gen.menu.check_install') ?></a></li>
  86. <?php if (!FreshRSS_Context::$system_conf->disable_update) { ?>
  87. <li class="item"><a href="<?= _url('update', 'index') ?>"><?= _t('gen.menu.update') ?></a></li>
  88. <?php } ?>
  89. <?= Minz_ExtensionManager::callHook('menu_admin_entry') ?>
  90. </ul>
  91. </li>
  92. <?php } ?>
  93. <li class="item dropdown-section">
  94. <ul>
  95. <li class="item"><a href="<?= _url('index', 'logs') ?>"><?= _t('gen.menu.logs') ?></a></li>
  96. <li class="item"><a href="<?= _url('index', 'about') ?>"><?= _t('gen.menu.about') ?></a></li>
  97. <?php if (file_exists(TOS_FILENAME)) { ?>
  98. <li class="item">
  99. <a href="<?= _url('index', 'tos') ?>"><?= _t('index.tos.title')?></a>
  100. </li>
  101. <?php } ?>
  102. <?= Minz_ExtensionManager::callHook('menu_other_entry') ?>
  103. </ul>
  104. </li>
  105. </ul>
  106. <a class="dropdown-close" href="#close">❌</a>
  107. </div>
  108. </nav>
  109. <?php } elseif (FreshRSS_Auth::accessNeedsAction()) { ?>
  110. <div class="item configure">
  111. <a class="signin" href="<?= _url('auth', 'login') ?>"><?= _i('login') ?><?= _t('gen.auth.login') ?></a>
  112. </div>
  113. <?php } ?>
  114. </header>