git-svn-id: http://xe-core.googlecode.com/svn/trunk@155 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-02-22 03:43:06 +00:00
parent 856666328b
commit ad1dc08f0b
5 changed files with 36 additions and 24 deletions

View file

@ -77,7 +77,6 @@
// mid값이 있을 경우 mid값을 세팅 // mid값이 있을 경우 mid값을 세팅
if($this->mid) Context::set('mid', $this->mid, true); 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; if(!$this->act || !$xml_info->action->{$this->act}) $this->act = $xml_info->default_action;
// 설정된 mid가 없을 경우 요청된 act의 standalone 여부 체크 // 설정된 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, grant 값 구함
$type = $xml_info->action->{$this->act}->type; $type = $xml_info->action->{$this->act}->type;
$grant = $xml_info->action->{$this->act}->grant; $grant = $xml_info->action->{$this->act}->grant;
// 모듈 객체 생성 // 모듈 객체 생성
$this->oModule = &$this->getModuleInstance($this->module, $type); $oModule = &$this->getModuleInstance($this->module, $type);
if(!is_object($this->oModule)) return $this->error = 'msg_module_is_not_exists'; if(!is_object($oModule)) {
$this->error = 'msg_module_is_not_exists';
return;
}
// 모듈에 act값을 세팅 // 모듈에 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 모듈 호출 지정 // 모듈을 수행하고 결과가 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 모듈 객체 생성 // 설정된 모듈이 정상이지 않을 경우 message 모듈 객체 생성
if(!$this->oModule || !is_object($this->oModule)) { if(!$oModule || !is_object($oModule)) {
$this->error = 'msg_module_is_not_exists'; $this->error = 'msg_module_is_not_exists';
} }
// 에러가 발생하였을시 처리 // 에러가 발생하였을시 처리
if($this->error) { if($this->error) {
// message 모듈 객체를 생성해서 컨텐츠 생성 // message 모듈 객체를 생성해서 컨텐츠 생성
$oModule = &getView('message'); $oMessageView = &getView('message');
$oModule->setError(-1); $oMessageView->setError(-1);
$oModule->setMessage($this->error); $oMessageView->setMessage($this->error);
$oModule->dispContent(); $oMessageView->dispContent();
// 정상적으로 호출된 객체가 있을 경우 해당 객체의 template를 변경 // 정상적으로 호출된 객체가 있을 경우 해당 객체의 template를 변경
if($this->oModule) { if($oModule) {
$this->oModule->setTemplatePath($oModule->getTemplatePath()); $oModule->setTemplatePath($oMessageView->getTemplatePath());
$this->oModule->setTemplateFile($oModule->getTemplateFile()); $oModule->setTemplateFile($oMessageView->getTemplateFile());
// 그렇지 않으면 message 객체를 호출된 객체로 지정 // 그렇지 않으면 message 객체를 호출된 객체로 지정
} else { } else {
$this->oModule = $oModule; $oModule = $oMessageView;
} }
} }
// 컨텐츠 출력 // 컨텐츠 출력
$oDisplayHandler = new DisplayHandler(); $oDisplayHandler = new DisplayHandler();
$oDisplayHandler->printContent($this->oModule);
$oDisplayHandler->printContent($oModule);
// DB 및 기타 자원의 종결 처리 // DB 및 기타 자원의 종결 처리
Context::close(); Context::close();

View file

@ -41,6 +41,6 @@
**/ **/
$oModuleHandler = new ModuleHandler(); $oModuleHandler = new ModuleHandler();
$oModuleHandler->init(); $oModuleHandler->init();
$oModuleHandler->procModule(); $oModule = &$oModuleHandler->procModule();
$oModuleHandler->displayContent(); $oModuleHandler->displayContent($oModule);
?> ?>

View file

@ -22,7 +22,7 @@
if(!$oMemberModel->isLogged()) return $this->act = 'dispLogin'; if(!$oMemberModel->isLogged()) return $this->act = 'dispLogin';
// 로그인되었는데 관리자(member->is_admin!=1)가 아니면 오류 표시 // 로그인되었는데 관리자(member->is_admin!=1)가 아니면 오류 표시
if($logged_info->is_admin != 'Y') return $this->dispMessage('msg_is_not_administrator'); if($logged_info->is_admin != 'Y') return $this->stop('msg_is_not_administrator');
// 관리자 모듈 목록을 세팅 // 관리자 모듈 목록을 세팅
$oModuleModel = &getModel('module'); $oModuleModel = &getModel('module');
@ -48,8 +48,10 @@
$oModule = &$oModuleHandler->procModule(); $oModule = &$oModuleHandler->procModule();
// 내용을 요청받은 모듈의 것으로 변경 // 내용을 요청받은 모듈의 것으로 변경
if($oModule) {
$this->setTemplatePath($oModule->getTemplatePath()); $this->setTemplatePath($oModule->getTemplatePath());
$this->setTemplateFile($oModule->getTemplateFile()); $this->setTemplateFile($oModule->getTemplateFile());
}
// 없으면 관리자 메인 페이지 출력 // 없으면 관리자 메인 페이지 출력
} else { } else {

View file

@ -9,10 +9,12 @@
</div> </div>
<div id="admin_module_list"> <div id="admin_module_list">
<!--@foreach($module_list as $module_item)--> <!--@foreach($module_list as $module_item)-->
<!--@if($module_item->module != $module)-->
<div <!--@if($module_item->module==$sid)-->style="font-weight:bold;"<!--@end-->> <div <!--@if($module_item->module==$sid)-->style="font-weight:bold;"<!--@end-->>
<a href="{getUrl('sid',$module_item->module,'act','','module_srl','','page','')}">{$module_item->title}</a> <a href="{getUrl('sid',$module_item->module,'act','','module_srl','','page','')}">{$module_item->title}</a>
</div> </div>
<!--@end--> <!--@end-->
<!--@end-->
</div> </div>
<div id="admin_module_content"> <div id="admin_module_content">
{$content} {$content}

View file

@ -15,7 +15,7 @@
$this->setTemplatePath($this->module_path."tpl"); $this->setTemplatePath($this->module_path."tpl");
// 설치가 되어 있으면 오류 // 설치가 되어 있으면 오류
if(Context::isInstalled()) return $this->dispMessage('msg_already_installed'); if(Context::isInstalled()) return $this->stop('msg_already_installed');
// 컨트롤러 생성 // 컨트롤러 생성
$oController = &getController('install'); $oController = &getController('install');