1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 04:38:27 +01:00

layout override option when theme preview is active. themepreview=xxx&layout=xxxx

This commit is contained in:
Cameron 2021-01-01 14:11:56 -08:00
parent 78b0079a03
commit 5438da3764

View File

@ -1077,15 +1077,15 @@ class e_theme
}
private static function initThemePreview($themeDir)
private static function initThemePreview($themeDir, $layout=null)
{
$themeDir = filter_var($themeDir);
$themeDir = basename($themeDir);
$themeobj = new themeHandler;
$themeDef = $themeobj->findDefault($themeDir);
$defLayout = !empty($layout) ? $layout : $themeobj->findDefault($themeDir);
define('THEME_LAYOUT', $themeDef);
define('THEME_LAYOUT', $defLayout);
define('PREVIEWTHEME', $themeDir);
define('THEME', e_THEME . $themeDir . '/');
@ -1155,7 +1155,8 @@ class e_theme
// e_QUERY not set when in single entry mod
if (getperms('0') && !empty($_GET['themepreview']))
{
self::initThemePreview($_GET['themepreview']);
$layout = !empty($_GET['layout']) ? $_GET['layout'] : null;
self::initThemePreview($_GET['themepreview'], $layout);
self::initThemeLayout($pref);
return;
}