]> git.mxchange.org Git - friendica.git/blob - view/theme/frio/php/default.php
99baa8efc8c03450942ff16f0277ed4ad1addaf7
[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 <html>
23         <head>
24                 <title><?php if (!empty($page['title'])) echo $page['title'] ?></title>
25                 <meta request="<?php echo htmlspecialchars(defaults($_REQUEST, 'pagename', '')) ?>">
26                 <script  type="text/javascript">var baseurl = "<?php echo System::baseUrl(); ?>";</script>
27                 <script type="text/javascript">var frio = "<?php echo 'view/theme/frio'; ?>";</script>
28 <?php
29                 $basepath = $a->path ? "/" . $a->path . "/" : "/";
30                 $frio = "view/theme/frio";
31
32                 // Because we use minimal for modals the header and the included js stuff should be only loaded
33                 // if the page is an standard page (so we don't have it twice for modals)
34                 //
35                 /// @todo Think about to move js stuff in the footer
36                 if (!$minimal && x($page, 'htmlhead')) {
37                         echo $page['htmlhead'];
38                 }
39
40                 // Add the theme color meta
41                 // It makes mobile Chrome UI match Frio's top bar color.
42                 $uid = $a->profile_uid;
43                 if (is_null($uid)) {
44                         $uid = Profile::getThemeUid();
45                 }
46                 $scheme = PConfig::get($uid, 'frio', 'scheme', PConfig::get($uid, 'frio', 'schema'));
47                 if (($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                 if (!$nav_bg) {
56                         $nav_bg = "#708fa0";
57                 }
58                 echo '
59                         <meta name="theme-color" content="' . $nav_bg . '" />';
60
61                 $is_singleuser = Config::get('system','singleuser');
62                 $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser";
63 ?>
64         </head>
65
66         <body id="top" class="mod-<?php echo $a->module." ".$is_singleuser_class;?>">
67                 <a href="#content" class="sr-only sr-only-focusable">Skip to main content</a>
68 <?php
69         if (x($page, 'nav') && !$minimal) {
70                 echo str_replace(
71                         "~config.sitename~",
72                         Config::get('config', 'sitename'),
73                         str_replace(
74                                 "~system.banner~",
75                                 Config::get('system', 'banner'),
76                                 $page['nav']
77                         )
78                 );
79         };
80
81         // special minimal style for modal dialogs
82         if ($minimal) {
83 ?>
84                 <section class="minimal" style="margin:0px!important; padding:0px!important; float:none!important;display:block!important;">
85                         <?php if (x($page, 'content')) echo $page['content']; ?>
86                         <div id="page-footer"></div>
87                 </section>
88 <?php
89         } else {
90                 // the style for all other pages
91 ?>
92                 <main>
93                         <div class="container">
94                                 <div class="row">
95 <?php
96                                 if ((!x($_REQUEST, 'pagename') || $_REQUEST['pagename'] != "lostpass") && ($_SERVER['REQUEST_URI'] != $basepath)) {
97                                         echo '
98                                         <aside class="col-lg-3 col-md-3 offcanvas-sm offcanvas-xs">';
99
100                                                 if (x($page, 'aside')) {
101                                                         echo $page['aside'];
102                                                 }
103
104                                                 if (x($page, 'right_aside')) {
105                                                         echo $page['right_aside'];
106                                                 }
107
108                                                 echo '
109                                         </aside>
110
111                                         <div class="col-lg-7 col-md-7 col-sm-12 col-xs-12" id="content">
112                                                 <section class="sectiontop ';
113                                                         echo $a->argv[0];
114                                                         echo '-content-wrapper">';
115                                                         if (x($page, 'content')) {
116                                                                 echo $page['content'];
117                                                         }
118                                                         echo '
119                                                         <div id="pause"></div> <!-- The pause/resume Ajax indicator -->
120                                                 </section>
121                                         </div>
122                                                 ';
123                                 } else {
124                                         echo '
125                                         <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="content" style="margin-top:50px;">';
126                                                 if (x($page, 'content')) {
127                                                         echo $page['content'];
128                                                 }
129                                                 echo '
130                                         </div>
131                                         ';
132                                 }
133 ?>
134                                 </div><!--row-->
135                         </div><!-- container -->
136
137                         <div id="back-to-top" title="back to top">&#8679;</div>
138                 </main>
139
140                 <footer>
141                         <?php if (x($page, 'footer')) echo $page['footer']; ?>
142                         <!-- Modal  -->
143                         <div id="modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
144                                 <div class="modal-dialog modal-full-screen">
145                                         <div class="modal-content">
146                                                 <div id="modal-header" class="modal-header">
147                                                         <button id="modal-cloase" type="button" class="close" data-dismiss="modal" aria-hidden="true">
148                                                                 &times;
149                                                         </button>
150                                                         <h4 id="modal-title" class="modal-title"></h4>
151                                                 </div>
152                                                 <div id="modal-body" class="modal-body">
153                                                         <!-- /# content goes here -->
154                                                 </div>
155                                         </div>
156                                 </div>
157                         </div>
158
159                         <!-- Dummy div to append other div's when needed (e.g. used for js function editpost() -->
160                         <div id="cache-container"></div>
161
162                 </footer>
163 <?php } ?> <!-- End of condition if $minimal else the rest -->
164         </body>