]> git.mxchange.org Git - friendica.git/blob - view/theme/frio/php/default.php
ee3b745416f014eb72e892f3d0cf3711a6e2372e
[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 (x($page, 'title')) echo $page['title'] ?></title>
25                 <meta request="<?php echo htmlspecialchars($_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                 $baseurl = System::baseUrl();
30                 $basepath = $a->path ? "/" . $a->path . "/" : "/";
31                 $frio = "view/theme/frio";
32
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 && x($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 = $a->profile_uid;
44                 if (is_null($uid)) {
45                         $uid = Profile::getThemeUid();
46                 }
47                 $schema = PConfig::get($uid, 'frio', 'schema');
48                 if (($schema) && ($schema != '---')) {
49                         if (file_exists('view/theme/frio/schema/' . $schema . '.php')) {
50                                 $schemefile = 'view/theme/frio/schema/' . $schema . '.php';
51                                 require_once $schemefile;
52                         }
53                 } else {
54                         $nav_bg = PConfig::get($uid, 'frio', 'nav_bg');
55                 }
56                 if (!$nav_bg) {
57                         $nav_bg = "#708fa0";
58                 }
59                 echo '
60                         <meta name="theme-color" content="' . $nav_bg . '" />';
61
62                 $is_singleuser = Config::get('system','singleuser');
63                 $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser";
64 ?>
65         </head>
66
67         <body id="top" class="mod-<?php echo $a->module." ".$is_singleuser_class;?>">
68                 <a href="#content" class="sr-only sr-only-focusable">Skip to main content</a>
69 <?php
70         if (x($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                 <section class="minimal" style="margin:0px!important; padding:0px!important; float:none!important;display:block!important;">
86                         <?php if (x($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 ((!x($_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 (x($page, 'aside')) {
102                                                         echo $page['aside'];
103                                                 }
104
105                                                 if (x($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 (x($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 (x($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 if (x($page, 'footer')) echo $page['footer']; ?>
143                         <!-- Modal  -->
144                         <div id="modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
145                                 <div class="modal-dialog modal-full-screen">
146                                         <div class="modal-content">
147                                                 <div id="modal-header" class="modal-header">
148                                                         <button id="modal-cloase" type="button" class="close" data-dismiss="modal" aria-hidden="true">
149                                                                 &times;
150                                                         </button>
151                                                         <h4 id="modal-title" class="modal-title"></h4>
152                                                 </div>
153                                                 <div id="modal-body" class="modal-body">
154                                                         <!-- /# content goes here -->
155                                                 </div>
156                                         </div>
157                                 </div>
158                         </div>
159
160                         <!-- Dummy div to append other div's when needed (e.g. used for js function editpost() -->
161                         <div id="cache-container"></div>
162
163                 </footer>
164 <?php } ?> <!-- End of condition if $minimal else the rest -->
165         </body>