From d0aeb583ec6be79f18be398002141302bed4771f Mon Sep 17 00:00:00 2001 From: zero Date: Mon, 5 Mar 2007 08:40:37 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@247 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/addon/addon.class.php | 2 ++ modules/addon/addon.controller.php | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/modules/addon/addon.class.php b/modules/addon/addon.class.php index 24b1de595..f88b2a2eb 100644 --- a/modules/addon/addon.class.php +++ b/modules/addon/addon.class.php @@ -7,5 +7,7 @@ class addon extends ModuleObject { + var $cache_file = "./files/cache/activated_addons.cache.php"; + } ?> diff --git a/modules/addon/addon.controller.php b/modules/addon/addon.controller.php index b02884759..0eeaea4a0 100644 --- a/modules/addon/addon.controller.php +++ b/modules/addon/addon.controller.php @@ -17,11 +17,11 @@ * @brief 애드온의 활성/비활성 체인지 **/ function procToggleActivateAddon() { + $oAddonModel = &getModel('addon'); + // addon값을 받아옴 $addon = Context::get('addon'); if($addon) { - $oAddonModel = &getModel('addon'); - // 활성화 되어 있으면 비활성화 시킴 if($oAddonModel->isActivatedAddon($addon)) $this->doDeactivate($addon); @@ -29,6 +29,21 @@ else $this->doActivate($addon); } + // 모듈에서 애드온을 사용하기 위한 캐시 파일 생성 + $buff = ""; + $addon_list = $oAddonModel->getActivatedAddons(); + $addon_count = count($addon_list); + for($i=0;$i<$addon_count;$i++) { + $addon = trim($addon_list[$i]); + if(!$addon) continue; + + $buff .= sprintf(' include("./files/addons/%s/%s.addon.php"); ', $addon, $addon); + } + + $buff = sprintf('', $buff); + + FileHandler::writeFile($this->cache_file, $buff); + // 페이지를 애드온 목록으로 이동 $this->setRedirectUrl("./?module=admin&act=dispAddonList"); }