layout.phtml 4.0 KB

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