From 43625b437bb0e09abc461c468a39c2dc1c76913d Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Sat, 13 Jul 2019 23:27:54 +0200 Subject: [PATCH 1/6] Default theme = login theme --- view/theme/frio/style.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/view/theme/frio/style.php b/view/theme/frio/style.php index d6336ae3dd..57abd77114 100644 --- a/view/theme/frio/style.php +++ b/view/theme/frio/style.php @@ -93,7 +93,14 @@ if (!$scheme) { $schemecssfile = 'view/theme/frio/scheme/default.css'; } } +//If no scheme was set default to login theme. +$nav_bg = (empty($nav_bg) ? Config::get('frio', 'nav_bg') : $nav_bg); +$nav_icon_color = (empty($nav_icon_color) ? Config::get('frio', 'nav_icon_color') : $nav_icon_color); +$link_color = (empty($link_color) ? Config::get('frio', 'link_color') : $link_color); +$background_color = (empty($background_color) ? Config::get('frio', 'background_color') : $background_color); +$background_image = (empty($background_image) ? Config::get('frio', 'background_image') : $background_image); +//If login theme unset default to master default //Set some defaults - we have to do this after pulling owner settings, and we have to check for each setting //individually. If we don't, we'll have problems if a user has set one, but not all options. $nav_bg = (empty($nav_bg) ? '#708fa0' : $nav_bg); From aa5b3c20b3568d7a656fdea1462e8111e076562c Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Sun, 14 Jul 2019 10:34:42 +0200 Subject: [PATCH 2/6] Updated towards hypolites suggestions --- view/theme/frio/style.php | 61 ++++++++++++++------------------------- 1 file changed, 22 insertions(+), 39 deletions(-) diff --git a/view/theme/frio/style.php b/view/theme/frio/style.php index 57abd77114..12cf8d20ac 100644 --- a/view/theme/frio/style.php +++ b/view/theme/frio/style.php @@ -15,6 +15,28 @@ $schemecssfile = false; $scheme_modified = 0; if ($a->module !== 'install') { + + Config::load('frio'); + + // Load frios system config. + $scheme = Config::get('frio', 'scheme', Config::get('frio', 'schema')); + $nav_bg = Config::get('frio', 'nav_bg', '#708fa0'); + $nav_icon_color = Config::get('frio', 'nav_icon_color', '#fff'); + $link_color = Config::get('frio', 'link_color', '#6fdbe8'); + $background_color = Config::get('frio', 'background_color', '#ededed'); + $contentbg_transp = Config::get('frio', 'contentbg_transp'); + $background_image = Config::get('frio', 'background_image', 'img/none.png'); + $bg_image_option = Config::get('frio', 'bg_image_option'); + $login_bg_image = Config::get('frio', 'login_bg_image'); + $login_bg_color = Config::get('frio', 'login_bg_color'); + $modified = Config::get('frio', 'css_modified'); + + // There is maybe the case that the user did never modify the theme settings. + // In this case we store the present time. + if (empty($modified)) { + Config::set('frio', 'css_modified', time()); + } + // Get the UID of the profile owner. $uid = defaults($_REQUEST, 'puid', 0); if ($uid) { @@ -36,27 +58,6 @@ if ($a->module !== 'install') { if (empty($modified)) { PConfig::set($uid, 'frio', 'css_modified', time()); } - } else { - Config::load('frio'); - - // Load frios system config. - $scheme = Config::get('frio', 'scheme', Config::get('frio', 'schema')); - $nav_bg = Config::get('frio', 'nav_bg'); - $nav_icon_color = Config::get('frio', 'nav_icon_color'); - $link_color = Config::get('frio', 'link_color'); - $background_color = Config::get('frio', 'background_color'); - $contentbg_transp = Config::get('frio', 'contentbg_transp'); - $background_image = Config::get('frio', 'background_image'); - $bg_image_option = Config::get('frio', 'bg_image_option'); - $login_bg_image = Config::get('frio', 'login_bg_image'); - $login_bg_color = Config::get('frio', 'login_bg_color'); - $modified = Config::get('frio', 'css_modified'); - - // There is maybe the case that the user did never modify the theme settings. - // In this case we store the present time. - if (empty($modified)) { - Config::set('frio', 'css_modified', time()); - } } } @@ -93,24 +94,6 @@ if (!$scheme) { $schemecssfile = 'view/theme/frio/scheme/default.css'; } } -//If no scheme was set default to login theme. -$nav_bg = (empty($nav_bg) ? Config::get('frio', 'nav_bg') : $nav_bg); -$nav_icon_color = (empty($nav_icon_color) ? Config::get('frio', 'nav_icon_color') : $nav_icon_color); -$link_color = (empty($link_color) ? Config::get('frio', 'link_color') : $link_color); -$background_color = (empty($background_color) ? Config::get('frio', 'background_color') : $background_color); -$background_image = (empty($background_image) ? Config::get('frio', 'background_image') : $background_image); - -//If login theme unset default to master default -//Set some defaults - we have to do this after pulling owner settings, and we have to check for each setting -//individually. If we don't, we'll have problems if a user has set one, but not all options. -$nav_bg = (empty($nav_bg) ? '#708fa0' : $nav_bg); -$nav_icon_color = (empty($nav_icon_color) ? '#fff' : $nav_icon_color); -$link_color = (empty($link_color) ? '#6fdbe8' : $link_color); -$background_color = (empty($background_color) ? '#ededed' : $background_color); -// The background image can not be empty. So we use a dummy jpg if no image was set. -$background_image = (empty($background_image) ? 'img/none.png' : $background_image); -$modified = (empty($modified) ? time() : $modified); - // set a default login bg image if no custom image and no custom bg color are set. if (empty($login_bg_image) && empty($login_bg_color)) { From 5e6b23bd4eaccc1f75c4141c56819f81fc324733 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Sun, 14 Jul 2019 10:48:24 +0200 Subject: [PATCH 3/6] Fixed issues --- view/theme/frio/style.php | 42 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/view/theme/frio/style.php b/view/theme/frio/style.php index 12cf8d20ac..18211f4702 100644 --- a/view/theme/frio/style.php +++ b/view/theme/frio/style.php @@ -16,27 +16,6 @@ $scheme_modified = 0; if ($a->module !== 'install') { - Config::load('frio'); - - // Load frios system config. - $scheme = Config::get('frio', 'scheme', Config::get('frio', 'schema')); - $nav_bg = Config::get('frio', 'nav_bg', '#708fa0'); - $nav_icon_color = Config::get('frio', 'nav_icon_color', '#fff'); - $link_color = Config::get('frio', 'link_color', '#6fdbe8'); - $background_color = Config::get('frio', 'background_color', '#ededed'); - $contentbg_transp = Config::get('frio', 'contentbg_transp'); - $background_image = Config::get('frio', 'background_image', 'img/none.png'); - $bg_image_option = Config::get('frio', 'bg_image_option'); - $login_bg_image = Config::get('frio', 'login_bg_image'); - $login_bg_color = Config::get('frio', 'login_bg_color'); - $modified = Config::get('frio', 'css_modified'); - - // There is maybe the case that the user did never modify the theme settings. - // In this case we store the present time. - if (empty($modified)) { - Config::set('frio', 'css_modified', time()); - } - // Get the UID of the profile owner. $uid = defaults($_REQUEST, 'puid', 0); if ($uid) { @@ -59,6 +38,27 @@ if ($a->module !== 'install') { PConfig::set($uid, 'frio', 'css_modified', time()); } } + + Config::load('frio'); + + // Load frios system config. + $scheme = (empty($scheme) ? Config::get('frio', 'scheme', Config::get('frio', 'schema')) : $scheme); + $nav_bg = (empty($nav_bg) ? Config::get('frio', 'nav_bg', '#708fa0') : $nav_bg); + $nav_icon_color = (empty($nav_icon_color) ? Config::get('frio', 'nav_icon_color', '#fff') : $nav_icon_color); + $link_color = (empty($link_color) ? Config::get('frio', 'link_color', '#6fdbe8') : $link_color); + $background_color = (empty($background_color) ? Config::get('frio', 'background_color', '#ededed') : $background_color); + $contentbg_transp = (empty($contentbg_transp) ? Config::get('frio', 'contentbg_transp') : $contentbg_transp); + $background_image = (empty($background_image) ? Config::get('frio', 'background_image', 'img/none.png') : $background_image); + $bg_image_option = (empty($bg_image_option) ? Config::get('frio', 'bg_image_option') : $bg_image_option); + $login_bg_image = (empty($login_bg_image) ? Config::get('frio', 'login_bg_image') : $login_bg_image); + $login_bg_color = (empty($login_bg_color) ? Config::get('frio', 'login_bg_color') : $login_bg_color; + $modified = (empty($modified) ? Config::get('frio', 'css_modified') : $modified); + + // There is maybe the case that the user did never modify the theme settings. + // In this case we store the present time. + if (empty($modified)) { + Config::set('frio', 'css_modified', time()); + } } // Now load the scheme. If a value is changed above, we'll keep the settings From b70e3d1c227b9307d3ef9cd6c5e1df4616a60211 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Sun, 14 Jul 2019 10:48:24 +0200 Subject: [PATCH 4/6] Revert "Fixed issues" This reverts commit 5e6b23bd4eaccc1f75c4141c56819f81fc324733. --- view/theme/frio/style.php | 42 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/view/theme/frio/style.php b/view/theme/frio/style.php index 18211f4702..12cf8d20ac 100644 --- a/view/theme/frio/style.php +++ b/view/theme/frio/style.php @@ -16,6 +16,27 @@ $scheme_modified = 0; if ($a->module !== 'install') { + Config::load('frio'); + + // Load frios system config. + $scheme = Config::get('frio', 'scheme', Config::get('frio', 'schema')); + $nav_bg = Config::get('frio', 'nav_bg', '#708fa0'); + $nav_icon_color = Config::get('frio', 'nav_icon_color', '#fff'); + $link_color = Config::get('frio', 'link_color', '#6fdbe8'); + $background_color = Config::get('frio', 'background_color', '#ededed'); + $contentbg_transp = Config::get('frio', 'contentbg_transp'); + $background_image = Config::get('frio', 'background_image', 'img/none.png'); + $bg_image_option = Config::get('frio', 'bg_image_option'); + $login_bg_image = Config::get('frio', 'login_bg_image'); + $login_bg_color = Config::get('frio', 'login_bg_color'); + $modified = Config::get('frio', 'css_modified'); + + // There is maybe the case that the user did never modify the theme settings. + // In this case we store the present time. + if (empty($modified)) { + Config::set('frio', 'css_modified', time()); + } + // Get the UID of the profile owner. $uid = defaults($_REQUEST, 'puid', 0); if ($uid) { @@ -38,27 +59,6 @@ if ($a->module !== 'install') { PConfig::set($uid, 'frio', 'css_modified', time()); } } - - Config::load('frio'); - - // Load frios system config. - $scheme = (empty($scheme) ? Config::get('frio', 'scheme', Config::get('frio', 'schema')) : $scheme); - $nav_bg = (empty($nav_bg) ? Config::get('frio', 'nav_bg', '#708fa0') : $nav_bg); - $nav_icon_color = (empty($nav_icon_color) ? Config::get('frio', 'nav_icon_color', '#fff') : $nav_icon_color); - $link_color = (empty($link_color) ? Config::get('frio', 'link_color', '#6fdbe8') : $link_color); - $background_color = (empty($background_color) ? Config::get('frio', 'background_color', '#ededed') : $background_color); - $contentbg_transp = (empty($contentbg_transp) ? Config::get('frio', 'contentbg_transp') : $contentbg_transp); - $background_image = (empty($background_image) ? Config::get('frio', 'background_image', 'img/none.png') : $background_image); - $bg_image_option = (empty($bg_image_option) ? Config::get('frio', 'bg_image_option') : $bg_image_option); - $login_bg_image = (empty($login_bg_image) ? Config::get('frio', 'login_bg_image') : $login_bg_image); - $login_bg_color = (empty($login_bg_color) ? Config::get('frio', 'login_bg_color') : $login_bg_color; - $modified = (empty($modified) ? Config::get('frio', 'css_modified') : $modified); - - // There is maybe the case that the user did never modify the theme settings. - // In this case we store the present time. - if (empty($modified)) { - Config::set('frio', 'css_modified', time()); - } } // Now load the scheme. If a value is changed above, we'll keep the settings From 5aa3cf1e2d498d8597106016e0cfc1657b054af7 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Sun, 14 Jul 2019 10:34:42 +0200 Subject: [PATCH 5/6] Revert "Updated towards hypolites suggestions" This reverts commit aa5b3c20b3568d7a656fdea1462e8111e076562c. --- view/theme/frio/style.php | 61 +++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/view/theme/frio/style.php b/view/theme/frio/style.php index 12cf8d20ac..57abd77114 100644 --- a/view/theme/frio/style.php +++ b/view/theme/frio/style.php @@ -15,28 +15,6 @@ $schemecssfile = false; $scheme_modified = 0; if ($a->module !== 'install') { - - Config::load('frio'); - - // Load frios system config. - $scheme = Config::get('frio', 'scheme', Config::get('frio', 'schema')); - $nav_bg = Config::get('frio', 'nav_bg', '#708fa0'); - $nav_icon_color = Config::get('frio', 'nav_icon_color', '#fff'); - $link_color = Config::get('frio', 'link_color', '#6fdbe8'); - $background_color = Config::get('frio', 'background_color', '#ededed'); - $contentbg_transp = Config::get('frio', 'contentbg_transp'); - $background_image = Config::get('frio', 'background_image', 'img/none.png'); - $bg_image_option = Config::get('frio', 'bg_image_option'); - $login_bg_image = Config::get('frio', 'login_bg_image'); - $login_bg_color = Config::get('frio', 'login_bg_color'); - $modified = Config::get('frio', 'css_modified'); - - // There is maybe the case that the user did never modify the theme settings. - // In this case we store the present time. - if (empty($modified)) { - Config::set('frio', 'css_modified', time()); - } - // Get the UID of the profile owner. $uid = defaults($_REQUEST, 'puid', 0); if ($uid) { @@ -58,6 +36,27 @@ if ($a->module !== 'install') { if (empty($modified)) { PConfig::set($uid, 'frio', 'css_modified', time()); } + } else { + Config::load('frio'); + + // Load frios system config. + $scheme = Config::get('frio', 'scheme', Config::get('frio', 'schema')); + $nav_bg = Config::get('frio', 'nav_bg'); + $nav_icon_color = Config::get('frio', 'nav_icon_color'); + $link_color = Config::get('frio', 'link_color'); + $background_color = Config::get('frio', 'background_color'); + $contentbg_transp = Config::get('frio', 'contentbg_transp'); + $background_image = Config::get('frio', 'background_image'); + $bg_image_option = Config::get('frio', 'bg_image_option'); + $login_bg_image = Config::get('frio', 'login_bg_image'); + $login_bg_color = Config::get('frio', 'login_bg_color'); + $modified = Config::get('frio', 'css_modified'); + + // There is maybe the case that the user did never modify the theme settings. + // In this case we store the present time. + if (empty($modified)) { + Config::set('frio', 'css_modified', time()); + } } } @@ -94,6 +93,24 @@ if (!$scheme) { $schemecssfile = 'view/theme/frio/scheme/default.css'; } } +//If no scheme was set default to login theme. +$nav_bg = (empty($nav_bg) ? Config::get('frio', 'nav_bg') : $nav_bg); +$nav_icon_color = (empty($nav_icon_color) ? Config::get('frio', 'nav_icon_color') : $nav_icon_color); +$link_color = (empty($link_color) ? Config::get('frio', 'link_color') : $link_color); +$background_color = (empty($background_color) ? Config::get('frio', 'background_color') : $background_color); +$background_image = (empty($background_image) ? Config::get('frio', 'background_image') : $background_image); + +//If login theme unset default to master default +//Set some defaults - we have to do this after pulling owner settings, and we have to check for each setting +//individually. If we don't, we'll have problems if a user has set one, but not all options. +$nav_bg = (empty($nav_bg) ? '#708fa0' : $nav_bg); +$nav_icon_color = (empty($nav_icon_color) ? '#fff' : $nav_icon_color); +$link_color = (empty($link_color) ? '#6fdbe8' : $link_color); +$background_color = (empty($background_color) ? '#ededed' : $background_color); +// The background image can not be empty. So we use a dummy jpg if no image was set. +$background_image = (empty($background_image) ? 'img/none.png' : $background_image); +$modified = (empty($modified) ? time() : $modified); + // set a default login bg image if no custom image and no custom bg color are set. if (empty($login_bg_image) && empty($login_bg_color)) { From 660ed6df22f167e353d8867b4787d283db537c28 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Sun, 14 Jul 2019 10:57:54 +0200 Subject: [PATCH 6/6] Updated towards hypolite's first suggestion --- view/theme/frio/style.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/view/theme/frio/style.php b/view/theme/frio/style.php index 57abd77114..b47c38bbab 100644 --- a/view/theme/frio/style.php +++ b/view/theme/frio/style.php @@ -93,22 +93,15 @@ if (!$scheme) { $schemecssfile = 'view/theme/frio/scheme/default.css'; } } -//If no scheme was set default to login theme. -$nav_bg = (empty($nav_bg) ? Config::get('frio', 'nav_bg') : $nav_bg); -$nav_icon_color = (empty($nav_icon_color) ? Config::get('frio', 'nav_icon_color') : $nav_icon_color); -$link_color = (empty($link_color) ? Config::get('frio', 'link_color') : $link_color); -$background_color = (empty($background_color) ? Config::get('frio', 'background_color') : $background_color); -$background_image = (empty($background_image) ? Config::get('frio', 'background_image') : $background_image); -//If login theme unset default to master default //Set some defaults - we have to do this after pulling owner settings, and we have to check for each setting //individually. If we don't, we'll have problems if a user has set one, but not all options. -$nav_bg = (empty($nav_bg) ? '#708fa0' : $nav_bg); -$nav_icon_color = (empty($nav_icon_color) ? '#fff' : $nav_icon_color); -$link_color = (empty($link_color) ? '#6fdbe8' : $link_color); -$background_color = (empty($background_color) ? '#ededed' : $background_color); +$nav_bg = (empty($nav_bg) ? Config::get('frio', 'nav_bg', '#708fa0') : $nav_bg); +$nav_icon_color = (empty($nav_icon_color) ? Config::get('frio', 'nav_icon_color', '#fff') : $nav_icon_color); +$link_color = (empty($link_color) ? Config::get('frio', 'link_color', '#6fdbe8') : $link_color); +$background_color = (empty($background_color) ? Config::get('frio', 'background_color', '#ededed') : $background_color); // The background image can not be empty. So we use a dummy jpg if no image was set. -$background_image = (empty($background_image) ? 'img/none.png' : $background_image); +$background_image = (empty($background_image) ? Config::get('frio', 'background_image', 'img/none.png') : $background_image); $modified = (empty($modified) ? time() : $modified);