mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@115 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c5f6d078b6
commit
7d1693ad99
43 changed files with 238 additions and 58 deletions
|
|
@ -5,7 +5,7 @@
|
|||
* @brief module의 abstract class
|
||||
**/
|
||||
|
||||
class Module extends Object {
|
||||
class ModuleObject extends Object {
|
||||
|
||||
var $mid = NULL; ///< module로 생성한 instance(관리상)의 값
|
||||
var $module = NULL; ///< mid로 찾아서 생성한 모듈 class 이름
|
||||
|
|
@ -122,6 +122,38 @@
|
|||
return $this->template_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief layout 파일 지정
|
||||
**/
|
||||
function setLayoutFile($filename) {
|
||||
if(substr($filename,-5)!='.html') $filename .= '.html';
|
||||
$this->layout_file = $filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief layout 파일 return
|
||||
**/
|
||||
function getLayoutFile() {
|
||||
return $this->layout_file;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief layout 경로 지정
|
||||
**/
|
||||
function setLayoutPath($path) {
|
||||
if(substr($path,-1)!='/') $path .= '/';
|
||||
if(substr($path,0,2)!='./') $path = './'.$path;
|
||||
$this->layout_path = $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief layout 경로 return
|
||||
**/
|
||||
function getLayoutPath() {
|
||||
return $this->layout_path;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 모듈의 action에 해당하는 method를 실행
|
||||
*
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@
|
|||
Context::set('act', $act, true);
|
||||
|
||||
// 모듈 객체 생성
|
||||
$oModule = $this->getModuleInstance($module, $type);
|
||||
$oModule = &$this->getModuleInstance($module, $type);
|
||||
|
||||
// 모듈 정보 세팅
|
||||
$oModule->setModuleInfo($module_info);
|
||||
|
|
@ -111,6 +111,11 @@
|
|||
* ./files/modules/* 의 클래스 파일을 우선으로 처리해야 함
|
||||
**/
|
||||
|
||||
// 상위 클래스명 구함
|
||||
$high_class_file = sprintf('%s%s.class.php', $class_path, $module);
|
||||
if(!file_exists($high_class_file)) return NULL;
|
||||
require_once($high_class_file);
|
||||
|
||||
// 객체의 이름을 구함
|
||||
switch($type) {
|
||||
case 'controller' :
|
||||
|
|
@ -137,12 +142,12 @@
|
|||
@eval($eval_str);
|
||||
if(!is_object($oModule)) return NULL;
|
||||
|
||||
// 생성된 객체에 자신이 호출된 위치를 세팅해줌
|
||||
$oModule->setModulePath($class_path);
|
||||
|
||||
// 해당 위치에 속한 lang 파일을 읽음
|
||||
Context::loadLang($class_path.'lang');
|
||||
|
||||
// 생성된 객체에 자신이 호출된 위치를 세팅해줌
|
||||
$oModule->setModulePath($class_path);
|
||||
|
||||
// GLOBALS 변수에 생성된 객체 저장
|
||||
$GLOBALS['_loaded_module'][$module][$type] = $oModule;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue