layout.phtml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. $url_rss['params']['user'] = Minz_User::name();
  44. $url_rss['params']['token'] = FreshRSS_Context::userConf()->token ?: null;
  45. unset($url_rss['params']['rid']);
  46. if (FreshRSS_Context::userConf()->since_hours_posts_per_rss) {
  47. $url_rss['params']['hours'] = FreshRSS_Context::userConf()->since_hours_posts_per_rss;
  48. }
  49. ?>
  50. <link rel="alternate" type="application/rss+xml" title="<?= $this->rss_title ?>" href="<?= Minz_Url::display($url_rss) ?>" />
  51. <?php } if (FreshRSS_Context::isAll() || FreshRSS_Context::isCategory() || FreshRSS_Context::isFeed()) {
  52. $opml_rss = $url_base;
  53. $opml_rss['a'] = 'opml';
  54. $opml_rss['params']['user'] = Minz_User::name();
  55. $opml_rss['params']['token'] = FreshRSS_Context::userConf()->token ?: null;
  56. unset($opml_rss['params']['rid']);
  57. ?>
  58. <link rel="outline" type="text/x-opml" title="OPML" href="<?= Minz_Url::display($opml_rss) ?>" />
  59. <?php } if (FreshRSS_Context::systemConf()->allow_robots) { ?>
  60. <meta name="description" content="<?= htmlspecialchars(FreshRSS_Context::$name . ' | ' . FreshRSS_Context::$description, ENT_COMPAT, 'UTF-8') ?>" />
  61. <?php } else { ?>
  62. <meta name="robots" content="noindex,nofollow" />
  63. <?php } ?>
  64. </head>
  65. <body class="<?= Minz_Request::actionName() ?>">
  66. <?php
  67. if (!Minz_Request::paramBoolean('ajax')) {
  68. flush();
  69. $this->partial('header');
  70. }
  71. ?>
  72. <div id="global">
  73. <?php
  74. flush();
  75. if (isset($this->callbackBeforeFeeds)) {
  76. call_user_func($this->callbackBeforeFeeds, $this);
  77. }
  78. $this->render();
  79. ?>
  80. </div>
  81. <?php
  82. $msg = '';
  83. $status = 'closed';
  84. $notif = Minz_Request::getNotification();
  85. if (!empty($notif)) {
  86. $msg = $notif['content'];
  87. $status = $notif['type'];
  88. invalidateHttpCache();
  89. }
  90. ?>
  91. <div id="notification" class="notification <?= $status ?>">
  92. <span class="msg"><?= $msg ?></span>
  93. <a class="close" href=""><?= _i('close') ?></a>
  94. </div>
  95. </body>
  96. </html>