From 4f07abe65586d66b0000e9b877ce467d71178aa2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 26 Feb 2017 21:01:20 +0100 Subject: add a minversion to the theme and fallback to default if requirement is not met. mark incompatible themes in the theme selector --- Zotlabs/Module/Admin/Site.php | 9 ++++++++- Zotlabs/Module/Admin/Themes.php | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Module/Admin') diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php index 829ca71e4..3bb384ec5 100644 --- a/Zotlabs/Module/Admin/Site.php +++ b/Zotlabs/Module/Admin/Site.php @@ -163,6 +163,13 @@ class Site { foreach($files as $file) { $vars = ''; $f = basename($file); + + $min_version = ((file_exists('view/theme/' . $f . '/.MINVERSION')) ? file_get_contents('view/theme/' . $f . '/.MINVERSION') : 0); + if((version_compare($min_version, STD_VERSION, '>=')) || ($min_version == 0)) { + $theme_choices[$f] = $theme_choices_mobile[$f] = sprintf(t('%s - (Incompatible)'), $f); + continue; + } + if (file_exists($file . '/library')) continue; if (file_exists($file . '/mobile')) @@ -310,4 +317,4 @@ class Site { )); } -} \ No newline at end of file +} diff --git a/Zotlabs/Module/Admin/Themes.php b/Zotlabs/Module/Admin/Themes.php index 63a9a1670..fc908ec8b 100644 --- a/Zotlabs/Module/Admin/Themes.php +++ b/Zotlabs/Module/Admin/Themes.php @@ -230,4 +230,4 @@ class Themes { -} \ No newline at end of file +} -- cgit v1.2.3