From a65e93faea54b4c7e474e37f106843589c0ecd19 Mon Sep 17 00:00:00 2001 From: rabuzarus Date: Sat, 21 Apr 2018 15:43:11 +0200 Subject: [PATCH] frio - fix default template if friendica is installed into a subdirectory --- view/theme/frio/php/default.php | 90 +++++++++++++++++---------------- 1 file changed, 47 insertions(+), 43 deletions(-) diff --git a/view/theme/frio/php/default.php b/view/theme/frio/php/default.php index c78fdd265c..ee3b745416 100644 --- a/view/theme/frio/php/default.php +++ b/view/theme/frio/php/default.php @@ -26,40 +26,44 @@ if (!isset($minimal)) { profile_uid; - if (is_null($uid)) { - $uid = Profile::getThemeUid(); - } - $schema = PConfig::get($uid, 'frio', 'schema'); - if (($schema) && ($schema != '---')) { - if (file_exists('view/theme/frio/schema/' . $schema . '.php')) { - $schemefile = 'view/theme/frio/schema/' . $schema . '.php'; - require_once $schemefile; - } - } else { - $nav_bg = PConfig::get($uid, 'frio', 'nav_bg'); - } - if (!$nav_bg) { - $nav_bg = "#708fa0"; - } - echo ' - '; + $baseurl = System::baseUrl(); + $basepath = $a->path ? "/" . $a->path . "/" : "/"; + $frio = "view/theme/frio"; - $is_singleuser = Config::get('system','singleuser'); - $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser"; + // 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')) { + echo $page['htmlhead']; + } + + // Add the theme color meta + // It makes mobile Chrome UI match Frio's top bar color. + $uid = $a->profile_uid; + if (is_null($uid)) { + $uid = Profile::getThemeUid(); + } + $schema = PConfig::get($uid, 'frio', 'schema'); + if (($schema) && ($schema != '---')) { + if (file_exists('view/theme/frio/schema/' . $schema . '.php')) { + $schemefile = 'view/theme/frio/schema/' . $schema . '.php'; + require_once $schemefile; + } + } else { + $nav_bg = PConfig::get($uid, 'frio', 'nav_bg'); + } + if (!$nav_bg) { + $nav_bg = "#708fa0"; + } + echo ' + '; + + $is_singleuser = Config::get('system','singleuser'); + $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser"; ?> + "> Skip to main content
'; if (x($page, 'aside')) { @@ -107,18 +111,18 @@ if (!isset($minimal)) {
'; - if (x($page, 'content')) { - echo $page['content']; - } - echo ' -
+ echo $a->argv[0]; + echo '-content-wrapper">'; + if (x($page, 'content')) { + echo $page['content']; + } + echo ' +
'; - } else { - echo ' + } else { + echo '
'; if (x($page, 'content')) { echo $page['content']; @@ -126,7 +130,7 @@ if (!isset($minimal)) { echo '
'; - } + } ?>