wip: Mobile-Theme-Testphase und PHP-8.2-Guards (Stand Juni 2026)
This commit is contained in:
@@ -58,6 +58,15 @@ class layout extends Smarty {
|
||||
header('content-type: text/html; charset=utf-8');
|
||||
|
||||
$this->__construct();
|
||||
|
||||
// Smarty 4.5+ verlangt explizite Plugin-Registrierung für PHP-Funktionen als Modifier.
|
||||
// Legacy-Templates nutzen u.a. |stristr — hier zentral registrieren statt überall ersetzen.
|
||||
foreach (['stristr', 'strstr', 'str_replace', 'preg_replace', 'urlencode', 'urldecode', 'trim'] as $fn) {
|
||||
if (function_exists($fn)) {
|
||||
$this->registerPlugin('modifier', $fn, $fn);
|
||||
}
|
||||
}
|
||||
|
||||
$this->compile_id = SHOP_SYSTEM.'_'.$base_object->config->shopConfiguration['THEME'];
|
||||
$this->compile_dir = ROOT_DIR.'/tmp/smarty_compile';
|
||||
$this->cache_dir = ROOT_DIR.'/tmp/smarty_cache';
|
||||
@@ -65,6 +74,12 @@ class layout extends Smarty {
|
||||
$tpl_paths = array();
|
||||
$tpl_paths[] = ROOT_DIR.'/web/'.SHOP_SYSTEM.'/themes/'.$base_object->config->shopConfiguration['THEME'].'/templates';
|
||||
|
||||
// Mobile-Theme: theme2 als Fallback vor dem Parent — Mobile überschreibt nur
|
||||
// die Schlüssel-Templates, alles andere kommt aus theme2 bzw. easyshop_advanced.
|
||||
if ($base_object->config->shopConfiguration['THEME'] === 'mobile') {
|
||||
$tpl_paths[] = ROOT_DIR.'/web/'.SHOP_SYSTEM.'/themes/theme2/templates';
|
||||
}
|
||||
|
||||
if ($theme->parent_theme) {
|
||||
$tpl_paths[] = ROOT_DIR.'/themes/'.$theme->parent_theme.'/templates';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user