add a minversion to the theme and fallback to default if requirement is not met. mark incompatible themes in the theme selector

This commit is contained in:
Mario Vavti
2017-02-26 21:01:20 +01:00
parent e819727b09
commit 8a69a5c3c7
6 changed files with 26 additions and 7 deletions

View File

@@ -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 {
));
}
}
}

View File

@@ -230,4 +230,4 @@ class Themes {
}
}