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