mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
모듈별 API 기능을 위한 코드 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4709 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
566972bd64
commit
fe96e73374
3 changed files with 22 additions and 6 deletions
|
|
@ -164,6 +164,7 @@
|
|||
$oModule->setAct($this->act);
|
||||
|
||||
// 모듈 정보 세팅
|
||||
$this->module_info->module_type = $type;
|
||||
$oModule->setModuleInfo($this->module_info, $xml_info);
|
||||
|
||||
// 모듈을 수행하고 결과가 false이면 message 모듈 호출 지정
|
||||
|
|
@ -307,6 +308,10 @@
|
|||
$class_file = sprintf('%s%s%s.%s.php', _XE_PATH_, $class_path, $module, $type);
|
||||
}
|
||||
break;
|
||||
case 'api' :
|
||||
$instance_name = sprintf("%s%s",$module,"API");
|
||||
$class_file = sprintf('%s%s%s.api.php', _XE_PATH_, $class_path, $module);
|
||||
break;
|
||||
case 'class' :
|
||||
$instance_name = $module;
|
||||
$class_file = sprintf('%s%s%s.class.php', _XE_PATH_, $class_path, $module);
|
||||
|
|
|
|||
|
|
@ -303,8 +303,6 @@
|
|||
if(!$this->stop_proc) {
|
||||
// 현재 모듈에 act값이 있으면 해당 act를 실행
|
||||
if(method_exists($this, $this->act)) {
|
||||
//$output = call_user_method($this->act, $this);
|
||||
//$output = call_user_func(array($this, $this->act));
|
||||
$output = $this->{$this->act}();
|
||||
|
||||
// act가 없으면 action_forward에서 해당하는 act가 있는지 찾아서 대신 실행
|
||||
|
|
@ -321,8 +319,6 @@
|
|||
$oModule->init();
|
||||
$oModule->setModuleInfo($this->module_info, $xml_info);
|
||||
|
||||
//$output = call_user_method($forward->act, $oModule);
|
||||
//$output = call_user_func(array($oModule, $forward->act));
|
||||
$output = $oModule->{$forward->act}();
|
||||
|
||||
$this->setTemplatePath($oModule->getTemplatePath());
|
||||
|
|
@ -330,8 +326,6 @@
|
|||
|
||||
} else {
|
||||
if($this->xml_info->default_index_act) {
|
||||
//$output = call_user_method($this->xml_info->default_index_act, $this);
|
||||
//$output = call_user_func(array($this, $this->xml_info->default_index_act));
|
||||
if(method_exists($this, $this->xml_info->default_index_act)) {
|
||||
$output = $this->{$this->xml_info->default_index_act}();
|
||||
}
|
||||
|
|
@ -355,6 +349,14 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
// view action이고 결과 출력이 XMLRPC일 경우 해당 모듈의 api method를 실행
|
||||
if(Context::getResponseMethod() == 'XMLRPC' && $this->module_info->module_type == 'view') {
|
||||
$oAPI = getAPI($this->module_info->module, 'api');
|
||||
if(method_exists($oAPI, $this->act)) {
|
||||
$oAPI->{$this->act}($this);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,6 +138,15 @@
|
|||
return getModule($module_name, 'model','admin');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief module의 api 객체 생성용
|
||||
* @param module_name 모듈이름
|
||||
* @return module api class instance
|
||||
**/
|
||||
function &getAPI($module_name) {
|
||||
return getModule($module_name, 'api');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief module의 상위 class 객체 생성용
|
||||
* @param module_name 모듈이름
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue