mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-25 06:09:55 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1628 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
3f649ab32a
commit
67572cebaf
39 changed files with 543 additions and 459 deletions
|
|
@ -79,27 +79,31 @@
|
|||
// document 객체를 생성. 기본 데이터 구조의 경우 document모듈만 쓰면 만사 해결.. -_-;
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
$oDocument = $oDocumentModel->getDocument(0, $this->grant->manager);
|
||||
|
||||
// document_srl이 있다면 해당 글을 구해오자
|
||||
if($this->grant->list && $document_srl) {
|
||||
|
||||
// 글을 구함
|
||||
$document = $oDocumentModel->getDocument($document_srl, $this->grant->manager, true);
|
||||
$oDocument->setDocument($document_srl);
|
||||
|
||||
// 찾아지지 않았다면 초기화
|
||||
if($document->document_srl != $document_srl) {
|
||||
unset($document);
|
||||
if(!$oDocument->isExists()) {
|
||||
unset($document_srl);
|
||||
Context::set('document_srl','',true);
|
||||
} else {
|
||||
// 브라우저 타이틀 설정
|
||||
Context::setBrowserTitle($oDocument->getTitleText());
|
||||
|
||||
// 글이 찾아졌으면 댓글 권한과 허용 여부를 체크하여 댓글 에디터 세팅
|
||||
} elseif($this->grant->write_comment && $document->allow_comment == 'Y' && $document->lock_comment != 'Y') {
|
||||
// 브라우저 타이틀
|
||||
$browser_title = $this->module_info->browser_title.' - '.$document->title;
|
||||
Context::setBrowserTitle($browser_title);
|
||||
// 댓글에디터 설정
|
||||
if($this->grant->write_comment && $oDocument->allowComment() && !$oDocument->isLocked()) $this->setCommentEditor(0, 100);
|
||||
|
||||
// 조회수 증가
|
||||
$oDocument->updateReadedCount();
|
||||
}
|
||||
|
||||
Context::set('document', $document);
|
||||
}
|
||||
Context::set('oDocument', $oDocument);
|
||||
|
||||
// 댓글
|
||||
$this->setCommentEditor(0, 100);
|
||||
|
|
@ -167,23 +171,21 @@
|
|||
|
||||
// document 모듈 객체 생성
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
|
||||
|
||||
// 지정된 글이 없다면 (신규) 새로운 번호를 만든다
|
||||
if($document_srl) {
|
||||
$document = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
|
||||
if(!$document) {
|
||||
unset($document_srl);
|
||||
Context::set('document_srl','');
|
||||
}
|
||||
if(!$oDocument->isExists()) {
|
||||
unset($document_srl);
|
||||
Context::set('document_srl','');
|
||||
}
|
||||
|
||||
if(!$document_srl) $document_srl = getNextSequence();
|
||||
|
||||
// 글을 수정하려고 할 경우 권한이 없는 경우 비밀번호 입력화면으로
|
||||
if($document&&!$document->is_granted) return $this->setTemplateFile('input_password_form');
|
||||
if($oDocument->isExists()&&!$oDocument->isGranted()) return $this->setTemplateFile('input_password_form');
|
||||
|
||||
Context::set('document_srl',$document_srl);
|
||||
Context::set('document', $document);
|
||||
Context::set('oDocument', $oDocument);
|
||||
|
||||
// 에디터 모듈의 getEditor를 호출하여 세팅
|
||||
$oEditorModel = &getModel('editor');
|
||||
|
|
@ -209,19 +211,16 @@
|
|||
// 삭제할 문서번호를 가져온다
|
||||
$document_srl = Context::get('document_srl');
|
||||
|
||||
// 지정된 글이 있는지 확인
|
||||
if($document_srl) {
|
||||
$oDocumentModel = &getModel('document');
|
||||
$document = $oDocumentModel->getDocument($document_srl);
|
||||
}
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
|
||||
|
||||
// 삭제하려는 글이 없으면 에러
|
||||
if(!$document) return $this->dispBlogContent();
|
||||
if(!$oDocument->isExists()) return $this->dispBlogContent();
|
||||
|
||||
// 권한이 없는 경우 비밀번호 입력화면으로
|
||||
if($document&&!$document->is_granted) return $this->setTemplateFile('input_password_form');
|
||||
if($oDocument->isExists()&&!$oDocument->isGranted()) return $this->setTemplateFile('input_password_form');
|
||||
|
||||
Context::set('document',$document);
|
||||
Context::set('oDocument',$oDocument);
|
||||
|
||||
$this->setTemplateFile('delete_form');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue