mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
Fix #985 improve responsive skin support
- 모바일에서 반응형 스킨 사용을 기본값으로 지정한 경우 - 사이트 디자인 설정 화면에서 /USE_RESPONSIVE/가 노출되는 문제 수정 - 신규 생성한 게시판에서 모바일 스킨을 찾지 못하는 문제 수정 - 게시판 모듈에서 스킨 처리하는 루틴을 ModuleObject로 이관하여 모든 모듈에서 혜택을 볼 수 있도록 함 - 반응형 스킨이 기본값으로 지정된 경우, 아무 것도 지정되지 않은 경우, 기본값으로 지정된 스킨이 삭제된 경우 등 다양한 상황에 대처 - TODO: 회원 모듈, 커뮤니케이션 모듈 등에서 자체 스킨을 들여오는 방식 재검토
This commit is contained in:
parent
ea964e72ba
commit
11858c0b13
5 changed files with 42 additions and 49 deletions
|
|
@ -550,28 +550,53 @@ class ModuleObject extends BaseObject
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
// integrate skin information of the module(change to sync skin info with the target module only by seperating its table)
|
||||
// Set skin information
|
||||
$oModuleModel = getModel('module');
|
||||
$default_skin = ((!$is_mobile && $this->module_info->is_skin_fix == 'N') || ($is_mobile && $this->module_info->is_mskin_fix == 'N'));
|
||||
$disable_skin = ($this->module == 'page' && ($this->module_info->page_type == 'OUTSIDE' || $this->module_info->page_type == 'WIDGET'));
|
||||
if(!$disable_skin && $default_skin && $this->module != 'admin' && strpos($this->act, 'Admin') === false && $this->module == $this->module_info->module)
|
||||
$disable_skin = ($disable_skin && ($this->module === 'admin' || strpos($this->act, 'Admin') !== false || $this->module !== $this->module_info->module));
|
||||
if(!$disable_skin)
|
||||
{
|
||||
$skinType = ($is_mobile && $this->module_info->mskin !== '/USE_RESPONSIVE/') ? 'M' : 'P';
|
||||
$dir = $skinType === 'M' ? 'm.skins' : 'skins';
|
||||
$valueName = $skinType === 'M' ? 'mskin' : 'skin';
|
||||
$skinName = $this->module_info->{$valueName} === '/USE_DEFAULT/' ? $oModuleModel->getModuleDefaultSkin($this->module, $skinType) : $this->module_info->{$valueName};
|
||||
if($this->module == 'page')
|
||||
$valueName = $is_mobile ? 'mskin' : 'skin';
|
||||
$skinName = $this->module_info->{$valueName};
|
||||
$dirName = $is_mobile ? 'm.skins' : 'skins';
|
||||
if($is_mobile)
|
||||
{
|
||||
$this->module_info->{$valueName} = $skinName;
|
||||
if($skinName === '/USE_DEFAULT/' || !$skinName)
|
||||
{
|
||||
$skinName = $oModuleModel->getModuleDefaultSkin($this->module, 'M');
|
||||
$this->module_info->mskin = $skinName;
|
||||
}
|
||||
if($skinName === '/USE_RESPONSIVE/')
|
||||
{
|
||||
$skinName = $this->module_info->skin;
|
||||
$dirName = 'skins';
|
||||
if($skinName === '/USE_DEFAULT/')
|
||||
{
|
||||
$skinName = $oModuleModel->getModuleDefaultSkin($this->module, 'P');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$isTemplatPath = (strpos($this->getTemplatePath(), '/tpl/') !== FALSE);
|
||||
if(!$isTemplatPath)
|
||||
if($skinName === '/USE_DEFAULT/' || !$skinName)
|
||||
{
|
||||
$this->setTemplatePath(sprintf('%s%s/%s/', $this->module_path, $dir, $skinName));
|
||||
$skinName = $oModuleModel->getModuleDefaultSkin($this->module, 'P');
|
||||
$this->module_info->skin = $skinName;
|
||||
}
|
||||
}
|
||||
if($this->module === 'page')
|
||||
{
|
||||
$this->module_info->{$valueName} = $skinName;
|
||||
}
|
||||
elseif(strpos($this->getTemplatePath(), '/tpl/') === false)
|
||||
{
|
||||
if(!is_dir(sprintf('%s%s/%s', $this->module_path, $dirName, $skinName)))
|
||||
{
|
||||
$skinName = 'default';
|
||||
}
|
||||
$this->setTemplatePath(sprintf('%s%s/%s/', $this->module_path, $dirName, $skinName));
|
||||
}
|
||||
}
|
||||
|
||||
$oModuleModel->syncSkinInfoToModuleInfo($this->module_info);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue