aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Settings
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:01:20 +0100
commit4f07abe65586d66b0000e9b877ce467d71178aa2 (patch)
treeb022ecaa725b61d9305e13aa88ed1bb7811c6540 /Zotlabs/Module/Settings
parent8783ccfd727dc4834c1f3c9460f851350fc912f4 (diff)
downloadvolse-hubzilla-4f07abe65586d66b0000e9b877ce467d71178aa2.tar.gz
volse-hubzilla-4f07abe65586d66b0000e9b877ce467d71178aa2.tar.bz2
volse-hubzilla-4f07abe65586d66b0000e9b877ce467d71178aa2.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/Module/Settings')
-rw-r--r--Zotlabs/Module/Settings/Display.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php
index 67cecf1f5..d5be07a81 100644
--- a/Zotlabs/Module/Settings/Display.php
+++ b/Zotlabs/Module/Settings/Display.php
@@ -130,12 +130,19 @@ class Display {
if($allowed_themes) {
foreach($allowed_themes as $th) {
$f = $th;
+
+ $min_version = ((file_exists('view/theme/' . $th . '/.MINVERSION')) ? file_get_contents('view/theme/' . $th . '/.MINVERSION') : 0);
+ if((version_compare($min_version, STD_VERSION, '>=')) || ($min_version == 0)) {
+ $mobile_themes[$f] = $themes[$f] = sprintf(t('%s - (Incompatible)'), $f);
+ continue;
+ }
+
$is_experimental = file_exists('view/theme/' . $th . '/experimental');
$unsupported = file_exists('view/theme/' . $th . '/unsupported');
$is_mobile = file_exists('view/theme/' . $th . '/mobile');
$is_library = file_exists('view/theme/'. $th . '/library');
- $mobile_themes["---"] = t("No special theme for mobile devices");
-
+ $mobile_themes['---'] = t("No special theme for mobile devices");
+
if (!$is_experimental or ($is_experimental && (get_config('experimentals','exp_themes')==1 or get_config('experimentals','exp_themes')===false))){
$theme_name = (($is_experimental) ? sprintf(t('%s - (Experimental)'), $f) : $f);
if (! $is_library) {
@@ -147,7 +154,6 @@ class Display {
}
}
}
-
}
}