layout.phtml 3.4 KB

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