]> git.mxchange.org Git - friendica.git/blob - view/theme/frio/php/default.php
768dd122f955b890cea575219bcd30ad81cc52a6
[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         </head>
59         <body id="top">
60                 <a href="#content" class="sr-only sr-only-focusable">Skip to main content</a>
61 <?php
62         if (x($page, 'nav') && !$minimal) {
63                 echo str_replace(
64                         "~config.sitename~",
65                         Config::get('config', 'sitename'),
66                         str_replace(
67                                 "~system.banner~",
68                                 Config::get('system', 'banner'),
69                                 $page['nav']
70                         )
71                 );
72         };
73
74         // special minimal style for modal dialogs
75         if ($minimal) {
76 ?>
77                 <section class="minimal" style="margin:0px!important; padding:0px!important; float:none!important;display:block!important;">
78                         <?php if (x($page, 'content')) echo $page['content']; ?>
79                         <div id="page-footer"></div>
80                 </section>
81 <?php
82         } else {
83                 // the style for all other pages
84 ?>
85                 <main>
86                         <div class="container">
87                                 <div class="row">
88 <?php
89                                         if ((!x($_REQUEST, 'pagename') || $_REQUEST['pagename'] != "lostpass") && ($_SERVER['REQUEST_URI'] != "/")) {
90                                                 echo '
91                                         <aside class="col-lg-3 col-md-3 offcanvas-sm offcanvas-xs">';
92
93                                                 if (x($page, 'aside')) {
94                                                         echo $page['aside'];
95                                                 }
96
97                                                 if (x($page, 'right_aside')) {
98                                                         echo $page['right_aside'];
99                                                 }
100
101                                                 echo '
102                                         </aside>
103
104                                         <div class="col-lg-7 col-md-7 col-sm-12 col-xs-12" id="content">
105                                                 <section class="sectiontop ';
106                                                 echo $a->argv[0];
107                                                 echo '-content-wrapper">';
108                                                 if (x($page, 'content')) {
109                                                         echo $page['content'];
110                                                 }
111                                                 echo '
112                                                                 <div id="pause"></div> <!-- The pause/resume Ajax indicator -->
113                                                 </section>
114                                         </div>
115                                                 ';
116                                         } else {
117                                                 echo '
118                                         <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="content" style="margin-top:50px;">';
119                                                 if (x($page, 'content')) {
120                                                         echo $page['content'];
121                                                 }
122                                                 echo '
123                                         </div>
124                                         ';
125                                         }
126 ?>
127                                 </div><!--row-->
128                         </div><!-- container -->
129
130                         <div id="back-to-top" title="back to top">&#8679;</div>
131                 </main>
132
133                 <footer>
134                         <?php if (x($page, 'footer')) echo $page['footer']; ?>
135                         <!-- Modal  -->
136                         <div id="modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
137                                 <div class="modal-dialog modal-full-screen">
138                                         <div class="modal-content">
139                                                 <div id="modal-header" class="modal-header">
140                                                         <button id="modal-cloase" type="button" class="close" data-dismiss="modal" aria-hidden="true">
141                                                                 &times;
142                                                         </button>
143                                                         <h4 id="modal-title" class="modal-title"></h4>
144                                                 </div>
145                                                 <div id="modal-body" class="modal-body">
146                                                         <!-- /# content goes here -->
147                                                 </div>
148                                         </div>
149                                 </div>
150                         </div>
151
152                         <!-- Dummy div to append other div's when needed (e.g. used for js function editpost() -->
153                         <div id="cache-container"></div>
154
155                 </footer>
156 <?php } ?> <!-- End of condition if $minimal else the rest -->
157         </body>