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

This commit is contained in:
zero 2007-03-21 08:18:40 +00:00
parent 3958be025e
commit a457add255
12 changed files with 186 additions and 139 deletions

View file

@ -2,47 +2,43 @@
/**
* @class editor
* @author zero (zero@nzeo.com)
* @brief editor 모듈의 high class
* @brief editor 모듈의 controller class
**/
class editor extends ModuleObject {
class editorController extends editor {
/**
* @brief 설치시 추가 작업이 필요할시 구현
* @brief 초기화
**/
function moduleInstall() {
return new Object();
function init() {
}
/**
* @brief 설치가 이상이 없는지 체크하는 method
**/
function moduleIsInstalled() {
return new Object();
}
/**
* @brief 업데이트 실행
* @brief 컴포넌트에서 ajax요청시 해당 컴포넌트의 method를 실행
**/
function moduleUpdate() {
return new Object();
}
function procCall() {
$component = Context::get('component');
$method = Context::get('method');
if(!$component) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
/**
* @brief component의 객체 생성
**/
function getComponentObject($component, $upload_target_srl) {
// 해당 컴포넌트의 객체를 생성해서 실행
$class_path = sprintf('%scomponents/%s/', $this->module_path, $component);
$class_file = sprintf('%s%s.class.php', $class_path, $component);
if(!file_exists($class_file)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
$oComponent = &$this->getComponentObject($component);
if(!$oComponent->toBool()) return $oComponent;
if(!method_exists($oComponent, $method)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
$output = call_user_method($method, $oComponent);
if((is_a($output, 'Object') || is_subclass_of($output, 'Object')) && !$output->toBool()) return $output;
$this->setError($oComponent->getError());
$this->setMessage($oComponent->getMessage());
$vars = $oComponent->getVariables();
if(count($vars)) {
foreach($vars as $key=>$val) $this->add($key, $val);
}
require_once($class_file);
$eval_str = sprintf('$oComponent = new %s("%s","%s");', $component, $upload_target_srl, $class_path);
@eval($eval_str);
if(!$oComponent) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
return $oComponent;
}
}
?>