From e9bf219b7cc550f5efc63defae912991fcb34a67 Mon Sep 17 00:00:00 2001 From: zero Date: Mon, 19 Mar 2007 03:42:44 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@529 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- .../multimedia_link/lang/ko.lang.php | 15 +++++ .../multimedia_link/multimedia_link.class.php | 57 +++++++++++++++++++ .../components/multimedia_link/tpl/popup.css | 46 +++++++++++++++ .../components/multimedia_link/tpl/popup.html | 47 +++++++++++++++ .../components/multimedia_link/tpl/popup.js | 30 ++++++++++ 5 files changed, 195 insertions(+) create mode 100644 modules/editor/components/multimedia_link/lang/ko.lang.php create mode 100644 modules/editor/components/multimedia_link/multimedia_link.class.php create mode 100644 modules/editor/components/multimedia_link/tpl/popup.css create mode 100644 modules/editor/components/multimedia_link/tpl/popup.html create mode 100644 modules/editor/components/multimedia_link/tpl/popup.js diff --git a/modules/editor/components/multimedia_link/lang/ko.lang.php b/modules/editor/components/multimedia_link/lang/ko.lang.php new file mode 100644 index 000000000..8a51f66eb --- /dev/null +++ b/modules/editor/components/multimedia_link/lang/ko.lang.php @@ -0,0 +1,15 @@ + + * @brief 위지윅에디터(editor) 모듈 > 이미지링크(image_link) 컴포넌트의 언어팩 + **/ + + $lang->image_url = "이미지 경로"; + $lang->image_alt = "설명"; + $lang->image_align = "정렬"; + $lang->image_align_normal = "한 문단을 차지"; + $lang->image_align_left = "글의 왼쪽으로"; + $lang->image_align_middle = "가운데"; + $lang->image_align_right = "글의 우측으로"; +?> diff --git a/modules/editor/components/multimedia_link/multimedia_link.class.php b/modules/editor/components/multimedia_link/multimedia_link.class.php new file mode 100644 index 000000000..c926f8284 --- /dev/null +++ b/modules/editor/components/multimedia_link/multimedia_link.class.php @@ -0,0 +1,57 @@ +upload_target_srl = $upload_target_srl; + $this->component_path = $component_path; + } + + /** + * @brief 에디터에서 처음 요청을 받을 경우 실행이 되는 부분이다. + * execute의 경우 2가지 경우가 생긴다. + * 직접 에디터 아래의 component area로 삽입할 html 코드를 만드는 것과 popup 윈도우를 띄우는 것인데 + * popup윈도우를 띄울 경우는 getPopupContent() 이라는 method가 실행이 되니 구현하여 놓아야 한다 + **/ + function execute() { + + $url = sprintf('./?module=editor&act=dispPopup&target_srl=%s&component=multimedia_link', $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 + $tpl_path = $this->component_path.'tpl'; + $tpl_file = 'popup.html'; + + Context::set("tpl_path", $tpl_path); + + // 이모티콘을 모두 가져옴 + $multimedia_link_list = FileHandler::readDir($tpl_path.'/images'); + Context::set('multimedia_link_list', $multimedia_link_list); + + require_once("./classes/template/TemplateHandler.class.php"); + $oTemplate = new TemplateHandler(); + return $oTemplate->compile($tpl_path, $tpl_file); + } + + } +?> diff --git a/modules/editor/components/multimedia_link/tpl/popup.css b/modules/editor/components/multimedia_link/tpl/popup.css new file mode 100644 index 000000000..e16eb20e9 --- /dev/null +++ b/modules/editor/components/multimedia_link/tpl/popup.css @@ -0,0 +1,46 @@ +.editor_window { + width:400px; + text-align:center; +} + +.header { + float:left; + width:100px; + clear:left; + text-align:left; + font-weight:bold; + margin:5px; +} + +.body { + float:left; + width:250px; + text-align:left; + margin:5px; + font-size:9pt; +} + +.body label { + cursor:pointer; +} + +.image_align { + margin:0px 0px 5px 0px; +} + +.image_url { + width:240px; + border:1px solid #AAAAAA; +} + +.editor_button_area { + clear:both; + text-align:center; + margin:5px; +} + +.editor_button { + margin-top:4px; + background-color:#FFFFFF; + border:1px solid #AAAAAA; +} diff --git a/modules/editor/components/multimedia_link/tpl/popup.html b/modules/editor/components/multimedia_link/tpl/popup.html new file mode 100644 index 000000000..d86112ef8 --- /dev/null +++ b/modules/editor/components/multimedia_link/tpl/popup.html @@ -0,0 +1,47 @@ + + + + +
+
+
{$lang->image_url}
+
+
{$lang->image_alt}
+
+
{$lang->image_align}
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+
diff --git a/modules/editor/components/multimedia_link/tpl/popup.js b/modules/editor/components/multimedia_link/tpl/popup.js new file mode 100644 index 000000000..a5131a045 --- /dev/null +++ b/modules/editor/components/multimedia_link/tpl/popup.js @@ -0,0 +1,30 @@ +function insertImage(obj) { + if(typeof(opener)=="undefined") return; + + var url = xGetElementById("image_url").value; + var alt = xGetElementById("image_alt").value; + var align = ""; + if(xGetElementById("align_normal").checked==true) align = ""; + else if(xGetElementById("align_left").checked==true) align = "left"; + else if(xGetElementById("align_middle").checked==true) align = "middle"; + else if(xGetElementById("align_right").checked==true) align = "right"; + + if(!url) { + window.close(); + return; + } + + var text = "