mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
게시글과 댓글을 작성 및 수정시 대기된 파일을 공개하는 방식을 변경
파일이 대기모드에서 공개할때 트리거에서 직접 호출 하는 방식으로 변경
This commit is contained in:
parent
234ad09867
commit
2cb477fd55
4 changed files with 44 additions and 100 deletions
|
|
@ -633,36 +633,6 @@ class fileController extends file
|
|||
$this->add('file_size_total', $fileSizeTotal);
|
||||
$this->add('file_size_total_human', FileHandler::filesize($fileSizeTotal));
|
||||
}
|
||||
/**
|
||||
* A trigger to return numbers of attachments in the upload_target_srl (document_srl)
|
||||
*
|
||||
* @param object $obj Trigger object
|
||||
* @return Object
|
||||
*/
|
||||
function triggerCheckAttached(&$obj)
|
||||
{
|
||||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl) return;
|
||||
|
||||
// Get numbers of attachments
|
||||
$obj->uploaded_count = FileModel::getFilesCount($document_srl);
|
||||
// TODO: WTF are we doing with uploaded_count anyway?
|
||||
}
|
||||
|
||||
/**
|
||||
* A trigger to link the attachment with the upload_target_srl (document_srl)
|
||||
*
|
||||
* @param object $obj Trigger object
|
||||
* @return Object
|
||||
*/
|
||||
function triggerAttachFiles(&$obj)
|
||||
{
|
||||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl) return;
|
||||
|
||||
$output = $this->setFilesValid($document_srl, 'doc');
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* A trigger to delete the attachment in the upload_target_srl (document_srl)
|
||||
|
|
@ -679,36 +649,6 @@ class fileController extends file
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* A trigger to return numbers of attachments in the upload_target_srl (comment_srl)
|
||||
*
|
||||
* @param object $obj Trigger object
|
||||
* @return Object
|
||||
*/
|
||||
function triggerCommentCheckAttached(&$obj)
|
||||
{
|
||||
$comment_srl = $obj->comment_srl;
|
||||
if(!$comment_srl) return;
|
||||
// Get numbers of attachments
|
||||
$obj->uploaded_count = FileModel::getFilesCount($comment_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* A trigger to link the attachment with the upload_target_srl (comment_srl)
|
||||
*
|
||||
* @param object $obj Trigger object
|
||||
* @return Object
|
||||
*/
|
||||
function triggerCommentAttachFiles(&$obj)
|
||||
{
|
||||
$comment_srl = $obj->comment_srl;
|
||||
$uploaded_count = $obj->uploaded_count;
|
||||
if(!$comment_srl || !$uploaded_count) return;
|
||||
|
||||
$output = $this->setFilesValid($comment_srl, 'com');
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* A trigger to delete the attachment in the upload_target_srl (comment_srl)
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue