From 5c9142ec3eea522c1e44eb6b2b9c07b88a4c59e3 Mon Sep 17 00:00:00 2001 From: zero Date: Sun, 18 Feb 2007 16:12:38 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@112 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/board/board.model.php | 40 -------------------------------- modules/file/file.controller.php | 25 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 40 deletions(-) delete mode 100644 modules/board/board.model.php diff --git a/modules/board/board.model.php b/modules/board/board.model.php deleted file mode 100644 index 55c833585..000000000 --- a/modules/board/board.model.php +++ /dev/null @@ -1,40 +0,0 @@ -getFiles($document_srl); - $file_count = count($file_list); - - // 루프를 돌면서 $buff 변수에 java script 코드를 생성 - $buff = ""; - for($i=0;$i<$file_count;$i++) { - $file_info = $file_list[$i]; - if(!$file_info->file_srl) continue; - - $buff .= sprintf("parent.editor_insert_uploaded_file(\"%d\", \"%d\",\"%s\", \"%d\", \"%s\", \"%s\", \"%s\");\n", $document_srl, $file_info->file_srl, $file_info->source_filename, $file_info->file_size, FileHandler::filesize($file_info->file_size), $file_info->direct_download=='Y'?$file_info->uploaded_filename:'', $file_info->sid); - } - - $buff = sprintf("", $document_srl, $buff); - return $buff; - } - } -?> diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index 07d218227..69bb61165 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -131,5 +131,30 @@ return $output; } + /** + * @brief document_srl을 키로 하는 첨부파일을 찾아서 java script 코드로 return + **/ + function printUploadedFileList($document_srl) { + // file의 Model객체 생성 + $oFileModel = getModel('file'); + + // 첨부파일 목록을 구함 + $file_list = $oFileModel->getFiles($document_srl); + $file_count = count($file_list); + + // 루프를 돌면서 $buff 변수에 java script 코드를 생성 + $buff = ""; + for($i=0;$i<$file_count;$i++) { + $file_info = $file_list[$i]; + if(!$file_info->file_srl) continue; + + $buff .= sprintf("parent.editor_insert_uploaded_file(\"%d\", \"%d\",\"%s\", \"%d\", \"%s\", \"%s\", \"%s\");\n", $document_srl, $file_info->file_srl, $file_info->source_filename, $file_info->file_size, FileHandler::filesize($file_info->file_size), $file_info->direct_download=='Y'?$file_info->uploaded_filename:'', $file_info->sid); + } + + $buff = sprintf("", $document_srl, $buff); + print $buff; + exit(); + } + } ?>