diff --git a/modules/editor/components/naver_map/lang/ko.lang.php b/modules/editor/components/naver_map/lang/ko.lang.php new file mode 100644 index 000000000..7d6981a4b --- /dev/null +++ b/modules/editor/components/naver_map/lang/ko.lang.php @@ -0,0 +1,13 @@ + + * @brief 위지윅에디터(editor) 모듈 > 멀티미디어 링크 (naver_map) 컴포넌트의 언어팩 + **/ + + $lang->navermap = "네이비 지도"; + $lang->navermap_address = "주소"; + $lang->navermap_width = "가로크기"; + $lang->navermap_height = "세로크기"; + $lang->navermap_auto_start = "자동시작"; +?> diff --git a/modules/editor/components/naver_map/naver_map.class.php b/modules/editor/components/naver_map/naver_map.class.php new file mode 100644 index 000000000..51e1be1f9 --- /dev/null +++ b/modules/editor/components/naver_map/naver_map.class.php @@ -0,0 +1,65 @@ +upload_target_srl = $upload_target_srl; + $this->component_path = $component_path; + } + + /** + * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 + **/ + function getPopupContent() { + // 템플릿을 미리 컴파일해서 컴파일된 소스를 return + $tpl_path = $this->component_path.'tpl'; + $tpl_file = 'popup.html'; + + Context::set("tpl_path", $tpl_path); + + require_once("./classes/template/TemplateHandler.class.php"); + $oTemplate = new TemplateHandler(); + return $oTemplate->compile($tpl_path, $tpl_file); + } + + /** + * @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 그 코드를 html로 변경하여 주는 method + * + * 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서 + * DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경 + **/ + function transHTML($xml_obj) { + /* + $src = $xml_obj->attrs->src; + + $width = $xml_obj->attrs->width; + if(!$width) $width = 640; + + $height = $xml_obj->attrs->height; + if(!$height) $height = 480; + + $auto_start = $xml_obj->attrs->auto_start; + if($auto_start!="true") $auto_start = "false"; + else $auto_start = "true"; + + $caption = $xml_obj->body; + + $src = str_replace(array('&','"'), array('&','&qout;'), $src); + + return sprintf("
", $src, $width, $height, $auto_start); + */ + } + } +?> diff --git a/modules/editor/components/naver_map/tpl/popup.css b/modules/editor/components/naver_map/tpl/popup.css new file mode 100644 index 000000000..d83305350 --- /dev/null +++ b/modules/editor/components/naver_map/tpl/popup.css @@ -0,0 +1,65 @@ +.editor_window { + width:400px; + clear:both; +} + +.editor_title { + font-size:10pt; + font-weight:bold; + clear:both; + height:20px; + background-color:#555555; + color:#EFEFEF; + vertical-align:middle; + padding-top:5px; + border-bottom:1px solid #000000; + text-align:center; +} + +.header { + float:left; + width:100px; + clear:left; + text-align:left; + font-weight:bold; + margin:5px; + font-size:9pt; + font-size:9pt; +} + +.body { + float:left; + width:250px; + text-align:left; + margin:5px; + font-size:9pt; +} + +.body label { + cursor:pointer; + font-size:9pt; +} + +.navermap_address { + width:80px; + border:1px solid #AAAAAA; + height:12px; + font-size:9pt; +} + + +.editor_button_area { + border-top:1px solid #AAAAAA; + text-align:center; + background-color:#EEEEEE; + padding:0px 0px 2px 0px; + clear:both; +} + +.editor_button { + margin-top:4px; + background-color:#FFFFFF; + border:1px solid #AAAAAA; + height:16px; + font-size:9pt; +} diff --git a/modules/editor/components/naver_map/tpl/popup.html b/modules/editor/components/naver_map/tpl/popup.html new file mode 100644 index 000000000..b07cbc244 --- /dev/null +++ b/modules/editor/components/naver_map/tpl/popup.html @@ -0,0 +1,23 @@ + + + + +
+
+
{$lang->navermap}
+ +
{$lang->navermap_address}
+
+ +
{$lang->navermap_width}
+
px
+ +
{$lang->navermap_height}
+
px
+ +
+ + +
+
+
diff --git a/modules/editor/components/naver_map/tpl/popup.js b/modules/editor/components/naver_map/tpl/popup.js new file mode 100644 index 000000000..c1c186688 --- /dev/null +++ b/modules/editor/components/naver_map/tpl/popup.js @@ -0,0 +1,80 @@ +/** + * popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 멀티미디어 컴포넌트 코드를 체크하여 + * 있으면 가져와서 원하는 곳에 삽입 + **/ +function getNaverMap() { + return; + // 부모 위지윅 에디터에서 선택된 영역이 있는지 확인 + if(typeof(opener)=="undefined") return; + + var node = opener.editorPrevNode; + if(!node || node.nodeName != "DIV") return; + + var url = node.getAttribute("src"); + var caption = xInnerHtml(node); + var width = node.getAttribute("width"); + if(width!=xWidth(node)) width = xWidth(node); + var height = node.getAttribute("height"); + if(height!=xHeight(node)) height = xHeight(node); + var auto_start = node.getAttribute("auto_start"); + + xGetElementById("multimedia_url").value = url; + xGetElementById("multimedia_caption").value = caption; + xGetElementById("multimedia_width").value = width; + xGetElementById("multimedia_height").value = height; + if(auto_start=="true") xGetElementById("multimedia_auto_start").checked = true; + +} + +function insertNaverMap(obj) { + if(typeof(opener)=="undefined") return; + + return; + var url = xGetElementById("multimedia_url").value; + + var caption = xGetElementById("multimedia_caption").value; + + var width = xGetElementById("multimedia_width").value; + if(!width) width = 640; + + var height = xGetElementById("multimedia_height").value; + if(!height) height= 480; + + var auto_start = "false"; + if(xGetElementById("multimedia_auto_start").checked) auto_start = "true"; + + if(!url) { + window.close(); + return; + } + + var text = "
"+caption+"
"; + + opener.editorFocus(opener.editorPrevSrl); + + var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl) + + opener.editorReplaceHTML(iframe_obj, text); + opener.editorFocus(opener.editorPrevSrl); + + window.close(); +} + +xAddEventListener(window, "load", getNaverMap); + +/* 네이버의 map openapi로 주소에 따른 좌표를 요청 */ +function search_address() { + var address = xGetElementById("adress"); + if(!address) return; + + var params = new Array(); + params['address'] = address; + + var response_tags = new Array('error','message','address_list'); + exec_xml('editor', 'procCall', params, complete_search_address); +} + +function complete_search_address(ret_obj) { + var address_list = ret_obj['address_list']; + alert(address_list); +} diff --git a/modules/editor/conf/module.xml b/modules/editor/conf/module.xml index a8d3669bc..d83dd792b 100644 --- a/modules/editor/conf/module.xml +++ b/modules/editor/conf/module.xml @@ -3,5 +3,6 @@ + diff --git a/modules/editor/editor.controller.ph b/modules/editor/editor.controller.ph new file mode 100644 index 000000000..a2a493ae0 --- /dev/null +++ b/modules/editor/editor.controller.ph @@ -0,0 +1,48 @@ +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)); + + return $oComponent; + } + } +?> diff --git a/modules/editor/editor.controller.php b/modules/editor/editor.controller.php new file mode 100644 index 000000000..a2a493ae0 --- /dev/null +++ b/modules/editor/editor.controller.php @@ -0,0 +1,48 @@ +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)); + + return $oComponent; + } + } +?>