diff --git a/modules/editor/conf/module.xml b/modules/editor/conf/module.xml index c046d3ffd..b2522a8d6 100644 --- a/modules/editor/conf/module.xml +++ b/modules/editor/conf/module.xml @@ -22,5 +22,7 @@ + + diff --git a/modules/editor/editor.controller.php b/modules/editor/editor.controller.php index 4b99c6c0c..0b28e24b7 100644 --- a/modules/editor/editor.controller.php +++ b/modules/editor/editor.controller.php @@ -254,6 +254,27 @@ } + /** + * @brief 자동 저장글 Srl 로드 - XE 이전 버전 사용자를 위함. + **/ + function procEditorLoadSavedDocument() { + $editor_sequence = Context::get('editor_sequence'); + $primary_key = Context::get('primary_key'); + $oEditorModel = &getModel('editor'); + $oFileController = &getController('file'); + + $saved_doc = $oEditorModel->getSavedDoc(null); + + $oFileController->setUploadInfo($editor_sequence, $saved_doc->document_srl); + $vars = $this->getVariables(); + $this->add("editor_sequence", $editor_sequence); + $this->add("key", $primary_key); + $this->add("title", $saved_doc->title); + $this->add("content", $saved_doc->content); + $this->add("document_srl", $saved_doc->document_srl); + } + + /** * @brief 게시글의 입력/수정이 일어났을 경우 자동 저장문서를 제거하는 trigger **/ diff --git a/modules/editor/tpl/js/editor.js b/modules/editor/tpl/js/editor.js index 247b74e2b..c1c3a46bd 100755 --- a/modules/editor/tpl/js/editor.js +++ b/modules/editor/tpl/js/editor.js @@ -97,15 +97,20 @@ function editorStart(editor_sequence, primary_key, content_key, editor_height, f var saved_title = fo_obj._saved_doc_title.value; var saved_content = fo_obj._saved_doc_content.value; - var saved_srl = fo_obj._saved_doc_srl.value; if(saved_title || saved_content) { // 자동저장된 문서 활용여부를 물은 후 사용하지 않는다면 자동저장된 문서 삭제 if(confirm(fo_obj._saved_doc_message.value)) { if(typeof(fo_obj.title)!='undefined') fo_obj.title.value = saved_title; editorRelKeys[editor_sequence]['content'].value = saved_content; - editorRelKeys[editor_sequence]['primary'].value = saved_srl; + + var param = new Array(); + param['editor_sequence'] = editor_sequence; + param['primary_key'] = primary_key; + var response_tags = new Array("error","message","editor_sequence","key","title","content","document_srl"); + exec_xml('editor',"procEditorLoadSavedDocument", param, getAutoSavedSrl, response_tags); editorUploadInit(uploadSettingObj, true); + } else { editorRemoveSavedDoc(); } @@ -562,3 +567,11 @@ function setPreviewHeight(editor_sequence){ if(h < 400) h=400; xHeight('editor_preview_'+editor_sequence,h+20); } +function getAutoSavedSrl(ret_obj, response_tags, c) { + var editor_sequence = ret_obj['editor_sequence']; + var primary_key = ret_obj['key']; + var fo_obj = editorGetForm(editor_sequence); + + fo_obj[primary_key].value = ret_obj['document_srl']; + editorUploadInit(uploadSettingObj, true); +} \ No newline at end of file