3 * @copyright Copyright (C) 2010-2022, the Friendica project
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/theme.php';
31 require_once 'view/theme/frio/php/frio_boot.php';
33 // $minimal = is_modal();
34 if (!isset($minimal)) {
38 $basepath = DI::baseUrl()->getUrlPath() ? "/" . DI::baseUrl()->getUrlPath() . "/" : "/";
39 $frio = "view/theme/frio";
40 $view_mode_class = (DI::mode()->isMobile() || DI::mode()->isMobile()) ? 'mobile-view' : 'desktop-view';
41 $is_singleuser = DI::config()->get('system', 'singleuser');
42 $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser";
46 <title><?php if (!empty($page['title'])) echo $page['title'] ?></title>
47 <meta request="<?php echo htmlspecialchars($_REQUEST['pagename'] ?? '') ?>">
48 <script type="text/javascript">var baseurl = "<?php echo DI::baseUrl(); ?>";</script>
49 <script type="text/javascript">var frio = "<?php echo 'view/theme/frio'; ?>";</script>
51 // Because we use minimal for modals the header and the included js stuff should be only loaded
52 // if the page is an standard page (so we don't have it twice for modals)
54 /// @todo Think about to move js stuff in the footer
55 if (!$minimal && !empty($page['htmlhead'])) {
56 echo $page['htmlhead'];
59 // Add the theme color meta
60 // It makes mobile Chrome UI match Frio's top bar color.
61 $uid = Profile::getThemeUid($a);
62 $scheme = DI::pConfig()->get($uid, 'frio', 'scheme', DI::pConfig()->get($uid, 'frio', 'schema'));
63 if ($scheme && is_string($scheme) && $scheme != '---') {
64 if (file_exists('view/theme/frio/scheme/' . $scheme . '.php')) {
65 $schemefile = 'view/theme/frio/scheme/' . $scheme . '.php';
67 DI::pConfig()->get($uid, 'frio', 'scheme_accent') ?:
68 DI::config()->get('frio', 'scheme_accent') ?: FRIO_SCHEME_ACCENT_BLUE;
70 require_once $schemefile;
74 $nav_bg = $nav_bg ?? DI::pConfig()->get($uid, 'frio', 'nav_bg', DI::config()->get('frio', 'nav_bg', '#708fa0'));
76 echo '<meta name="theme-color" content="' . $nav_bg . '" />';
80 <body id="top" class="mod-<?php echo DI::args()->getModuleName() . " " . $is_singleuser_class . " " . $view_mode_class;?>">
81 <a href="#content" class="sr-only sr-only-focusable"><?php echo DI::l10n()->t('Skip to main content'); ?></a>
83 if (!empty($page['nav']) && !$minimal) {
86 DI::config()->get('config', 'sitename'),
89 DI::config()->get('system', 'banner'),
95 // special minimal style for modal dialogs
98 <!-- <?php echo __FILE__ ?> -->
99 <section class="minimal">
100 <?php if (!empty($page['content'])) echo $page['content']; ?>
101 <div id="page-footer"></div>
105 // the style for all other pages
108 <div class="container">
111 if ((empty($_REQUEST['pagename']) || $_REQUEST['pagename'] != "lostpass") && ($_SERVER['REQUEST_URI'] != $basepath)) {
113 <aside class="col-lg-3 col-md-3 offcanvas-sm offcanvas-xs">';
115 if (!empty($page['aside'])) {
119 if (!empty($page['right_aside'])) {
120 echo $page['right_aside'];
126 <div class="col-lg-7 col-md-7 col-sm-12 col-xs-12" id="content">
127 <section class="sectiontop ';
128 echo DI::args()->get(0, 'generic');
129 echo '-content-wrapper">';
130 if (!empty($page['content'])) {
131 echo $page['content'];
134 <div id="pause"></div> <!-- The pause/resume Ajax indicator -->
140 <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="content" style="margin-top:50px;">';
141 if (!empty($page['content'])) {
142 echo $page['content'];
150 </div><!-- container -->
152 <div id="back-to-top" title="<?php echo DI::l10n()->t('Back to top')?>">⇧</div>
156 <?php echo $page['footer'] ?? ''; ?>
158 <?php } ?> <!-- End of condition if $minimal else the rest -->