From 82507fd8118780dd7b96cdd8791109176c7a34aa Mon Sep 17 00:00:00 2001 From: zero Date: Wed, 13 Jun 2007 01:27:59 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@1618 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/context/Context.class.php | 1 + modules/editor/editor.model.php | 31 ++++++++++++++++++------------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 09baf8d1d..92850d1e8 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -800,6 +800,7 @@ $buff = $matches[0]; $buff = preg_replace('/([^=^"^ ]*)=([^"])([^=^ ]*)/i', '$1="$2$3"', $buff); $buff = str_replace("&","&",$buff); + debugPrint($buff); // 플러그인에서 생성된 코드 (img, div태그내에 editor_plugin코드 존재)의 parameter를 추출 $oXmlParser = new XmlParser(); diff --git a/modules/editor/editor.model.php b/modules/editor/editor.model.php index 99682130b..cfaff9238 100644 --- a/modules/editor/editor.model.php +++ b/modules/editor/editor.model.php @@ -7,6 +7,8 @@ class editorModel extends editor { + var $loaded_component_list = array(); + /** * @brief 에디터를 return **/ @@ -122,22 +124,25 @@ * @brief component의 객체 생성 **/ function getComponentObject($component, $upload_target_srl = 0) { - // 해당 컴포넌트의 객체를 생성해서 실행 - $class_path = sprintf('%s/components/%s/', $this->module_path, $component); - $class_file = sprintf('%s%s.class.php', $class_path, $component); - if(!file_exists($class_file)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); + if(!$this->loaded_component_list[$component][$upload_target_srl]) { + // 해당 컴포넌트의 객체를 생성해서 실행 + $class_path = sprintf('%s/components/%s/', $this->module_path, $component); + $class_file = sprintf('%s%s.class.php', $class_path, $component); + if(!file_exists($class_file)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); - // 클래스 파일을 읽은 후 객체 생성 - require_once($class_file); - $eval_str = sprintf('$oComponent = new %s("%s","%s");', $component, $upload_target_srl, $class_path); - @eval($eval_str); - if(!$oComponent) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); + // 클래스 파일을 읽은 후 객체 생성 + require_once($class_file); + $eval_str = sprintf('$oComponent = new %s("%s","%s");', $component, $upload_target_srl, $class_path); + @eval($eval_str); + if(!$oComponent) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); - // 설정 정보를 추가 - $component_info = $this->getComponent($component); - $oComponent->setInfo($component_info); + // 설정 정보를 추가 + $component_info = $this->getComponent($component); + $oComponent->setInfo($component_info); + $this->loaded_component_list[$component][$upload_target_srl] = $oComponent; + } - return $oComponent; + return $this->loaded_component_list[$component][$upload_target_srl]; } /**