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