3 * @copyright Copyright (C) 2020, Friendica
5 * @license GNU AGPL version 3 or any later version
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 * The default site template
28 use Friendica\Model\Profile;
30 require_once 'view/theme/frio/php/frio_boot.php';
32 // $minimal = is_modal();
33 if (!isset($minimal)) {
37 $basepath = DI::baseUrl()->getUrlPath() ? "/" . DI::baseUrl()->getUrlPath() . "/" : "/";
38 $frio = "view/theme/frio";
39 $view_mode_class = (DI::mode()->isMobile() || DI::mode()->isMobile()) ? 'mobile-view' : 'desktop-view';
40 $is_singleuser = DI::config()->get('system', 'singleuser');
41 $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser";
45 <title><?php if (!empty($page['title'])) echo $page['title'] ?></title>
46 <meta request="<?php echo htmlspecialchars($_REQUEST['pagename'] ?? '') ?>">
47 <script type="text/javascript">var baseurl = "<?php echo DI::baseUrl(); ?>";</script>
48 <script type="text/javascript">var frio = "<?php echo 'view/theme/frio'; ?>";</script>
50 // Because we use minimal for modals the header and the included js stuff should be only loaded
51 // if the page is an standard page (so we don't have it twice for modals)
53 /// @todo Think about to move js stuff in the footer
54 if (!$minimal && !empty($page['htmlhead'])) {
55 echo $page['htmlhead'];
58 // Add the theme color meta
59 // It makes mobile Chrome UI match Frio's top bar color.
60 $uid = Profile::getThemeUid($a);
61 $scheme = DI::pConfig()->get($uid, 'frio', 'scheme', DI::pConfig()->get($uid, 'frio', 'schema'));
62 if ($scheme && is_string($scheme) && $scheme != '---') {
63 if (file_exists('view/theme/frio/scheme/' . $scheme . '.php')) {
64 $schemefile = 'view/theme/frio/scheme/' . $scheme . '.php';
65 require_once $schemefile;
68 $nav_bg = DI::pConfig()->get($uid, 'frio', 'nav_bg');
72 $nav_bg = DI::config()->get('frio', 'nav_bg');
75 if (empty($nav_bg) || !is_string($nav_bg)) {
79 echo '<meta name="theme-color" content="' . $nav_bg . '" />';
83 <body id="top" class="mod-<?php echo DI::module()->getName() . " " . $is_singleuser_class . " " . $view_mode_class;?>">
84 <a href="#content" class="sr-only sr-only-focusable"><?php echo DI::l10n()->t('Skip to main content'); ?></a>
86 if (!empty($page['nav']) && !$minimal) {
89 DI::config()->get('config', 'sitename'),
92 DI::config()->get('system', 'banner'),
98 // special minimal style for modal dialogs
101 <!-- <?php echo __FILE__ ?> -->
102 <section class="minimal">
103 <?php if (!empty($page['content'])) echo $page['content']; ?>
104 <div id="page-footer"></div>
108 // the style for all other pages
111 <div class="container">
114 if ((empty($_REQUEST['pagename']) || $_REQUEST['pagename'] != "lostpass") && ($_SERVER['REQUEST_URI'] != $basepath)) {
116 <aside class="col-lg-3 col-md-3 offcanvas-sm offcanvas-xs">';
118 if (!empty($page['aside'])) {
122 if (!empty($page['right_aside'])) {
123 echo $page['right_aside'];
129 <div class="col-lg-7 col-md-7 col-sm-12 col-xs-12" id="content">
130 <section class="sectiontop ';
132 echo '-content-wrapper">';
133 if (!empty($page['content'])) {
134 echo $page['content'];
137 <div id="pause"></div> <!-- The pause/resume Ajax indicator -->
143 <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="content" style="margin-top:50px;">';
144 if (!empty($page['content'])) {
145 echo $page['content'];
153 </div><!-- container -->
155 <div id="back-to-top" title="back to top">⇧</div>
159 <?php echo $page['footer'] ?? ''; ?>
161 <?php } ?> <!-- End of condition if $minimal else the rest -->