mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1574 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c4e6004d80
commit
da7e33354a
9 changed files with 184 additions and 93 deletions
|
|
@ -25,7 +25,13 @@
|
|||
|
||||
// 에디터 모듈의 getEditor를 호출하여 세팅
|
||||
$oEditorModel = &getModel('editor');
|
||||
$comment_editor = $oEditorModel->getEditor($upload_target_srl, false);
|
||||
$option->allow_fileupload = $this->grant->comment_fileupload;
|
||||
$option->enable_autosave = false;
|
||||
$option->enable_default_component = true;
|
||||
$option->enable_component = true;
|
||||
$option->resizable = true;
|
||||
$option->height = 100;
|
||||
$comment_editor = $oEditorModel->getEditor($upload_target_srl, $option);
|
||||
|
||||
// 변수 설정
|
||||
Context::set('comment_editor', $comment_editor);
|
||||
|
|
|
|||
|
|
@ -191,7 +191,13 @@
|
|||
|
||||
// 에디터 모듈의 getEditor를 호출하여 세팅
|
||||
$oEditorModel = &getModel('editor');
|
||||
$editor = $oEditorModel->getEditor($document_srl, $this->grant->fileupload, true);
|
||||
$option->allow_fileupload = $this->grant->fileupload;
|
||||
$option->enable_autosave = true;
|
||||
$option->enable_default_component = true;
|
||||
$option->enable_component = true;
|
||||
$option->resizable = true;
|
||||
$option->height = 400;
|
||||
$editor = $oEditorModel->getEditor($document_srl, $option);
|
||||
Context::set('editor', $editor);
|
||||
|
||||
$this->setTemplateFile('write_form');
|
||||
|
|
@ -359,10 +365,14 @@
|
|||
$comment_srl = getNextSequence();
|
||||
Context::set('comment_srl', $comment_srl);
|
||||
}
|
||||
|
||||
// 에디터 모듈의 getEditor를 호출하여 세팅
|
||||
$oEditorModel = &getModel('editor');
|
||||
$comment_editor = $oEditorModel->getEditor($comment_srl, $this->grant->fileupload);
|
||||
$option->allow_fileupload = $this->grant->comment_fileupload;
|
||||
$option->enable_autosave = false;
|
||||
$option->enable_default_component = true;
|
||||
$option->enable_component = true;
|
||||
$option->resizable = true;
|
||||
$option->height = 400;
|
||||
$comment_editor = $oEditorModel->getEditor($comment_srl, $option);
|
||||
Context::set('comment_editor', $comment_editor);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -153,7 +153,13 @@
|
|||
|
||||
// 에디터 모듈의 getEditor를 호출하여 세팅
|
||||
$oEditorModel = &getModel('editor');
|
||||
$editor = $oEditorModel->getEditor($document_srl, $this->grant->fileupload, true);
|
||||
$option->allow_fileupload = $this->grant->fileupload;
|
||||
$option->enable_autosave = true;
|
||||
$option->enable_default_component = true;
|
||||
$option->enable_component = true;
|
||||
$option->resizable = true;
|
||||
$option->height = 400;
|
||||
$editor = $oEditorModel->getEditor($document_srl, $option);
|
||||
Context::set('editor', $editor);
|
||||
|
||||
$this->setTemplateFile('write_form');
|
||||
|
|
@ -323,7 +329,13 @@
|
|||
}
|
||||
// 에디터 모듈의 getEditor를 호출하여 세팅
|
||||
$oEditorModel = &getModel('editor');
|
||||
$comment_editor = $oEditorModel->getEditor($comment_srl, $this->grant->comment_fileupload);
|
||||
$option->allow_fileupload = $this->grant->comment_fileupload;
|
||||
$option->enable_autosave = false;
|
||||
$option->enable_default_component = true;
|
||||
$option->enable_component = true;
|
||||
$option->resizable = true;
|
||||
$option->height = 100;
|
||||
$comment_editor = $oEditorModel->getEditor($comment_srl, $option);
|
||||
Context::set('comment_editor', $comment_editor);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,24 +10,31 @@
|
|||
/**
|
||||
* @brief 에디터를 return
|
||||
**/
|
||||
function getEditor($upload_target_srl, $allow_fileupload = false, $enable_autosave = false) {
|
||||
// 저장된 임시본이 있는지 검사
|
||||
if($enable_autosave) {
|
||||
$saved_doc = $this->getSavedDoc($upload_target_srl);
|
||||
Context::set('saved_doc', $saved_doc);
|
||||
}
|
||||
Context::set('enable_autosave', $enable_autosave);
|
||||
function getEditor($upload_target_srl, $option = null) {
|
||||
// 옵션 설정
|
||||
if(!$option->allow_fileupload) $allow_fileupload = false;
|
||||
else $allow_fileupload = true;
|
||||
|
||||
// 업로드를 위한 변수 설정
|
||||
if(!$option->enable_autosave) $enable_autosave = false;
|
||||
else $enable_autosave = true;
|
||||
|
||||
if(!$option->enable_default_component) $enable_default_component = false;
|
||||
else $enable_default_component = true;
|
||||
|
||||
if(!$option->enable_component) $enable_component = false;
|
||||
else $enable_component = true;
|
||||
|
||||
if(!$option->resizable) $resizable = 'false';
|
||||
else $resizable = 'true';
|
||||
|
||||
if(!$option->height) $editor_height = 400;
|
||||
else $editor_height = $option->height;
|
||||
|
||||
// 대상 문서 번호 설정
|
||||
Context::set('upload_target_srl', $upload_target_srl);
|
||||
Context::set('allow_fileupload', $allow_fileupload);
|
||||
|
||||
// 에디터 컴포넌트를 구함
|
||||
if(!Context::get('component_list')) {
|
||||
$component_list = $this->getComponentList();
|
||||
Context::set('component_list', $component_list);
|
||||
}
|
||||
|
||||
// 업로드 가능 변수 설정
|
||||
if($allow_fileupload) {
|
||||
// 첨부파일 모듈의 정보를 구함
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->member_srl && $logged_info->is_admin == 'Y') {
|
||||
|
|
@ -41,6 +48,31 @@
|
|||
$file_config->allowed_attach_size = $file_config->allowed_attach_size * 1024;
|
||||
}
|
||||
Context::set('file_config',$file_config);
|
||||
}
|
||||
Context::set('allow_fileupload', $allow_fileupload);
|
||||
|
||||
// 자동백업 기능 체크
|
||||
if($enable_autosave) {
|
||||
$saved_doc = $this->getSavedDoc($upload_target_srl);
|
||||
Context::set('saved_doc', $saved_doc);
|
||||
}
|
||||
Context::set('enable_autosave', $enable_autosave);
|
||||
|
||||
// 에디터 컴포넌트 체크
|
||||
if($enable_component) {
|
||||
if(!Context::get('component_list')) {
|
||||
$component_list = $this->getComponentList();
|
||||
Context::set('component_list', $component_list);
|
||||
}
|
||||
}
|
||||
Context::set('enable_component', $enable_component);
|
||||
Context::set('enable_default_component', $enable_default_component);
|
||||
|
||||
// resizable 가능한지 변수 설정
|
||||
Context::set('enable_resizable', $resizable);
|
||||
|
||||
// 에디터 크기 설정
|
||||
Context::set('editor_height', $editor_height);
|
||||
|
||||
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
|
||||
$tpl_path = $this->module_path.'tpl';
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<!-- 에디터 활성화 -->
|
||||
<script type="text/javascript">
|
||||
var editor_path = "{$editor_path}";
|
||||
editorInit("{$upload_target_srl}");
|
||||
editorInit("{$upload_target_srl}", {$enable_resizable}, {$editor_height});
|
||||
</script>
|
||||
|
||||
<!-- 자동저장용 폼 -->
|
||||
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
<!-- 에디터 -->
|
||||
<div class="editor_content">
|
||||
|
||||
<!--@if($enable_default_component)-->
|
||||
<div class="editor_area_1">
|
||||
|
||||
<!-- 폰트 종류와 크기 -->
|
||||
|
|
@ -69,7 +71,9 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
<!--@if($enable_component)-->
|
||||
<div class="editor_area_2">
|
||||
<!-- 컴포넌트 -->
|
||||
<div id="editor_component_{$upload_target_srl}" class="editor_iconbox">
|
||||
|
|
@ -80,6 +84,7 @@
|
|||
<!--@end-->
|
||||
</div>
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
<div class="editor_area_about_dbl">
|
||||
{$lang->about_dblclick_in_editor}
|
||||
|
|
|
|||
|
|
@ -17,17 +17,19 @@ function editorGetIFrame(upload_target_srl) {
|
|||
}
|
||||
|
||||
// editor 초기화를 onload이벤트 후에 시작시킴
|
||||
function editorInit(upload_target_srl) {
|
||||
var start_func = function() { editorStart(upload_target_srl); }
|
||||
xAddEventListener(window, 'load', start_func);
|
||||
function editorInit(upload_target_srl, resizable, height) {
|
||||
xAddEventListener(window, 'load', function() { editorStart(upload_target_srl, resizable, height); });
|
||||
}
|
||||
|
||||
// editor 시작 (upload_target_srl로 iframe객체를 얻어서 쓰기 모드로 전환)
|
||||
function editorStart(upload_target_srl) {
|
||||
function editorStart(upload_target_srl, resizable, height) {
|
||||
if(typeof(height)=="undefined"||!height) height = 350;
|
||||
if(typeof(resizable)=="undefined"||!resizable) resizable = false;
|
||||
else resizable = true;
|
||||
|
||||
// iframe_area를 찾음
|
||||
var iframe_area = xGetElementById("editor_iframe_area_"+upload_target_srl);
|
||||
xInnerHtml(iframe_area, "<iframe id='editor_iframe_"+upload_target_srl+"' frameBorder='0' style='border:0px;width:99%;height:300px;margin:0px;'></iframe>");
|
||||
xInnerHtml(iframe_area, "<iframe id='editor_iframe_"+upload_target_srl+"' frameBorder='0' style='border:0px;width:99%;height:"+height+"px;margin:0px;'></iframe>");
|
||||
|
||||
// iframe obj를 찾음
|
||||
var iframe_obj = editorGetIFrame(upload_target_srl);
|
||||
|
|
@ -54,9 +56,6 @@ function editorStart(upload_target_srl) {
|
|||
// 대상 form의 content object에서 데이터를 구함
|
||||
var content = fo_obj.content.value;
|
||||
|
||||
// 기본 폰트를 가져옴
|
||||
var default_font = xGetElementById('editor_font_'+upload_target_srl).options[1].value;
|
||||
|
||||
// iframe내의 document object
|
||||
var contentDocument = iframe_obj.contentWindow.document;
|
||||
|
||||
|
|
@ -104,10 +103,7 @@ function editorStart(upload_target_srl) {
|
|||
if(typeof(fo_obj._saved_doc_title)!="undefined" ) editorEnableAutoSave(fo_obj, upload_target_srl);
|
||||
|
||||
// 팝업 윈도우일 경우 드래그바 숨김
|
||||
if(typeof(_isPoped)!="undefined" && _isPoped) {
|
||||
xGetElementById("editor_drag_bar_"+upload_target_srl).style.display = "none";
|
||||
setFixedPopupSize();
|
||||
}
|
||||
if(resizable == false) xGetElementById("editor_drag_bar_"+upload_target_srl).style.display = "none";
|
||||
}
|
||||
|
||||
// 여러개의 편집기를 예상하여 전역 배열 변수에 form, iframe의 정보를 넣음
|
||||
|
|
|
|||
|
|
@ -72,7 +72,13 @@
|
|||
|
||||
// 에디터를 받음
|
||||
$oEditorModel = &getModel('editor');
|
||||
$editor = $oEditorModel->getEditor(0, false, false);
|
||||
$option->allow_fileupload = false;
|
||||
$option->enable_autosave = false;
|
||||
$option->enable_default_component = true;
|
||||
$option->enable_component = true;
|
||||
$option->resizable = true;
|
||||
$option->height = 300;
|
||||
$editor = $oEditorModel->getEditor(0, $option);
|
||||
Context::set('editor', $editor);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
|
|
@ -105,7 +111,13 @@
|
|||
// 에디터 모듈의 getEditor를 호출하여 서명용으로 세팅
|
||||
if($this->member_info->member_srl) {
|
||||
$oEditorModel = &getModel('editor');
|
||||
$editor = $oEditorModel->getEditor($this->member_info->member_srl, false, false);
|
||||
$option->allow_fileupload = false;
|
||||
$option->enable_autosave = false;
|
||||
$option->enable_default_component = true;
|
||||
$option->enable_component = true;
|
||||
$option->resizable = false;
|
||||
$option->height = 200;
|
||||
$editor = $oEditorModel->getEditor($this->member_info->member_srl, $option);
|
||||
Context::set('editor', $editor);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,13 @@
|
|||
// 에디터 모듈의 getEditor를 호출하여 서명용으로 세팅
|
||||
if($member_info->member_srl) {
|
||||
$oEditorModel = &getModel('editor');
|
||||
$editor = $oEditorModel->getEditor($member_info->member_srl, false, false);
|
||||
$option->allow_fileupload = false;
|
||||
$option->enable_autosave = false;
|
||||
$option->enable_default_component = true;
|
||||
$option->enable_component = true;
|
||||
$option->resizable = false;
|
||||
$option->height = 200;
|
||||
$editor = $oEditorModel->getEditor($member_info->member_srl, $option);
|
||||
Context::set('editor', $editor);
|
||||
}
|
||||
|
||||
|
|
@ -220,7 +226,13 @@
|
|||
|
||||
// 에디터 모듈의 getEditor를 호출하여 서명용으로 세팅
|
||||
$oEditorModel = &getModel('editor');
|
||||
$editor = $oEditorModel->getEditor($logged_info->member_srl, false, false);
|
||||
$option->allow_fileupload = false;
|
||||
$option->enable_autosave = false;
|
||||
$option->enable_default_component = true;
|
||||
$option->enable_component = true;
|
||||
$option->resizable = false;
|
||||
$option->height = 300;
|
||||
$editor = $oEditorModel->getEditor($logged_info->member_srl, $option);
|
||||
Context::set('editor', $editor);
|
||||
|
||||
$this->setTemplateFile('send_message');
|
||||
|
|
|
|||
|
|
@ -127,7 +127,13 @@
|
|||
|
||||
// 에디터 모듈의 getEditor를 호출하여 세팅
|
||||
$oEditorModel = &getModel('editor');
|
||||
$editor = $oEditorModel->getEditor($module_srl, true);
|
||||
$option->allow_fileupload = true;
|
||||
$option->enable_autosave = false;
|
||||
$option->enable_default_component = true;
|
||||
$option->enable_component = true;
|
||||
$option->resizable = true;
|
||||
$option->height = 600;
|
||||
$editor = $oEditorModel->getEditor($module_srl, $option);
|
||||
Context::set('editor', $editor);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue