layout.phtml 3.4 KB

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