mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 00:02:21 +09:00
에디터 스킨단에서 converter를 지정할 수 있도록 추가
This commit is contained in:
parent
6e9e9e9171
commit
0e0bc311c9
4 changed files with 93 additions and 51 deletions
|
|
@ -73,10 +73,25 @@ class editorModel extends editor
|
|||
$editor_config->$key = $editor_default_config->$key ?: $val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $editor_config;
|
||||
}
|
||||
|
||||
function getSkinConfig($skin_name)
|
||||
{
|
||||
$skin_config = new stdClass;
|
||||
|
||||
if($skin_info = getModel('module')->loadSkinInfo($this->module_path, $skin_name))
|
||||
{
|
||||
foreach ($skin_info->extra_vars as $val)
|
||||
{
|
||||
$skin_config->{$val->name} = $val->value;
|
||||
}
|
||||
}
|
||||
|
||||
return $skin_config;
|
||||
}
|
||||
|
||||
function loadDrComponents()
|
||||
{
|
||||
$drComponentPath = _XE_PATH_ . 'modules/editor/skins/dreditor/drcomponents/';
|
||||
|
|
@ -879,24 +894,37 @@ class editorModel extends editor
|
|||
function convertHTML($obj)
|
||||
{
|
||||
$type = array();
|
||||
$editor_config = $this->getEditorConfig($obj->module_srl);
|
||||
$config = $this->getEditorConfig($obj->module_srl);
|
||||
|
||||
if($obj->module_srl)
|
||||
{
|
||||
$converter = array();
|
||||
$skin = $config->editor_skin;
|
||||
}
|
||||
else
|
||||
{
|
||||
$converter = array($obj->converter);
|
||||
$skin = $obj->editor_skin ?: $config->editor_skin;
|
||||
}
|
||||
|
||||
$converter = array_merge($converter, explode(',', $this->getSkinConfig($skin)->converter));
|
||||
|
||||
// Check
|
||||
if ($editor_config->allow_html === 'N' || $obj->use_html === 'N')
|
||||
if (in_array('text', $converter) || $config->allow_html === 'N' || $obj->use_html === 'N')
|
||||
{
|
||||
$type[] = 'to_Text';
|
||||
}
|
||||
elseif (strpos($obj->title ? $editor_config->sel_editor_colorset : $editor_config->sel_comment_editor_colorset, 'nohtml') !== false)
|
||||
elseif (strpos($obj->title ? $config->sel_editor_colorset : $config->sel_comment_editor_colorset, 'nohtml') !== false)
|
||||
{
|
||||
$type[] = 'to_Text';
|
||||
}
|
||||
|
||||
if (in_array('to_Text', $type) || $obj->use_editor === 'N' || !is_html_content($obj->content))
|
||||
if (!is_html_content($obj->content) || in_array('to_Text', $type) || $obj->use_editor === 'N')
|
||||
{
|
||||
$type[] = 'to_HTML';
|
||||
}
|
||||
|
||||
if ($obj->markdown === 'Y')
|
||||
if (in_array('markdown', $converter))
|
||||
{
|
||||
$type[] = 'Markdown2HTML';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<skin version="0.1">
|
||||
<title xml:lang="ko">CKEditor 스킨</title>
|
||||
<description xml:lang="ko">CKEditor</description>
|
||||
<version>1.0.0</version>
|
||||
<date>2015-02-24</date>
|
||||
|
||||
<author email_address="developers@xpressengine.com" link="https://www.xpressengine.com">
|
||||
<name xml:lang="ko">NAVER</name>
|
||||
</author>
|
||||
|
||||
<colorset>
|
||||
<color name="moono">
|
||||
<title xml:lang="ko">Moono</title>
|
||||
</color>
|
||||
<color name="moono-dark">
|
||||
<title xml:lang="ko">Moono Dark</title>
|
||||
</color>
|
||||
<color name="moono-lisa">
|
||||
<title xml:lang="ko">Moono Lisa</title>
|
||||
</color>
|
||||
</colorset>
|
||||
<skin version="0.2">
|
||||
<title xml:lang="ko">CKEditor 스킨</title>
|
||||
<description xml:lang="ko">CKEditor</description>
|
||||
<version>1.0.0</version>
|
||||
<date>2015-02-24</date>
|
||||
<author email_address="developers@xpressengine.com" link="https://www.xpressengine.com">
|
||||
<name xml:lang="ko">NAVER</name>
|
||||
</author>
|
||||
<colorset>
|
||||
<color name="moono">
|
||||
<title xml:lang="ko">Moono</title>
|
||||
</color>
|
||||
<color name="moono-dark">
|
||||
<title xml:lang="ko">Moono Dark</title>
|
||||
</color>
|
||||
<color name="moono-lisa">
|
||||
<title xml:lang="ko">Moono Lisa</title>
|
||||
</color>
|
||||
</colorset>
|
||||
</skin>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<skin version="0.1">
|
||||
<title xml:lang="ko">Textarea</title>
|
||||
<description xml:lang="ko">Textarea</description>
|
||||
<version>1.0.0</version>
|
||||
<date>2017-06-27</date>
|
||||
<colorset>
|
||||
<color name="light">
|
||||
<title xml:lang="ko">Light</title>
|
||||
</color>
|
||||
<color name="dark">
|
||||
<title xml:lang="ko">Dark</title>
|
||||
</color>
|
||||
</colorset>
|
||||
<skin version="0.2">
|
||||
<title xml:lang="ko">Textarea</title>
|
||||
<description xml:lang="ko">Textarea</description>
|
||||
<version>1.0.0</version>
|
||||
<date>2017-06-27</date>
|
||||
<colorset>
|
||||
<color name="light">
|
||||
<title xml:lang="ko">Light</title>
|
||||
</color>
|
||||
<color name="dark">
|
||||
<title xml:lang="ko">Dark</title>
|
||||
</color>
|
||||
</colorset>
|
||||
<extra_vars>
|
||||
<var name="converter" value="text"></var>
|
||||
</extra_vars>
|
||||
</skin>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue