Apply consistent layout and skin code to communication and ncenterlite modules

This commit is contained in:
Kijin Sung 2023-06-27 21:41:42 +09:00
parent ed557883c7
commit c5a3f5722a
4 changed files with 5 additions and 107 deletions

View file

@ -11,38 +11,9 @@ class communicationMobile extends communicationView
function init()
{
$oCommunicationModel = getModel('communication');
$this->config = $oCommunicationModel->getConfig();
$this->config = CommunicationModel::getConfig();
Context::set('communication_config', $this->config);
$mskin = $this->config->mskin;
if(!$mskin)
{
$template_path = sprintf('%sm.skins/%s/', $this->module_path, 'default');
}
elseif($mskin === '/USE_RESPONSIVE/')
{
$template_path = sprintf("%sskins/%s/", $this->module_path, $this->config->skin);
if(!is_dir($template_path) || !$this->config->skin)
{
$template_path = sprintf("%sskins/%s/", $this->module_path, 'default');
}
}
else
{
$template_path = sprintf('%sm.skins/%s', $this->module_path, $mskin);
}
$oLayoutModel = getModel('layout');
$layout_info = $oLayoutModel->getLayout($this->config->mlayout_srl);
if($layout_info)
{
$this->module_info->mlayout_srl = $this->config->mlayout_srl;
$this->setLayoutPath($layout_info->path);
}
$this->setTemplatePath($template_path);
$this->setLayoutAndTemplatePaths('M', $this->config);
}
/**

View file

@ -15,33 +15,9 @@ class communicationView extends communication
*/
function init()
{
$oCommunicationModel = getModel('communication');
$this->config = $oCommunicationModel->getConfig();
$skin = $this->config->skin;
$this->config = CommunicationModel::getConfig();
Context::set('communication_config', $this->config);
$config_parse = explode('|@|', $skin);
if(count($config_parse) > 1)
{
$tpl_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]);
}
else
{
$tpl_path = sprintf('%sskins/%s', $this->module_path, $skin);
}
$this->setTemplatePath($tpl_path);
$oLayoutModel = getModel('layout');
$layout_info = $oLayoutModel->getLayout($this->config->layout_srl);
if($layout_info)
{
$this->module_info->layout_srl = $this->config->layout_srl;
$this->setLayoutPath($layout_info->path);
}
$this->setLayoutAndTemplatePaths('P', $this->config);
}
/**