Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

147 行
4.0 KiB

  1. <?php
  2. /**
  3. * @file view/theme/frio/php/modes/default.php
  4. * @brief The default site template
  5. */
  6. ?>
  7. <!DOCTYPE html >
  8. <?php
  9. use Friendica\Core\Config;
  10. use Friendica\DI;
  11. use Friendica\Model\Profile;
  12. require_once 'view/theme/frio/php/frio_boot.php';
  13. // $minimal = is_modal();
  14. if (!isset($minimal)) {
  15. $minimal = false;
  16. }
  17. $basepath = DI::baseUrl()->getUrlPath() ? "/" . DI::baseUrl()->getUrlPath() . "/" : "/";
  18. $frio = "view/theme/frio";
  19. $view_mode_class = (DI::mode()->isMobile() || DI::mode()->isMobile()) ? 'mobile-view' : 'desktop-view';
  20. $is_singleuser = Config::get('system', 'singleuser');
  21. $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser";
  22. ?>
  23. <html>
  24. <head>
  25. <title><?php if (!empty($page['title'])) echo $page['title'] ?></title>
  26. <meta request="<?php echo htmlspecialchars($_REQUEST['pagename'] ?? '') ?>">
  27. <script type="text/javascript">var baseurl = "<?php echo DI::baseUrl(); ?>";</script>
  28. <script type="text/javascript">var frio = "<?php echo 'view/theme/frio'; ?>";</script>
  29. <?php
  30. // Because we use minimal for modals the header and the included js stuff should be only loaded
  31. // if the page is an standard page (so we don't have it twice for modals)
  32. //
  33. /// @todo Think about to move js stuff in the footer
  34. if (!$minimal && !empty($page['htmlhead'])) {
  35. echo $page['htmlhead'];
  36. }
  37. // Add the theme color meta
  38. // It makes mobile Chrome UI match Frio's top bar color.
  39. $uid = Profile::getThemeUid($a);
  40. $scheme = DI::pConfig()->get($uid, 'frio', 'scheme', DI::pConfig()->get($uid, 'frio', 'schema'));
  41. if ($scheme && is_string($scheme) && $scheme != '---') {
  42. if (file_exists('view/theme/frio/scheme/' . $scheme . '.php')) {
  43. $schemefile = 'view/theme/frio/scheme/' . $scheme . '.php';
  44. require_once $schemefile;
  45. }
  46. } else {
  47. $nav_bg = DI::pConfig()->get($uid, 'frio', 'nav_bg');
  48. }
  49. if (empty($nav_bg)) {
  50. $nav_bg = Config::get('frio', 'nav_bg');
  51. }
  52. if (empty($nav_bg) || !is_string($nav_bg)) {
  53. $nav_bg = "#708fa0";
  54. }
  55. echo '<meta name="theme-color" content="' . $nav_bg . '" />';
  56. ?>
  57. </head>
  58. <body id="top" class="mod-<?php echo DI::module()->getName() . " " . $is_singleuser_class . " " . $view_mode_class;?>">
  59. <a href="#content" class="sr-only sr-only-focusable">Skip to main content</a>
  60. <?php
  61. if (!empty($page['nav']) && !$minimal) {
  62. echo str_replace(
  63. "~config.sitename~",
  64. Config::get('config', 'sitename'),
  65. str_replace(
  66. "~system.banner~",
  67. Config::get('system', 'banner'),
  68. $page['nav']
  69. )
  70. );
  71. };
  72. // special minimal style for modal dialogs
  73. if ($minimal) {
  74. ?>
  75. <!-- <?php echo __FILE__ ?> -->
  76. <section class="minimal">
  77. <?php if (!empty($page['content'])) echo $page['content']; ?>
  78. <div id="page-footer"></div>
  79. </section>
  80. <?php
  81. } else {
  82. // the style for all other pages
  83. ?>
  84. <main>
  85. <div class="container">
  86. <div class="row">
  87. <?php
  88. if ((empty($_REQUEST['pagename']) || $_REQUEST['pagename'] != "lostpass") && ($_SERVER['REQUEST_URI'] != $basepath)) {
  89. echo '
  90. <aside class="col-lg-3 col-md-3 offcanvas-sm offcanvas-xs">';
  91. if (!empty($page['aside'])) {
  92. echo $page['aside'];
  93. }
  94. if (!empty($page['right_aside'])) {
  95. echo $page['right_aside'];
  96. }
  97. echo '
  98. </aside>
  99. <div class="col-lg-7 col-md-7 col-sm-12 col-xs-12" id="content">
  100. <section class="sectiontop ';
  101. echo $a->argv[0];
  102. echo '-content-wrapper">';
  103. if (!empty($page['content'])) {
  104. echo $page['content'];
  105. }
  106. echo '
  107. <div id="pause"></div> <!-- The pause/resume Ajax indicator -->
  108. </section>
  109. </div>
  110. ';
  111. } else {
  112. echo '
  113. <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="content" style="margin-top:50px;">';
  114. if (!empty($page['content'])) {
  115. echo $page['content'];
  116. }
  117. echo '
  118. </div>
  119. ';
  120. }
  121. ?>
  122. </div><!--row-->
  123. </div><!-- container -->
  124. <div id="back-to-top" title="back to top">&#8679;</div>
  125. </main>
  126. <footer>
  127. <?php echo $page['footer'] ?? ''; ?>
  128. </footer>
  129. <?php } ?> <!-- End of condition if $minimal else the rest -->
  130. </body>