layout.phtml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. declare(strict_types=1);
  3. /** @var FreshRSS_View $this */
  4. FreshRSS::preLayout();
  5. $class = '';
  6. $dir = '';
  7. if (_t('gen.dir') === 'rtl') {
  8. $dir = ' dir="rtl"';
  9. $class = 'rtl ';
  10. }
  11. if (FreshRSS_Context::userConf()->darkMode !== 'no') {
  12. $class .= 'darkMode_' . FreshRSS_Context::userConf()->darkMode;
  13. }
  14. ?>
  15. <!DOCTYPE html>
  16. <html lang="<?= FreshRSS_Context::userConf()->language ?>"<?= $dir ?> xml:lang="<?= FreshRSS_Context::userConf()->language ?>" class="<?= $class ?>">
  17. <head>
  18. <meta charset="UTF-8" />
  19. <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
  20. <?= FreshRSS_View::metaThemeColor() ?>
  21. <?= FreshRSS_View::headStyle() ?>
  22. <script id="jsonVars" type="application/json">
  23. <?php $this->renderHelper('javascript_vars'); ?>
  24. </script>
  25. <?= FreshRSS_View::headScript() ?>
  26. <link rel="manifest" href="<?= Minz_Url::display('/themes/manifest.json') ?>" />
  27. <link rel="shortcut icon" id="favicon" type="image/x-icon" sizes="16x16 64x64" href="<?= Minz_Url::display('/favicon.ico') ?>" />
  28. <link rel="icon msapplication-TileImage apple-touch-icon" type="image/png" sizes="256x256" href="<?= Minz_Url::display('/themes/icons/favicon-256.png') ?>" />
  29. <link rel="apple-touch-icon" href="<?= Minz_Url::display('/themes/icons/apple-touch-icon.png') ?>" />
  30. <meta name="apple-mobile-web-app-capable" content="yes" />
  31. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  32. <meta name="apple-mobile-web-app-title" content="<?= FreshRSS_Context::systemConf()->title ?>">
  33. <meta name="msapplication-TileColor" content="#FFF" />
  34. <meta name="theme-color" content="#FFF" />
  35. <?php if (!FreshRSS_Context::systemConf()->allow_referrer) { ?>
  36. <meta name="referrer" content="never" />
  37. <?php } ?>
  38. <?= FreshRSS_View::headTitle() ?>
  39. <?php
  40. $url_base = Minz_Request::currentRequest();
  41. if ($this->rss_title != '') {
  42. $url_rss = $url_base;
  43. $url_rss['a'] = 'rss';
  44. $url_rss['params']['user'] = Minz_User::name() ?? '';
  45. $url_rss['params']['token'] = FreshRSS_Context::userConf()->token;
  46. unset($url_rss['params']['rid']);
  47. if (FreshRSS_Context::userConf()->since_hours_posts_per_rss) {
  48. $url_rss['params']['hours'] = FreshRSS_Context::userConf()->since_hours_posts_per_rss;
  49. }
  50. ?>
  51. <link rel="alternate" type="application/rss+xml" title="<?= $this->rss_title ?>" href="<?= Minz_Url::display($url_rss) ?>" />
  52. <?php } if (FreshRSS_Context::isAll() || FreshRSS_Context::isCategory() || FreshRSS_Context::isFeed()) {
  53. $opml_rss = $url_base;
  54. $opml_rss['a'] = 'opml';
  55. $opml_rss['params']['user'] = Minz_User::name() ?? '';
  56. $opml_rss['params']['token'] = FreshRSS_Context::userConf()->token;
  57. unset($opml_rss['params']['rid']);
  58. ?>
  59. <link rel="outline" type="text/x-opml" title="OPML" href="<?= Minz_Url::display($opml_rss) ?>" />
  60. <?php } if (FreshRSS_Context::systemConf()->allow_robots) { ?>
  61. <meta name="description" content="<?= htmlspecialchars(FreshRSS_Context::$name . ' | ' . FreshRSS_Context::$description, ENT_COMPAT, 'UTF-8') ?>" />
  62. <?php } else { ?>
  63. <meta name="robots" content="noindex,nofollow" />
  64. <?php } ?>
  65. </head>
  66. <body class="<?= Minz_Request::actionName() ?>">
  67. <?php
  68. if (!Minz_Request::paramBoolean('ajax')) {
  69. flush();
  70. $this->partial('header');
  71. }
  72. ?>
  73. <div id="global">
  74. <?php
  75. flush();
  76. if (isset($this->callbackBeforeFeeds)) {
  77. call_user_func($this->callbackBeforeFeeds, $this);
  78. }
  79. $this->render();
  80. ?>
  81. </div>
  82. <?php
  83. $msg = '';
  84. $status = 'closed';
  85. $notif = Minz_Request::getNotification();
  86. if (!empty($notif)) {
  87. $msg = $notif['content'];
  88. $status = $notif['type'];
  89. invalidateHttpCache();
  90. }
  91. ?>
  92. <div id="notification" class="notification <?= $status ?>">
  93. <span class="msg"><?= $msg ?></span>
  94. <a class="close" href=""><?= _i('close') ?></a>
  95. </div>
  96. </body>
  97. </html>