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