header.phtml 6.2 KB

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