mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +09:00
issue 49 add opage module and article type
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8491 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f9b695f734
commit
3c313f80a9
31 changed files with 859 additions and 56 deletions
|
|
@ -43,6 +43,27 @@
|
|||
$args = $module_info;
|
||||
}
|
||||
}
|
||||
|
||||
switch ($args->page_type){
|
||||
case 'WIDGET' : {
|
||||
unset($args->skin);
|
||||
unset($args->mskin);
|
||||
unset($args->opage_path);
|
||||
unset($args->opage_mpath);
|
||||
break;
|
||||
}
|
||||
case 'ARTICLE' : {
|
||||
unset($args->page_caching_interval);
|
||||
unset($args->opage_path);
|
||||
unset($args->opage_mpath);
|
||||
break;
|
||||
}
|
||||
case 'OUTSIDE' : {
|
||||
unset($args->skin);
|
||||
unset($args->mskin);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Insert/update depending on module_srl
|
||||
if(!$args->module_srl) {
|
||||
$output = $oModuleController->insertModule($args);
|
||||
|
|
@ -205,5 +226,57 @@
|
|||
$oWidgetController->recompileWidget($content);
|
||||
}
|
||||
|
||||
function procPageAdminArticleDocumentInsert(){
|
||||
$logged_info = Context::get('logged_info');
|
||||
if ($logged_info->is_admin != 'Y')return new Object(-1, 'msg_not_permitted');
|
||||
|
||||
$obj = Context::getRequestVars();
|
||||
$obj->module_srl = $this->module_info->module_srl;
|
||||
$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, true);
|
||||
|
||||
$bAnonymous = false;
|
||||
|
||||
// 이미 존재하는 경우 수정
|
||||
if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) {
|
||||
$output = $oDocumentController->updateDocument($oDocument, $obj);
|
||||
$msg_code = 'success_updated';
|
||||
// 그렇지 않으면 신규 등록
|
||||
} else {
|
||||
$output = $oDocumentController->insertDocument($obj, $bAnonymous);
|
||||
$msg_code = 'success_registed';
|
||||
$obj->document_srl = $output->get('document_srl');
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$this->module_info->document_srl = $obj->document_srl;
|
||||
$oModuleController->updateModule($this->module_info);
|
||||
|
||||
}
|
||||
|
||||
// 오류 발생시 멈춤
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 결과를 리턴
|
||||
$this->add('mid', Context::get('mid'));
|
||||
$this->add('document_srl', $output->get('document_srl'));
|
||||
|
||||
// 성공 메세지 등록
|
||||
$this->setMessage($msg_code);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue