From 5e466e8127f2972b4c88ee9dc87008e875457f8c Mon Sep 17 00:00:00 2001 From: ngleader Date: Tue, 26 May 2009 08:05:14 +0000 Subject: [PATCH] for textyle iframe upload func git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6411 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/file/conf/module.xml | 1 + modules/file/file.controller.php | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/modules/file/conf/module.xml b/modules/file/conf/module.xml index 27040180c..c382cebb2 100644 --- a/modules/file/conf/module.xml +++ b/modules/file/conf/module.xml @@ -9,6 +9,7 @@ + diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index 80b041adb..66680447a 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -39,6 +39,39 @@ return $this->insertFile($file_info, $module_srl, $upload_target_srl); } + + /** + * @brief iframe 첨부파일 업로드 + **/ + function procFileIframeUpload() { + // 기본적으로 필요한 변수 설정 + $editor_sequence = Context::get('editor_sequence'); + $callback = Context::get('callback'); + $module_srl = $this->module_srl; + + // 업로드 권한이 없거나 정보가 없을시 종료 + if(!$_SESSION['upload_info'][$editor_sequence]->enabled) exit(); + + // upload_target_srl 구함 + $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 = getNextSequence(); + } + + $file_info = Context::get('Filedata'); + // 정상적으로 업로드된 파일이 아니면 오류 출력 + if(is_uploaded_file($file_info['tmp_name'])){ + $output = $this->insertFile($file_info, $module_srl, $upload_target_srl); + Context::set('uploaded_fileinfo',$output); + } + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('iframe'); + + } + + + /** * @brief 첨부파일 다운로드 * 직접 요청을 받음