XE의 문서 서식 기능 추가 (./modules/editor/styles 에 서식 추가 가능)

문서 서식 기능을 글 작성과 볼때 동일한 형태 제공하도록 개선.
각 모듈별 추가 설정에서 문서 서식 설정할 수 있는 기능 추가


git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6134 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2009-04-17 03:54:39 +00:00
parent 2e43bfef03
commit 7496aeebb8
54 changed files with 379 additions and 144 deletions

View file

@ -80,6 +80,7 @@
$editor_config->editor_skin = Context::get('editor_skin');
$editor_config->comment_editor_skin = Context::get('comment_editor_skin');
$editor_config->content_style = Context::get('content_style');
$editor_config->sel_editor_colorset = Context::get('sel_editor_colorset');
$editor_config->sel_comment_editor_colorset = Context::get('sel_comment_editor_colorset');
@ -135,9 +136,27 @@
}
/**
* @brief 에디터컴포넌트의 코드를 결과물로 변환
* @brief 에디터컴포넌트의 코드를 결과물로 변환 + 문서서식 style 지정
**/
function triggerEditorComponentCompile(&$content) {
$module_info = Context::get('module_info');
$module_srl = $module_info->module_srl;
if($module_srl) {
$oEditorModel = &getModel('editor');
$editor_config = $oEditorModel->getEditorConfig($module_srl);
$content_style = $editor_config->content_style;
$path = _XE_PATH_.'modules/editor/styles/'.$content_style.'/';
if(is_dir($path) && file_exists($path.'style.ini')) {
$ini = file($path.'style.ini');
for($i=0,$c=count($ini);$i<$c;$i++) {
$file = trim($ini[$i]);
if(!$file) continue;
if(preg_match('/\.css$/i',$file)) Context::addCSSFile('./modules/editor/styles/'.$content_style.'/'.$file, false);
elseif(preg_match('/\.js/i',$file)) Context::addJsFile('./modules/editor/styles/'.$content_style.'/'.$file, false);
}
}
}
$content = $this->transComponent($content);
}