Fix default skin handling in page module

This commit is contained in:
Kijin Sung 2023-06-27 21:32:59 +09:00
parent 7b16ee31c3
commit ed557883c7
2 changed files with 5 additions and 15 deletions

View file

@ -24,23 +24,14 @@ class PageMobile extends PageView
}
Context::set('oDocument', $oDocument);
if($this->module_info->mskin === '/USE_RESPONSIVE/')
$template_path = $this->getTemplatePath();
if (preg_match('!/skins/!', $template_path))
{
$template_path = sprintf("%sskins/%s/",$this->module_path, $this->module_info->skin);
if(!is_dir($template_path)||!$this->module_info->skin)
{
$template_path = sprintf("%sskins/%s/",$this->module_path, 'default');
}
$page_content = $oTemplate->compile($template_path, 'content');
$page_content = $oTemplate->compile($this->getTemplatePath(), 'content');
}
else
{
$template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin);
if(!is_dir($template_path)||!$this->module_info->mskin)
{
$template_path = sprintf("%sm.skins/%s/",$this->module_path, 'default');
}
$page_content = $oTemplate->compile($template_path, 'mobile');
$page_content = $oTemplate->compile($this->getTemplatePath(), 'mobile');
}
return $page_content;

View file

@ -154,8 +154,7 @@ class PageView extends Page
}
Context::set('oDocument', $oDocument);
$templatePath = sprintf('%sskins/%s', $this->module_path, $this->module_info->skin ?: 'default');
$page_content = $oTemplate->compile($templatePath, 'content');
$page_content = $oTemplate->compile($this->getTemplatePath(), 'content');
return $page_content;
}