layout.phtml 3.4 KB

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