Last active
August 29, 2015 14:01
-
-
Save flyskyko/e9a8b0d121eaac6da226 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class myboardController extends myboard | |
{ | |
public function procMyboardWrite() | |
{ | |
// 권한 체크 | |
if (!$this->grant->write_document) | |
{ | |
return new Object(-1, 'msg_not_permitted'); | |
} | |
// 데이터 준비 | |
$args = new stdClass(); | |
$args->module_srl = $this->module_srl; | |
$args->nick_name = Context::get('nick_name'); | |
$args->title = Context::get('title'); | |
$args->content = Context::get('content'); | |
// document 모듈에 등록 | |
$oDocumentController = getController('document'); | |
$output = $oDocumentController->insertDocument($args); | |
// 결과 체크 | |
if (!$output->toBool()) | |
{ | |
return $output; | |
} | |
// 성공 시 글 보기 화면으로 이동 | |
$returnUrl = getNotEncodedUrl('', 'mid', $this->mid, 'document_srl', $output->get('document_srl')); | |
$this->setRedirectUrl($returnUrl); | |
} | |
} | |
/* End of file: myboard.controller.php */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
파일 경로 : XE-ROOT/modules/myboard/myboard.controller.php