mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-23 20:32:14 +09:00
#19122530 Module Extend 지원
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7684 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
8595952528
commit
f55fbeef9d
3 changed files with 96 additions and 3 deletions
|
|
@ -78,6 +78,45 @@
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief module extend 추가
|
||||
*
|
||||
**/
|
||||
function insertModuleExtend($parent_module, $extend_module, $type, $kind=''){
|
||||
if($kind!='admin') $kind = '';
|
||||
if(!in_array($type,array('model','controller','view')) || !in_array($kind,array('svc','admin'))) return;
|
||||
|
||||
$cache_file = './files/config/module_extend.php';
|
||||
FileHandler::removeFile($cache_file);
|
||||
|
||||
$args->parent_module = $parent_module;
|
||||
$args->extend_module = $extend_module;
|
||||
$args->type = $type;
|
||||
$args->kind = $kind;
|
||||
|
||||
$output = executeQuery('module.insertModuleExtend', $args);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief module extend 삭제
|
||||
*
|
||||
**/
|
||||
function deleteModuleExtend($parent_module, $extend_module, $type, $kind=''){
|
||||
$cache_file = './files/config/module_extend.php';
|
||||
FileHandler::deleteFile($cache_file);
|
||||
|
||||
$args->parent_module = $parent_module;
|
||||
$args->extend_module = $extend_module;
|
||||
$args->type = $type;
|
||||
$args->kind = $kind;
|
||||
|
||||
$output = executeQuery('module.deleteModuleExtend', $args);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 모듈의 설정 입력
|
||||
* board, member등 특정 모듈의 global config 관리용
|
||||
|
|
|
|||
|
|
@ -295,6 +295,46 @@
|
|||
return $output->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 module extend 가져옴
|
||||
**/
|
||||
function getModuleExtend($parent_module, $type, $kind='') {
|
||||
$module_extend_info = $this->loadModuleExtends();
|
||||
$extend = $module_extend_info[$parent_module.'.'.$kind.'.'.$type];
|
||||
|
||||
return $extend;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모든 module extend 가져옴
|
||||
**/
|
||||
function loadModuleExtends() {
|
||||
$cache_file = './files/config/module_extend.php';
|
||||
$cache_file = FileHandler::getRealPath($cache_file);
|
||||
|
||||
if(!isset($GLOBALS['__MODULE_EXTEND__'])){
|
||||
if(!file_exists($cache_file)) {
|
||||
|
||||
$arr = array();
|
||||
$output = executeQueryArray('module.getModuleExtend');
|
||||
if($output->data){
|
||||
foreach($output->data as $v){
|
||||
$arr[] = sprintf("'%s.%s.%s' => '%s'", $v->parent_module, $v->type, $v->kind, $v->extend_module);
|
||||
}
|
||||
}
|
||||
|
||||
$str = '<?PHP $__module_extend_info__=array(%s); return $__module_extend_info__; ?>';
|
||||
$str = sprintf($str, join(',',$arr));
|
||||
|
||||
FileHandler::writeFile($cache_file, $str);
|
||||
}
|
||||
|
||||
$GLOBALS['__MODULE_EXTEND__'] = include($cache_file);
|
||||
}
|
||||
|
||||
return $GLOBALS['__MODULE_EXTEND__'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈의 conf/info.xml 을 읽어서 정보를 구함
|
||||
**/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue