mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
위젯 검출 정규 표현식을 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2892 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f9896fe51a
commit
90aa62a6ac
993 changed files with 9190 additions and 10457 deletions
|
|
@ -107,6 +107,13 @@
|
|||
|
||||
// mid값이 있을 경우 mid값을 세팅
|
||||
if($this->mid) Context::set('mid', $this->mid, true);
|
||||
|
||||
// 현재 모듈의 정보를 세팅
|
||||
Context::set('current_module_info', $module_info);
|
||||
|
||||
// 실제 동작을 하기 전에 trigger 호출
|
||||
$output = ModuleHandler::triggerCall('display', 'before', $content);
|
||||
if(!$output->toBool()) die($output->getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -336,5 +343,45 @@
|
|||
// 객체 리턴
|
||||
return $GLOBALS['_loaded_module'][$module][$type][$kind];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief trigger_name, called_position을 주고 trigger 호출
|
||||
**/
|
||||
function triggerCall($trigger_name, $called_position, &$obj) {
|
||||
// 설치가 안되어 있다면 trigger call을 하지 않고 바로 return
|
||||
if(!Context::isInstalled()) return new Object();
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
$cache_dir = sprintf("./files/cache/triggers/");
|
||||
if(!is_dir($cache_dir)) FileHandler::makeDir($cache_dir);
|
||||
|
||||
$cache_file = sprintf("%s%s.%s", $cache_dir, $trigger_name, $called_position);
|
||||
|
||||
if(!@file_exists($cache_file)) {
|
||||
$triggers = $oModuleModel->getTriggers($trigger_name, $called_position);
|
||||
FileHandler::writeFile($cache_file, serialize($triggers));
|
||||
} else {
|
||||
$buff = FileHandler::readFile($cache_file);
|
||||
$triggers = unserialize($buff);
|
||||
}
|
||||
|
||||
if(!$triggers || !count($triggers)) return new Object();
|
||||
|
||||
foreach($triggers as $item) {
|
||||
$module = $item->module;
|
||||
$type = $item->type;
|
||||
$called_method = $item->called_method;
|
||||
|
||||
$oModule = null;
|
||||
$oModule = &getModule($module, $type);
|
||||
if(!$oModule || !method_exists($oModule, $called_method)) continue;
|
||||
|
||||
$output = $oModule->{$called_method}($obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue