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