]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/php/default.php
Merge pull request #6219 from MrPetovan/task/remove-x
[friendica.git] / view / theme / frio / php / default.php
index aa86c9723880c8b383c26e2d5ebd091105c65b6b..ce7fd4d777ef39539aee13839b1041a79348fcac 100644 (file)
@@ -18,6 +18,12 @@ require_once 'view/theme/frio/php/frio_boot.php';
 if (!isset($minimal)) {
        $minimal = false;
 }
+
+$basepath = $a->getURLPath() ? "/" . $a->getURLPath() . "/" : "/";
+$frio = "view/theme/frio";
+$view_mode_class = ($a->is_mobile || $a->is_tablet) ? 'mobile-view' : 'desktop-view';
+$is_singleuser = Config::get('system', 'singleuser');
+$is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser";
 ?>
 <html>
        <head>
@@ -26,14 +32,11 @@ if (!isset($minimal)) {
                <script  type="text/javascript">var baseurl = "<?php echo System::baseUrl(); ?>";</script>
                <script type="text/javascript">var frio = "<?php echo 'view/theme/frio'; ?>";</script>
 <?php
-               $basepath = $a->getURLPath() ? "/" . $a->getURLPath() . "/" : "/";
-               $frio = "view/theme/frio";
-
                // Because we use minimal for modals the header and the included js stuff should be only loaded
                // if the page is an standard page (so we don't have it twice for modals)
                //
                /// @todo Think about to move js stuff in the footer
-               if (!$minimal && x($page, 'htmlhead')) {
+               if (!$minimal && !empty($page['htmlhead'])) {
                        echo $page['htmlhead'];
                }
 
@@ -52,21 +55,19 @@ if (!isset($minimal)) {
                } else {
                        $nav_bg = PConfig::get($uid, 'frio', 'nav_bg');
                }
+
                if (empty($nav_bg)) {
                        $nav_bg = "#708fa0";
                }
-               echo '
-                       <meta name="theme-color" content="' . $nav_bg . '" />';
 
-               $is_singleuser = Config::get('system','singleuser');
-               $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser";
+               echo '<meta name="theme-color" content="' . $nav_bg . '" />';
 ?>
        </head>
 
-       <body id="top" class="mod-<?php echo $a->module." ".$is_singleuser_class;?>">
+       <body id="top" class="mod-<?php echo $a->module . " " . $is_singleuser_class . " " . $view_mode_class;?>">
                <a href="#content" class="sr-only sr-only-focusable">Skip to main content</a>
 <?php
-       if (x($page, 'nav') && !$minimal) {
+       if (!empty($page['nav']) && !$minimal) {
                echo str_replace(
                        "~config.sitename~",
                        Config::get('config', 'sitename'),
@@ -81,8 +82,8 @@ if (!isset($minimal)) {
        // special minimal style for modal dialogs
        if ($minimal) {
 ?>
-               <section class="minimal" style="margin:0px!important; padding:0px!important; float:none!important;display:block!important;">
-                       <?php if (x($page, 'content')) echo $page['content']; ?>
+               <section class="minimal" style="margin:0px!important; padding:0px!important; float:none!important; display:block!important;">
+                       <?php if (!empty($page['content'])) echo $page['content']; ?>
                        <div id="page-footer"></div>
                </section>
 <?php
@@ -93,15 +94,15 @@ if (!isset($minimal)) {
                        <div class="container">
                                <div class="row">
 <?php
-                               if ((!x($_REQUEST, 'pagename') || $_REQUEST['pagename'] != "lostpass") && ($_SERVER['REQUEST_URI'] != $basepath)) {
+                               if ((empty($_REQUEST['pagename']) || $_REQUEST['pagename'] != "lostpass") && ($_SERVER['REQUEST_URI'] != $basepath)) {
                                        echo '
                                        <aside class="col-lg-3 col-md-3 offcanvas-sm offcanvas-xs">';
 
-                                               if (x($page, 'aside')) {
+                                               if (!empty($page['aside'])) {
                                                        echo $page['aside'];
                                                }
 
-                                               if (x($page, 'right_aside')) {
+                                               if (!empty($page['right_aside'])) {
                                                        echo $page['right_aside'];
                                                }
 
@@ -112,7 +113,7 @@ if (!isset($minimal)) {
                                                <section class="sectiontop ';
                                                        echo $a->argv[0];
                                                        echo '-content-wrapper">';
-                                                       if (x($page, 'content')) {
+                                                       if (!empty($page['content'])) {
                                                                echo $page['content'];
                                                        }
                                                        echo '
@@ -123,7 +124,7 @@ if (!isset($minimal)) {
                                } else {
                                        echo '
                                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="content" style="margin-top:50px;">';
-                                               if (x($page, 'content')) {
+                                               if (!empty($page['content'])) {
                                                        echo $page['content'];
                                                }
                                                echo '