header.phtml 5.4 KB

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