diff --git a/classes/editor/EditorHandler.class.php b/classes/editor/EditorHandler.class.php new file mode 100644 index 000000000..ad7ca966a --- /dev/null +++ b/classes/editor/EditorHandler.class.php @@ -0,0 +1,12 @@ + diff --git a/classes/plugin/PluginHandler.class.php b/classes/plugin/PluginHandler.class.php index 5c406f9bc..3c74dced6 100644 --- a/classes/plugin/PluginHandler.class.php +++ b/classes/plugin/PluginHandler.class.php @@ -3,7 +3,6 @@ * @class PluginHandler * @author zero (zero@nzeo.com) * @brief addon을 호출하여 실행 - * @todo 미구현 **/ class PluginHandler { diff --git a/common/js/xml_handler.js b/common/js/xml_handler.js index 60a3c1d99..01d4f56e2 100644 --- a/common/js/xml_handler.js +++ b/common/js/xml_handler.js @@ -20,6 +20,8 @@ function exec_xml(module, act, params, callback_func, response_tags, callback_fu var waiting_obj = document.getElementById("waitingforserverresponse"); waiting_obj.style.visibility = "visible"; + xTop(waiting_obj, xScrollTop()+20); + xLeft(waiting_obj, xScrollLeft()+20); oXml.request(xml_response_filter, oXml, callback_func, response_tags, callback_func_arg, fo_obj); } diff --git a/config/config.inc.php b/config/config.inc.php index 13efb1db0..d8b39b636 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -49,6 +49,7 @@ require_once("./classes/file/FileHandler.class.php"); require_once("./classes/object/Object.class.php"); require_once("./classes/plugin/PluginHandler.class.php"); + require_once("./classes/editor/EditorHandler.class.php"); require_once("./classes/module/ModuleObject.class.php"); require_once("./classes/module/ModuleHandler.class.php"); require_once("./classes/display/DisplayHandler.class.php"); diff --git a/modules/editor/components/urllink/urllink.class.php b/modules/editor/components/urllink/urllink.class.php new file mode 100644 index 000000000..db90ad626 --- /dev/null +++ b/modules/editor/components/urllink/urllink.class.php @@ -0,0 +1,43 @@ +upload_target_srl = $upload_target_srl; + } + + /** + * @brief 에디터에서 처음 요청을 받을 경우 실행이 되는 부분이다. + * execute의 경우 2가지 경우가 생긴다. + * 직접 에디터 아래의 component area로 삽입할 html 코드를 만드는 것과 popup 윈도우를 띄우는 것인데 + * popup윈도우를 띄울 경우는 getPopupContent() 이라는 method가 실행이 되니 구현하여 놓아야 한다 + **/ + function execute() { + + $url = sprintf('./?module=editor&act=dispPopup&target_srl=%s&component=urllink', $this->upload_target_srl); + + $this->add('tpl', ''); + $this->add('open_window', 'Y'); + $this->add('popup_url', $url); + } + + /** + * @brief popup window요청시 다시 call이 될 method. popup window에 출력할 내용을 추가하면 된다 + **/ + function getPopupContent() { + return "haha"; + } + + } +?> diff --git a/modules/editor/conf/module.xml b/modules/editor/conf/module.xml index 01bd075d9..3c9b73c73 100644 --- a/modules/editor/conf/module.xml +++ b/modules/editor/conf/module.xml @@ -3,5 +3,6 @@ + diff --git a/modules/editor/editor.class.php b/modules/editor/editor.class.php index 506ebdc6b..e8c7e8746 100644 --- a/modules/editor/editor.class.php +++ b/modules/editor/editor.class.php @@ -27,5 +27,21 @@ function moduleUpdate() { return new Object(); } + + /** + * @brief component의 객체 생성 + **/ + function getComponentObject($component, $upload_target_srl) { + // 해당 컴포넌트의 객체를 생성해서 실행 + $class_file = sprintf('%scomponents/%s/%s.class.php', $this->module_path, $component, $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");', $component, $upload_target_srl); + @eval($eval_str); + if(!$oComponent) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); + + return $oComponent; + } } ?> diff --git a/modules/editor/editor.view.php b/modules/editor/editor.view.php index bceac4e3e..e82260ddb 100644 --- a/modules/editor/editor.view.php +++ b/modules/editor/editor.view.php @@ -38,20 +38,49 @@ } /** - * @brief 팝업 출력 출력 + * @brief 컴포넌트 실행하여 결과 return **/ function dispComponent() { - $component = Context::get('compile'); + // 변수 정리 + $component = Context::get('component'); $upload_target_srl = Context::get('upload_target_srl'); - $open_window = 'Y'; - $popup_url = "http://www.nzeo.com"; + // component 객체를 받음 + $oComponent = &$this->getComponentObject($component, $upload_target_srl); + if(!$oComponent->toBool()) return $oComponent; + + // 컴포넌트 실행 + $oComponent->execute(); $this->add('component', $component); $this->add('upload_target_srl', $upload_target_srl); - $this->add('open_window', $open_window); - $this->add('popup_url', $popup_url); + $this->add('tpl', $oComponent->get('tpl')); + $this->add('open_window', $oComponent->get('open_window')); + $this->add('popup_url', $oComponent->get('popup_url')); } + /** + * @brief 컴포넌트의 팝업 출력을 요청을 받는 action + **/ + function dispPopup() { + // 변수 정리 + $component = Context::get('component'); + $upload_target_srl = Context::get('upload_target_srl'); + + // component 객체를 받음 + $oComponent = &$this->getComponentObject($component, $upload_target_srl); + if(!$oComponent->toBool()) return $oComponent; + + // 컴포넌트의 popup url을 출력하는 method실행후 결과를 받음 + $popup_content = $oComponent->getPopupContent(); + Context::set('popup_content', $popup_content); + + // 레이아웃을 popup_layout으로 설정 + $this->setLayoutFile('popup_layout'); + + // 템플릿 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('popup'); + } } ?> diff --git a/modules/editor/lang/ko.lang.php b/modules/editor/lang/ko.lang.php new file mode 100644 index 000000000..19143bcd7 --- /dev/null +++ b/modules/editor/lang/ko.lang.php @@ -0,0 +1,9 @@ + + * @brief 위지윅에디터(editor) 모듈의 기본 언어팩 + **/ + + $lang->msg_component_is_not_founded = '%s 에디터 컴포넌트를 찾을 수 없습니다'; +?> diff --git a/modules/editor/tpl/editor.html b/modules/editor/tpl/editor.html index e673d5d0e..be595470e 100644 --- a/modules/editor/tpl/editor.html +++ b/modules/editor/tpl/editor.html @@ -76,14 +76,17 @@
+ +


-
+ +
diff --git a/modules/editor/tpl/popup.html b/modules/editor/tpl/popup.html new file mode 100644 index 000000000..0354d1709 --- /dev/null +++ b/modules/editor/tpl/popup.html @@ -0,0 +1 @@ +{$popup_content}