mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 08:49:56 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@155 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
856666328b
commit
ad1dc08f0b
5 changed files with 36 additions and 24 deletions
|
|
@ -77,7 +77,6 @@
|
|||
|
||||
// mid값이 있을 경우 mid값을 세팅
|
||||
if($this->mid) Context::set('mid', $this->mid, true);
|
||||
//if($this->module) Context::set('module', $this->module, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -97,57 +96,66 @@
|
|||
if(!$this->act || !$xml_info->action->{$this->act}) $this->act = $xml_info->default_action;
|
||||
|
||||
// 설정된 mid가 없을 경우 요청된 act의 standalone 여부 체크
|
||||
if(!$this->mid && !$xml_info->action->{$this->act}->standalone) return $this->error = 'msg_module_is_not_standalone';
|
||||
if(!$this->mid && !$xml_info->action->{$this->act}->standalone) {
|
||||
$this->error = 'msg_module_is_not_standalone';
|
||||
return;
|
||||
}
|
||||
|
||||
// type, grant 값 구함
|
||||
$type = $xml_info->action->{$this->act}->type;
|
||||
$grant = $xml_info->action->{$this->act}->grant;
|
||||
|
||||
// 모듈 객체 생성
|
||||
$this->oModule = &$this->getModuleInstance($this->module, $type);
|
||||
if(!is_object($this->oModule)) return $this->error = 'msg_module_is_not_exists';
|
||||
$oModule = &$this->getModuleInstance($this->module, $type);
|
||||
if(!is_object($oModule)) {
|
||||
$this->error = 'msg_module_is_not_exists';
|
||||
return;
|
||||
}
|
||||
|
||||
// 모듈에 act값을 세팅
|
||||
$this->oModule->setAct($this->act);
|
||||
$oModule->setAct($this->act);
|
||||
|
||||
// 모듈 정보 세팅
|
||||
$this->oModule->setModuleInfo($this->module_info, $xml_info);
|
||||
$oModule->setModuleInfo($this->module_info, $xml_info);
|
||||
|
||||
// 모듈을 수행하고 결과가 false이면 message 모듈 호출 지정
|
||||
if(!$this->oModule->proc()) $this->error = $this->oModule->getMessage();
|
||||
if(!$oModule->proc()) $this->error = $oModule->getMessage();
|
||||
|
||||
return $oModule;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ 실행된 모듈의 컨텐츠를 출력
|
||||
**/
|
||||
function displayContent() {
|
||||
function displayContent(&$oModule = NULL) {
|
||||
// 설정된 모듈이 정상이지 않을 경우 message 모듈 객체 생성
|
||||
if(!$this->oModule || !is_object($this->oModule)) {
|
||||
if(!$oModule || !is_object($oModule)) {
|
||||
$this->error = 'msg_module_is_not_exists';
|
||||
}
|
||||
|
||||
// 에러가 발생하였을시 처리
|
||||
if($this->error) {
|
||||
// message 모듈 객체를 생성해서 컨텐츠 생성
|
||||
$oModule = &getView('message');
|
||||
$oModule->setError(-1);
|
||||
$oModule->setMessage($this->error);
|
||||
$oModule->dispContent();
|
||||
$oMessageView = &getView('message');
|
||||
$oMessageView->setError(-1);
|
||||
$oMessageView->setMessage($this->error);
|
||||
$oMessageView->dispContent();
|
||||
|
||||
// 정상적으로 호출된 객체가 있을 경우 해당 객체의 template를 변경
|
||||
if($this->oModule) {
|
||||
$this->oModule->setTemplatePath($oModule->getTemplatePath());
|
||||
$this->oModule->setTemplateFile($oModule->getTemplateFile());
|
||||
if($oModule) {
|
||||
$oModule->setTemplatePath($oMessageView->getTemplatePath());
|
||||
$oModule->setTemplateFile($oMessageView->getTemplateFile());
|
||||
|
||||
// 그렇지 않으면 message 객체를 호출된 객체로 지정
|
||||
} else {
|
||||
$this->oModule = $oModule;
|
||||
$oModule = $oMessageView;
|
||||
}
|
||||
}
|
||||
|
||||
// 컨텐츠 출력
|
||||
$oDisplayHandler = new DisplayHandler();
|
||||
$oDisplayHandler->printContent($this->oModule);
|
||||
|
||||
$oDisplayHandler->printContent($oModule);
|
||||
|
||||
// DB 및 기타 자원의 종결 처리
|
||||
Context::close();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue