aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Render/Theme.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-02-26 21:01:20 +0100
committerMario Vavti <mario@mariovavti.com>2017-02-26 21:22:19 +0100
commit8a69a5c3c7bd0188228d5c1c8580e5331a66e2da (patch)
treecc9bc98e5bec71d5e443c0f6d79038ba74807c1b /Zotlabs/Render/Theme.php
parente819727b09f0b0eded552813c8336664b1dd1e1f (diff)
downloadvolse-hubzilla-8a69a5c3c7bd0188228d5c1c8580e5331a66e2da.tar.gz
volse-hubzilla-8a69a5c3c7bd0188228d5c1c8580e5331a66e2da.tar.bz2
volse-hubzilla-8a69a5c3c7bd0188228d5c1c8580e5331a66e2da.zip
add a minversion to the theme and fallback to default if requirement is not met. mark incompatible themes in the theme selector
Diffstat (limited to 'Zotlabs/Render/Theme.php')
-rw-r--r--Zotlabs/Render/Theme.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/Zotlabs/Render/Theme.php b/Zotlabs/Render/Theme.php
index dadb18051..53bcfe664 100644
--- a/Zotlabs/Render/Theme.php
+++ b/Zotlabs/Render/Theme.php
@@ -69,8 +69,13 @@ class Theme {
if(array_key_exists('theme_preview',$_GET))
$chosen_theme = $_GET['theme_preview'];
- // Allow theme selection of the form 'theme_name:schema_name'
+ // Check if $chosen_theme is compatible with core. If not fall back to default
+ $min_version = ((file_exists('view/theme/' . $chosen_theme . '/.MINVERSION')) ? file_get_contents('view/theme/' . $chosen_theme . '/.MINVERSION') : 0);
+ if((version_compare($min_version, STD_VERSION, '>=')) || ($min_version == 0)) {
+ $chosen_theme = '';
+ }
+ // Allow theme selection of the form 'theme_name:schema_name'
$themepair = explode(':', $chosen_theme);
if($chosen_theme && (file_exists('view/theme/' . $themepair[0] . '/css/style.css') || file_exists('view/theme/' . $themepair[0] . '/php/style.php'))) {