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