aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Render/Theme.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Render/Theme.php')
-rw-r--r--Zotlabs/Render/Theme.php28
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');
}