diff options
author | Mario <mario@mariovavti.com> | 2024-03-22 08:37:29 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-03-22 08:37:29 +0000 |
commit | 1aeb05628b6a2a069c46980efbe628362c9e3e74 (patch) | |
tree | e9aed15d0cd74e0c23dcb05c7be8fe9541efdf36 /Zotlabs/Render/Theme.php | |
parent | 5b7387459cf4de8f7354d81cb0392c4225714d94 (diff) | |
parent | b464fae3bf22585888c5f3def8eded76fd48ed16 (diff) | |
download | volse-hubzilla-9.0.tar.gz volse-hubzilla-9.0.tar.bz2 volse-hubzilla-9.0.zip |
Merge branch '9.0RC'9.0
Diffstat (limited to 'Zotlabs/Render/Theme.php')
-rw-r--r-- | Zotlabs/Render/Theme.php | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/Zotlabs/Render/Theme.php b/Zotlabs/Render/Theme.php index 2e6ca0c32..543bf7a3f 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; @@ -96,14 +97,11 @@ class Theme { * * Provide a sane default if nothing is chosen or the specified theme does not exist. * - * @param bool $installing (optional) default false, if true return the name of the first base theme - * * @return string */ - static public function url($installing = false) { + static public function url() { - if($installing) - return self::$base_themes[0]; + $uid = App::$profile_uid ?: local_channel(); $theme = self::current(); @@ -111,16 +109,23 @@ class Theme { $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'); } |