header.phtml 6.1 KB

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