문서 모듈의 아이콘을 스킨으로 설정할 수 있도록 개선

https://github.com/xpressengine/xe-core/pull/2172
This commit is contained in:
BJRambo 2017-11-28 17:48:38 +09:00
parent 1a81fd43f3
commit 75ea89e203
13 changed files with 85 additions and 7 deletions

View file

@ -10,6 +10,8 @@
*/
class documentModel extends document
{
private $documentConfig = NULL;
/**
* Initialization
* @return void
@ -935,15 +937,18 @@ class documentModel extends document
*/
function getDocumentConfig()
{
if(!$GLOBALS['__document_config__'])
if ($this->documentConfig === NULL)
{
$oModuleModel = getModel('module');
$config = $oModuleModel->getModuleConfig('document');
if(!$config) $config = new stdClass();
$GLOBALS['__document_config__'] = $config;
if (!$config)
{
$config = new stdClass();
}
$this->documentConfig = $config;
}
return $GLOBALS['__document_config__'];
return $this->documentConfig;
}
/**
@ -1610,6 +1615,22 @@ class documentModel extends document
return false;
}
function getDocumentExtraImagePath()
{
$documentConfig = getModel('document')->getDocumentConfig();
if(Mobile::isFromMobilePhone())
{
$iconSkin = $documentConfig->micons;
}
else
{
$iconSkin = $documentConfig->icons;
}
$path = sprintf('%s%s',getUrl(), "modules/document/tpl/icons/$iconSkin/");
return $path;
}
}
/* End of file document.model.php */
/* Location: ./modules/document/document.model.php */