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