git-svn-id: http://xe-core.googlecode.com/svn/trunk@131 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-02-20 12:11:42 +00:00
parent 2525fe0838
commit d21fbeb6c6
19 changed files with 132 additions and 65 deletions

View file

@ -35,7 +35,7 @@
// 원본글을 가져옴
$document = $oDocumentModel->getDocument($document_srl);
if(!$document_srl) return new Object(-1,'msg_invalid_document');
if($document_srl != $document->document_srl) return new Object(-1,'msg_invalid_document');
if($document->lock_comment=='Y') return new Object(-1,'msg_invalid_request');
// 댓글를 입력
@ -55,13 +55,16 @@
// 해당 글의 전체 댓글 수를 구해옴
$comment_count = $oCommentModel->getCommentCount($document_srl);
// document의 controller 객체 생성
$oDocumentController = &getController('document');
// 해당글의 댓글 수를 업데이트
$output = $this->updateCommentCount($document_srl, $comment_count);
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count);
// 댓글의 권한을 부여
$this->addGrant($obj->comment_srl);
$output->add('comment_srl', $obj->comment_srl);
$output->add('comment_srl', $obj->comment_srl);
return $output;
}

View file

@ -35,10 +35,11 @@
/**
* @brief 댓글 가져오기
**/
function getComment($comment_srl) {
function getComment($comment_srl, $is_admin = false) {
$oDB = &DB::getInstance();
$args->comment_srl = $comment_srl;
$output = $oDB->executeQuery('comment.getComment', $args);
if($is_admin || $this->isGranted($comment_srl)) $output->data->is_granted = true;
return $output->data;
}
@ -68,7 +69,7 @@
/**
* @brief document_srl에 해당하는 문서의 댓글 목록을 가져옴
**/
function getCommentList($document_srl) {
function getCommentList($document_srl, $is_admin = false) {
$oDB = &DB::getInstance();
$args->document_srl = $document_srl;