1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-16 11:36:08 +02:00

Fixes #4200 - check theme version is compatible and disable installation if necessary.

This commit is contained in:
Cameron
2020-07-01 13:00:34 -07:00
parent 5f58f8f59d
commit 582bd3f72c
5 changed files with 52 additions and 6 deletions

View File

@@ -955,7 +955,21 @@ class theme_admin_form_ui extends e_admin_form_ui
$infoPath = e_SELF."?mode=".$_GET['mode']."&id=".$theme['path']."&action=info&iframe=1";
$previewPath = $tp->replaceConstants($theme['thumbnail'],'abs');
$main_icon = ($pref['sitetheme'] != $theme['path']) ? "<button class='btn btn-default btn-secondary btn-small btn-sm btn-inverse' type='submit' name='selectmain[".$theme['path']."]' alt=\"".TPVLAN_10."\" title=\"".TPVLAN_10."\" >".$tp->toGlyph('fa-home',array('size'=>'2x'))."</button>" : "<button class='btn btn-small btn-default btn-secondary btn-sm btn-inverse' type='button'>".$tp->toGlyph('fa-check',array('size'=>'2x'))."</button>";
$version = $tp->filter(e_VERSION,'version');
$compat = $tp->filter($theme['compatibility'], 'version');
$disabled = '';
$mainTitle = TPVLAN_10;
if(version_compare($compat,$version, '<=') === false)
{
$disabled = 'disabled';
$mainTitle = defset('TPVLAN_97', "This theme requires a newer version of e107.");
}
e107::getDebug()->log($theme['path']." - ".$disabled. " (".$compat.")");
$main_icon = ($pref['sitetheme'] != $theme['path']) ? "<button class='btn btn-default btn-secondary btn-small btn-sm btn-inverse' type='submit' ".$disabled." name='selectmain[".$theme['path']."]' alt=\"".$mainTitle."\" title=\"".$mainTitle."\" >".$tp->toGlyph('fa-home',array('size'=>'2x'))."</button>" : "<button class='btn btn-small btn-default btn-secondary btn-sm btn-inverse' type='button'>".$tp->toGlyph('fa-check',array('size'=>'2x'))."</button>";
$info_icon = "<a class='btn btn-default btn-secondary btn-small btn-sm btn-inverse e-modal' data-modal-caption=\"".$theme['name']." ".$theme['version']."\" href='".$infoPath."' title='".TPVLAN_7."'>".$tp->toGlyph('fa-info-circle',array('size'=>'2x'))."</a>";
// $admin_icon = ($pref['admintheme'] != $theme['path'] ) ? "<button class='btn btn-default btn-small btn-sm btn-inverse' type='submit' name='selectadmin[".$theme['id']."]' alt=\"".TPVLAN_32."\" title=\"".TPVLAN_32."\" >".$tp->toGlyph('fa-gears',array('size'=>'2x'))."</button>" : "<button class='btn btn-small btn-default btn-sm btn-inverse' type='button'>".$tp->toGlyph('fa-check',array('size'=>'2x'))."</button>";