mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@100 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
dc1bf81d06
commit
cf88cc4cb2
42 changed files with 209 additions and 1387 deletions
65
modules/file/file.model.php
Normal file
65
modules/file/file.model.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
/**
|
||||
* @class fileModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief file 모듈의 model 클래스
|
||||
**/
|
||||
|
||||
class fileModel extends Module {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 문서에 속한 첨부파일의 개수를 return
|
||||
**/
|
||||
function getFilesCount($document_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->document_srl = $document_srl;
|
||||
$output = $oDB->executeQuery('document.getFilesCount', $args);
|
||||
return (int)$output->data->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 파일 정보를 구함
|
||||
**/
|
||||
function getFile($file_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->file_srl = $file_srl;
|
||||
$output = $oDB->executeQuery('document.getFile', $args);
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 문서에 속한 파일을 모두 return
|
||||
**/
|
||||
function getFiles($document_srl) {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
$args->document_srl = $document_srl;
|
||||
$args->sort_index = 'file_srl';
|
||||
$output = $oDB->executeQuery('document.getFiles', $args);
|
||||
|
||||
$file_list = $output->data;
|
||||
|
||||
if($file_list && !is_array($file_list)) $file_list = array($file_list);
|
||||
|
||||
for($i=0;$i<count($file_list);$i++) {
|
||||
$direct_download = $file_list[$i]->direct_download;
|
||||
|
||||
if($direct_download!='Y') continue;
|
||||
|
||||
$uploaded_filename = Context::getRequestUri().substr($file_list[$i]->uploaded_filename,2);
|
||||
|
||||
$file_list[$i]->uploaded_filename = $uploaded_filename;
|
||||
}
|
||||
return $file_list;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue