]> git.mxchange.org Git - friendica.git/blob - view/theme/frio/php/default.php
Add more references to theme.php
[friendica.git] / view / theme / frio / php / default.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2020, Friendica
4  *
5  * @license GNU AGPL version 3 or any later version
6  *
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.
11  *
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.
16  *
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/>.
19  *
20  * The default site template
21  */
22
23 ?>
24 <!DOCTYPE html >
25 <?php
26
27 use Friendica\DI;
28 use Friendica\Model\Profile;
29
30 require_once 'view/theme/frio/theme.php';
31 require_once 'view/theme/frio/php/frio_boot.php';
32
33 //      $minimal = is_modal();
34 if (!isset($minimal)) {
35         $minimal = false;
36 }
37
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";
43 ?>
44 <html>
45         <head>
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>
50 <?php
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)
53                 //
54                 /// @todo Think about to move js stuff in the footer
55                 if (!$minimal && !empty($page['htmlhead'])) {
56                         echo $page['htmlhead'];
57                 }
58
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';
66                                 require_once $schemefile;
67                         }
68                 } else {
69                         $nav_bg = DI::pConfig()->get($uid, 'frio', 'nav_bg');
70                 }
71
72                 if (empty($nav_bg)) {
73                         $nav_bg = DI::config()->get('frio', 'nav_bg');
74                 }
75
76                 if (empty($nav_bg) || !is_string($nav_bg)) {
77                         $nav_bg = "#708fa0";
78                 }
79
80                 echo '<meta name="theme-color" content="' . $nav_bg . '" />';
81 ?>
82         </head>
83
84         <body id="top" class="mod-<?php echo DI::module()->getName() . " " . $is_singleuser_class . " " . $view_mode_class;?>">
85                 <a href="#content" class="sr-only sr-only-focusable"><?php echo DI::l10n()->t('Skip to main content'); ?></a>
86 <?php
87         if (!empty($page['nav']) && !$minimal) {
88                 echo str_replace(
89                         "~config.sitename~",
90                         DI::config()->get('config', 'sitename'),
91                         str_replace(
92                                 "~system.banner~",
93                                 DI::config()->get('system', 'banner'),
94                                 $page['nav']
95                         )
96                 );
97         };
98
99         // special minimal style for modal dialogs
100         if ($minimal) {
101 ?>
102                 <!-- <?php echo __FILE__ ?> -->
103                 <section class="minimal">
104                         <?php if (!empty($page['content'])) echo $page['content']; ?>
105                         <div id="page-footer"></div>
106                 </section>
107 <?php
108         } else {
109                 // the style for all other pages
110 ?>
111                 <main>
112                         <div class="container">
113                                 <div class="row">
114 <?php
115                                 if ((empty($_REQUEST['pagename']) || $_REQUEST['pagename'] != "lostpass") && ($_SERVER['REQUEST_URI'] != $basepath)) {
116                                         echo '
117                                         <aside class="col-lg-3 col-md-3 offcanvas-sm offcanvas-xs">';
118
119                                                 if (!empty($page['aside'])) {
120                                                         echo $page['aside'];
121                                                 }
122
123                                                 if (!empty($page['right_aside'])) {
124                                                         echo $page['right_aside'];
125                                                 }
126
127                                                 echo '
128                                         </aside>
129
130                                         <div class="col-lg-7 col-md-7 col-sm-12 col-xs-12" id="content">
131                                                 <section class="sectiontop ';
132                                                         echo $a->argv[0];
133                                                         echo '-content-wrapper">';
134                                                         if (!empty($page['content'])) {
135                                                                 echo $page['content'];
136                                                         }
137                                                         echo '
138                                                         <div id="pause"></div> <!-- The pause/resume Ajax indicator -->
139                                                 </section>
140                                         </div>
141                                                 ';
142                                 } else {
143                                         echo '
144                                         <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="content" style="margin-top:50px;">';
145                                                 if (!empty($page['content'])) {
146                                                         echo $page['content'];
147                                                 }
148                                                 echo '
149                                         </div>
150                                         ';
151                                 }
152 ?>
153                                 </div><!--row-->
154                         </div><!-- container -->
155
156                         <div id="back-to-top" title="back to top">&#8679;</div>
157                 </main>
158
159                 <footer>
160                         <?php echo $page['footer'] ?? ''; ?>
161                 </footer>
162 <?php } ?> <!-- End of condition if $minimal else the rest -->
163         </body>