SWFUploader 버전 업그레이드. Flash10에 따른 파일업로드 동작 오류 수정. 내부적으로 파일업로드와 글/댓글/페이지의 관계 구조 개선

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4680 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-10-24 09:39:36 +00:00
parent 0973e8ab4e
commit 7df9c7eb8e
17 changed files with 1229 additions and 277 deletions

View file

@ -5,6 +5,8 @@
<action name="dispFileAdminList" type="view" admin_index="true" standalone="true" />
<action name="dispFileAdminConfig" type="view" standalone="true" />
<action name="getFileList" type="model" standalone="true" />
<action name="procFileUpload" type="controller" standalone="true" />
<action name="procFileDelete" type="controller" standalone="true" />
<action name="procFileDownload" type="controller" standalone="true" />

View file

@ -85,8 +85,10 @@
$args->document_srls = implode(',', $document_srl_list);
$document_output = executeQueryArray('document.getDocuments', $args);
foreach($document_output->data as $document) {
$document_list[$document->document_srl] = $document;
if($document_output->data) {
foreach($document_output->data as $document) {
$document_list[$document->document_srl] = $document;
}
}
}
@ -119,4 +121,4 @@
}
}
?>
?>

View file

@ -28,8 +28,7 @@
// upload_target_srl 구함
$upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
if(!$upload_target_srl) {
$upload_target_srl = getNextSequence();
$this->setUploadInfo($editor_sequence, $upload_target_srl);
$_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl = getNextSequence();
}
$file_info = Context::get('Filedata');

View file

@ -13,6 +13,43 @@
function init() {
}
/**
* @brief 특정 문서에 속한 첨부파일 목록을 return
**/
function getFileList() {
$editor_sequence = Context::get("editor_sequence");
$upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
if(!$upload_target_srl) exit();
$tmp_files = $this->getFiles($upload_target_srl);
$file_count = count($tmp_files);
for($i=0;$i<$file_count;$i++) {
$file_info = $tmp_files[$i];
if(!$file_info->file_srl) continue;
$obj = null;
$obj->file_srl = $file_info->file_srl;
$obj->source_filename = $file_info->source_filename;
$obj->file_size = $file_info->file_size;
$obj->disp_file_size = FileHandler::filesize($file_info->file_size);
if($file_info->direct_download=='N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid);
else $obj->download_url = str_replace('./', '', $file_info->uploaded_filename);
$obj->direct_download = $file_info->direct_download;
$files[] = $obj;
$attached_size += $file_info->file_size;
}
// 업로드 상태 표시 작성
$upload_status = $this->getUploadStatus($attached_size);
// 필요한 정보들 세팅
$this->add("files",$files);
$this->add("editor_sequence",$editor_sequence);
$this->add("upload_target_srl",$upload_target_srl);
$this->add("upload_status",$upload_status);
}
/**
* @brief 특정 문서에 속한 첨부파일의 개수를 return
**/
@ -100,8 +137,8 @@
if($logged_info->is_admin == 'Y') {
//$file_config->allowed_filesize = 1024;
//$file_config->allowed_attach_size = 1024;
$file_config->allowed_filesize = ini_get('upload_max_filesize');
$file_config->allowed_attach_size = ini_get('upload_max_filesize');
$file_config->allowed_filesize = preg_replace("/[a-z]/is","",ini_get('upload_max_filesize'));
$file_config->allowed_attach_size = preg_replace("/[a-z]/is","",ini_get('upload_max_filesize'));
$file_config->allowed_filetypes = '*.*';
} else {
$module_srl = Context::get('module_srl');