외부페이지모듈(opage)에서 내부 php/html파일을 호출시 위젯이나 ZBXE 템플릿 문법과 변수를 쓸수 있도록 코드 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2632 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-09-20 05:06:04 +00:00
parent 8535b11b9f
commit 8235bde05b
2 changed files with 69 additions and 25 deletions

View file

@ -64,6 +64,19 @@
return $output;
}
/**
* @brief 주어진 파일을 컴파일 바로 return
**/
function compileDirect($tpl_path, $tpl_filename) {
$this->tpl_path = $tpl_path;
$this->tpl_file = $tpl_file;
$tpl_file = $tpl_path.$tpl_filename;
if(!file_exists($tpl_file)) return;
return $this->_compileTplFile($tpl_file);
}
/**
* @brief tpl_file이 컴파일이 되어 있는 것이 있는지 체크
**/
@ -78,7 +91,7 @@
/**
* @brief tpl_file을 compile
**/
function _compileTplFile($tpl_file, $compiled_tpl_file) {
function _compileTplFile($tpl_file, $compiled_tpl_file = '') {
// tpl 파일을 읽음
$buff = FileHandler::readFile($tpl_file);
@ -112,7 +125,7 @@
// $buff = preg_replace('/ +/', ' ', $buff);
// 컴파일된 코드를 파일에 저장
FileHandler::writeFile($compiled_tpl_file, $buff);
if($compiled_tpl_file) FileHandler::writeFile($compiled_tpl_file, $buff);
return $buff;
}