From ed557883c76c568aeae55cd7a67c19f94a27ca4b Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Tue, 27 Jun 2023 21:32:59 +0900 Subject: [PATCH] Fix default skin handling in page module --- modules/page/page.mobile.php | 17 ++++------------- modules/page/page.view.php | 3 +-- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/modules/page/page.mobile.php b/modules/page/page.mobile.php index 4084d9b79..b1969a879 100644 --- a/modules/page/page.mobile.php +++ b/modules/page/page.mobile.php @@ -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; diff --git a/modules/page/page.view.php b/modules/page/page.view.php index c649d9079..41513e23b 100644 --- a/modules/page/page.view.php +++ b/modules/page/page.view.php @@ -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; }