diff options
author | Mario <mario@mariovavti.com> | 2024-02-10 22:04:24 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-02-10 22:04:24 +0000 |
commit | 7ccb2a261521cc826ff41d91cebbab504b7c4e11 (patch) | |
tree | 043d03fbad8f58352c75ae7e3fb6ae942edb64e9 /Zotlabs/Render | |
parent | 067a66b9278e3c8ff2c624f38f2817715eb8a316 (diff) | |
download | volse-hubzilla-7ccb2a261521cc826ff41d91cebbab504b7c4e11.tar.gz volse-hubzilla-7ccb2a261521cc826ff41d91cebbab504b7c4e11.tar.bz2 volse-hubzilla-7ccb2a261521cc826ff41d91cebbab504b7c4e11.zip |
custom sass bootstrap builds for channels and site
Diffstat (limited to 'Zotlabs/Render')
-rw-r--r-- | Zotlabs/Render/Theme.php | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/Zotlabs/Render/Theme.php b/Zotlabs/Render/Theme.php index 2e6ca0c32..dc23eae84 100644 --- a/Zotlabs/Render/Theme.php +++ b/Zotlabs/Render/Theme.php @@ -3,7 +3,7 @@ namespace Zotlabs\Render; use App; - +use Zotlabs\Lib\PConfig; class Theme { @@ -26,8 +26,8 @@ class Theme { */ static public function current(){ - self::$system_theme = ((isset(\App::$config['system']['theme'])) - ? \App::$config['system']['theme'] : ''); + self::$system_theme = ((isset(App::$config['system']['theme'])) + ? App::$config['system']['theme'] : ''); self::$session_theme = ((isset($_SESSION) && x($_SESSION, 'theme')) ? $_SESSION['theme'] : self::$system_theme); @@ -35,7 +35,7 @@ class Theme { // Find the theme that belongs to the channel whose stuff we are looking at - if(\App::$profile_uid) { + if(App::$profile_uid) { $r = q("select channel_theme from channel where channel_id = %d limit 1", intval(\App::$profile_uid) ); @@ -46,8 +46,9 @@ class Theme { // Themes from Comanche layouts over-ride the channel theme - if(array_key_exists('theme', \App::$layout) && \App::$layout['theme']) - $page_theme = \App::$layout['theme']; + if(array_key_exists('theme', \App::$layout) && \App::$layout['theme']) { + $page_theme = App::$layout['theme']; + } $chosen_theme = self::$session_theme; @@ -105,22 +106,31 @@ class Theme { if($installing) return self::$base_themes[0]; + $uid = App::$profile_uid ?: local_channel(); + $theme = self::current(); $t = $theme[0]; $s = ((count($theme) > 1) ? $theme[1] : ''); $opts = ''; - $opts = ((\App::$profile_uid) ? '?f=&puid=' . \App::$profile_uid : ''); + $opts = (($uid) ? '?puid=' . $uid : ''); - $schema_str = ((x(\App::$layout,'schema')) ? '&schema=' . App::$layout['schema'] : ''); + $schema_str = ((x(App::$layout,'schema')) ? '&schema=' . App::$layout['schema'] : ''); if(($s) && (! $schema_str)) $schema_str = '&schema=' . $s; $opts .= $schema_str; + if ($uid) { + $timestamp = PConfig::Get($uid, 'system', 'style_update', false); + if ($timestamp) { + $opts .= '&updt=' . $timestamp; + } + } + if(file_exists('view/theme/' . $t . '/php/style.php')) - return('/view/theme/' . $t . '/php/style.pcss' . $opts); + return('/view/theme/' . $t . '/php/style.css' . $opts); return('/view/theme/' . $t . '/css/style.css'); } |