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/sandbox@5808 201d5d3c-b55e-5fd7-737f-ddc643e51545
58 lines
2.2 KiB
PHP
58 lines
2.2 KiB
PHP
<?php
|
|
|
|
class wikiController extends wiki {
|
|
|
|
function init() {
|
|
}
|
|
|
|
function procWikiInsertDocument() {
|
|
// 권한 체크
|
|
if(!$this->grant->write_document) return new Object(-1, 'msg_not_permitted');
|
|
$entry = Context::get('entry');
|
|
|
|
// 글작성시 필요한 변수를 세팅
|
|
$obj = Context::getRequestVars();
|
|
$obj->module_srl = $this->module_srl;
|
|
if(!$obj->nick_name) $obj->nick_name = "anonymous";
|
|
if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N';
|
|
|
|
settype($obj->title, "string");
|
|
if($obj->title == '') $obj->title = cut_str(strip_tags($obj->content),20,'...');
|
|
//그래도 없으면 Untitled
|
|
if($obj->title == '') $obj->title = 'Untitled';
|
|
|
|
// document module의 model 객체 생성
|
|
$oDocumentModel = &getModel('document');
|
|
|
|
// document module의 controller 객체 생성
|
|
$oDocumentController = &getController('document');
|
|
|
|
// 이미 존재하는 글인지 체크
|
|
$oDocument = $oDocumentModel->getDocument($obj->document_srl, $this->grant->manager);
|
|
|
|
// 이미 존재하는 경우 수정
|
|
if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) {
|
|
$output = $oDocumentController->updateDocument($oDocument, $obj);
|
|
$msg_code = 'success_updated';
|
|
|
|
// 그렇지 않으면 신규 등록
|
|
} else {
|
|
$output = $oDocumentController->insertDocument($obj);
|
|
$msg_code = 'success_registed';
|
|
$obj->document_srl = $output->get('document_srl');
|
|
$oDocumentController->insertAlias($obj->module_srl, $obj->document_srl, $obj->title);
|
|
}
|
|
|
|
// 오류 발생시 멈춤
|
|
if(!$output->toBool()) return $output;
|
|
|
|
// 결과를 리턴
|
|
$this->add('mid', Context::get('mid'));
|
|
$this->add('document_srl', $output->get('document_srl'));
|
|
|
|
// 성공 메세지 등록
|
|
$this->setMessage($msg_code);
|
|
}
|
|
}
|
|
|
|
?>
|