diff options
author | mrjive <mrjive@mrjive.it> | 2018-02-21 12:55:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-21 12:55:29 +0100 |
commit | 2d17e1c677cd981858a4080af98edb51bbb5d822 (patch) | |
tree | 54d5d148d368632158584ba7eec7872170524e00 /Zotlabs/Render/Theme.php | |
parent | d7ecaa8b23a36ea1e9a0f185017930b5552c00b5 (diff) | |
parent | a829256bc4803731881a51bddd19ee59a5a234ff (diff) | |
download | volse-hubzilla-2d17e1c677cd981858a4080af98edb51bbb5d822.tar.gz volse-hubzilla-2d17e1c677cd981858a4080af98edb51bbb5d822.tar.bz2 volse-hubzilla-2d17e1c677cd981858a4080af98edb51bbb5d822.zip |
Merge pull request #15 from redmatrix/dev
Dev
Diffstat (limited to 'Zotlabs/Render/Theme.php')
-rw-r--r-- | Zotlabs/Render/Theme.php | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/Zotlabs/Render/Theme.php b/Zotlabs/Render/Theme.php index 09cc7a4d4..0eebba1ba 100644 --- a/Zotlabs/Render/Theme.php +++ b/Zotlabs/Render/Theme.php @@ -8,10 +8,8 @@ use App; class Theme { static $system_theme = null; - static $system_mobile_theme = null; static $session_theme = null; - static $session_mobile_theme = null; /** * @brief Array with base or fallback themes. @@ -32,10 +30,6 @@ class Theme { ? \App::$config['system']['theme'] : ''); self::$session_theme = ((isset($_SESSION) && x($_SESSION, 'theme')) ? $_SESSION['theme'] : self::$system_theme); - self::$system_mobile_theme = ((isset(\App::$config['system']['mobile_theme'])) - ? \App::$config['system']['mobile_theme'] : ''); - self::$session_mobile_theme = ((isset($_SESSION) && x($_SESSION, 'mobile_theme')) - ? $_SESSION['mobile_theme'] : self::$system_mobile_theme); $page_theme = null; @@ -55,30 +49,12 @@ class Theme { if(array_key_exists('theme', \App::$layout) && \App::$layout['theme']) $page_theme = \App::$layout['theme']; - // If the viewer is on a mobile device, ensure that we're using a mobile - // theme of some kind or whatever the viewer's preference is for mobile - // viewing (if applicable) + $chosen_theme = self::$session_theme; - if(\App::$is_mobile || \App::$is_tablet) { - if(isset($_SESSION['show_mobile']) && (! $_SESSION['show_mobile'])) { - $chosen_theme = self::$session_theme; - } - else { - $chosen_theme = self::$session_mobile_theme; - - if($chosen_theme === '' || $chosen_theme === '---' ) { - // user has selected to have the mobile theme be the same as the normal one - $chosen_theme = self::$session_theme; - } - } + if($page_theme) { + $chosen_theme = $page_theme; } - else { - $chosen_theme = self::$session_theme; - if($page_theme) { - $chosen_theme = $page_theme; - } - } if(array_key_exists('theme_preview', $_GET)) $chosen_theme = $_GET['theme_preview']; |