mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
Xpresseditor에서 자동저장된 문서 첨부 파일 불러오기
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6498 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
567d648f5a
commit
d56181c9ec
9 changed files with 7877 additions and 7846 deletions
|
|
@ -222,6 +222,7 @@
|
|||
**/
|
||||
function doSaveDoc($args) {
|
||||
|
||||
if(!$args->document_srl) $args->document_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
|
||||
if(Context::get('is_logged')) {
|
||||
$logged_info = Context::get('logged_info');
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
|
|
@ -234,6 +235,22 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 자동 저장글 로드
|
||||
**/
|
||||
function loadSaveDoc() {
|
||||
$editor_sequence = Context::get('editor_sequence');
|
||||
|
||||
$oEditorModel = &getModel('editor');
|
||||
$saved_doc = $oEditorModel->getSavedDoc(null);
|
||||
$vars = $this->getVariables();
|
||||
$this->add("title", $saved_doc->title);
|
||||
$this->add("content", $saved_doc->content);
|
||||
$this->add("document_srl", $saved_doc->document_srl);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 게시글의 입력/수정이 일어났을 경우 자동 저장문서를 제거하는 trigger
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -348,12 +348,12 @@
|
|||
|
||||
// 자동저장 데이터에 문서번호가 있고 이 번호에 파일이 있다면 파일을 모두 이동하고
|
||||
// 해당 문서 번호를 editor_sequence로 세팅함
|
||||
if($saved_doc->document_srl) {
|
||||
if($saved_doc->document_srl && $upload_target_srl) {
|
||||
$module_srl = Context::get('module_srl');
|
||||
$oFileController = &getController('file');
|
||||
$oFileController->moveFile($saved_doc->document_srl, $module_srl, $upload_target_srl);
|
||||
}
|
||||
$saved_doc->document_srl = $upload_target_srl;
|
||||
else if($upload_target_srl) $saved_doc->document_srl = $upload_target_srl;
|
||||
|
||||
// 자동 저장 데이터 변경
|
||||
$oEditorController = &getController('editor');
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
<!-- 자동저장용 폼 -->
|
||||
|
||||
<!--@if($enable_autosave)-->
|
||||
<input type="hidden" name="_saved_doc_srl" value="{$saved_doc->document_srl}" />
|
||||
<input type="hidden" name="_saved_doc_title" value="{htmlspecialchars($saved_doc->title)}" />
|
||||
<input type="hidden" name="_saved_doc_content" value="{htmlspecialchars($saved_doc->content)}" />
|
||||
<input type="hidden" name="_saved_doc_message" value="{$lang->msg_load_saved_doc}" />
|
||||
|
|
@ -483,8 +484,7 @@
|
|||
<!--%import("../../tpl/js/uploader.js",optimized=false)-->
|
||||
<!--%import("../../tpl/js/swfupload.js",optimized=false)-->
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
editorUploadInit(
|
||||
{
|
||||
var uploadSettingObj = {
|
||||
"editorSequence" : {$editor_sequence},
|
||||
"sessionName" : "{session_name()}",
|
||||
"allowedFileSize" : "{$file_config->allowed_filesize}",
|
||||
|
|
@ -495,7 +495,9 @@
|
|||
"fileListAreaID" : "uploaded_file_list_{$editor_sequence}",
|
||||
"previewAreaID" : "preview_uploaded_{$editor_sequence}",
|
||||
"uploaderStatusID" : "uploader_status_{$editor_sequence}"
|
||||
}
|
||||
};
|
||||
editorUploadInit(
|
||||
uploadSettingObj
|
||||
);
|
||||
//]]></script>
|
||||
<!-- 파일 업로드 영역 -->
|
||||
|
|
|
|||
|
|
@ -5737,15 +5737,20 @@ xe.XE_AutoSave = jQuery.Class({
|
|||
},
|
||||
|
||||
$ON_MSG_APP_READY : function() {
|
||||
var elSrl = jQuery(this.form._saved_doc_srl);
|
||||
var elTitle = jQuery(this.form._saved_doc_title);
|
||||
var elContent = jQuery(this.form._saved_doc_content);
|
||||
|
||||
var doc_srl = jQuery.trim(elSrl.val());
|
||||
var title = jQuery.trim(elTitle.val());
|
||||
var content = jQuery.trim(elContent.val());
|
||||
|
||||
if (title || content) {
|
||||
if (confirm(this.form._saved_doc_message.value)) {
|
||||
jQuery(this.form.title).val(title);
|
||||
jQuery(this.form.document_srl).val(doc_srl);
|
||||
this.oApp.setIR(content);
|
||||
editorUploadInit(uploadSettingObj, true);
|
||||
} else {
|
||||
editorRemoveSavedDoc();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,9 @@ function editorStart_xe(editor_sequence, primary_key, content_key, editor_height
|
|||
}
|
||||
xe.Editors[editor_sequence] = oEditor;
|
||||
|
||||
var response_tags = new Array("error","message","title","content","document_srl");
|
||||
exec_xml('editor',"loadSaveDoc", null, function (a,b,c) { editorRelKeys[editor_sequence]["primary"].value = a['document_srl']; }, response_tags, null);
|
||||
|
||||
// register plugins
|
||||
oEditor.registerPlugin(new xe.CorePlugin(null));
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ var swfUploadObjs = new Array();
|
|||
* 이 함수는 editor.html 에서 파일 업로드 가능할 경우 호출됨
|
||||
**/
|
||||
// window.load 이벤트일 경우 && 문서 번호가 가상의 번호가 아니면 기존에 저장되어 있을지도 모르는 파일 목록을 가져옴
|
||||
function editorUploadInit(obj) {
|
||||
function editorUploadInit(obj, exe) {
|
||||
if(typeof(obj["editorSequence"])=="undefined") return;
|
||||
if(typeof(obj["sessionName"])=="undefined") obj["sessionName"]= "PHPSESSID";
|
||||
if(typeof(obj["allowedFileSize"])=="undefined") obj["allowedFileSize"]= 2*1024*1024;
|
||||
|
|
@ -22,6 +22,7 @@ function editorUploadInit(obj) {
|
|||
if(typeof(obj["replaceButtonID"])=="undefined") obj["replaceButtonID"] = "swfUploadButton"+obj["editorSequence"];
|
||||
if(typeof(obj["insertedFiles"])=="undefined") obj["insertedFiles"] = 0;
|
||||
xAddEventListener(window,"load",function() { XEUploaderStart(obj) });
|
||||
if(exe) XEUploaderStart(obj);
|
||||
}
|
||||
|
||||
// 파일 업로드를 위한 기본 준비를 함
|
||||
|
|
@ -102,7 +103,7 @@ function XEUploaderStart(obj) {
|
|||
swfObj.style.width = btnWidth+"px";
|
||||
swfObj.style.height = btnHeight+"px";
|
||||
|
||||
if(obj["insertedFiles"]>0) reloadFileList(settings);
|
||||
if(obj["insertedFiles"]>0 || editorRelKeys[obj["editorSequence"]]["primary"].value > 0) reloadFileList(settings);
|
||||
}
|
||||
|
||||
function fileQueued(file) {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@
|
|||
|
||||
$editor_sequence = Context::get("editor_sequence");
|
||||
$upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
|
||||
if(!$upload_target_srl) {
|
||||
$_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl = Context::get('uploadTargetSrl');
|
||||
}
|
||||
if($upload_target_srl) {
|
||||
$tmp_files = $this->getFiles($upload_target_srl);
|
||||
$file_count = count($tmp_files);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue