diff --git a/modules/editor/components/slide_show/icon.gif b/modules/editor/components/slide_show/icon.gif new file mode 100644 index 000000000..6151e2792 Binary files /dev/null and b/modules/editor/components/slide_show/icon.gif differ diff --git a/modules/editor/components/slide_show/image_link.class.php b/modules/editor/components/slide_show/image_link.class.php new file mode 100644 index 000000000..211444b22 --- /dev/null +++ b/modules/editor/components/slide_show/image_link.class.php @@ -0,0 +1,66 @@ +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; + $alt = $xml_obj->attrs->alt; + $width = $xml_obj->attrs->width; + $height = $xml_obj->attrs->height; + $align = $xml_obj->attrs->align; + $border = $xml_obj->attrs->border; + + $src = str_replace(array('&','"'), array('&','&qout;'), $src); + if(!$alt) $alt = $src; + + $output = array(); + $output = array("src=\"".$src."\""); + if($alt) $output[] = "alt=\"".$alt."\""; + if($alt) $output[] = "title=\"".$alt."\""; + if($width) $output[] = "width=\"".$width."\""; + if($height) $output[] = "height=\"".$height."\""; + if($align) $output[] = "align=\"".$align."\""; + if($border) $output[] = "border=\"".$border."\""; + return ""; + } + + } +?> diff --git a/modules/editor/components/slide_show/lang/ko.lang.php b/modules/editor/components/slide_show/lang/ko.lang.php new file mode 100644 index 000000000..107223fa4 --- /dev/null +++ b/modules/editor/components/slide_show/lang/ko.lang.php @@ -0,0 +1,20 @@ + + * @brief 위지윅에디터(editor) 모듈 > 이미지링크(image_link) 컴포넌트의 언어팩 + **/ + + $lang->imagelink = "이미지 자료 연결"; + $lang->image_url = "이미지 경로"; + $lang->image_alt = "설명 입력"; + $lang->image_scale = "이미지크기"; + $lang->image_align = "정렬 방법 "; + $lang->image_align_normal = "한 문단을 차지"; + $lang->image_align_left = "글의 왼쪽으로"; + $lang->image_align_middle = "가운데"; + $lang->image_align_right = "글의 우측으로"; + $lang->image_border = "경계선 두께"; + + $lang->cmd_get_scale = "크기 구하기"; +?> diff --git a/modules/editor/components/slide_show/tpl/images/align_left.gif b/modules/editor/components/slide_show/tpl/images/align_left.gif new file mode 100644 index 000000000..f16697d91 Binary files /dev/null and b/modules/editor/components/slide_show/tpl/images/align_left.gif differ diff --git a/modules/editor/components/slide_show/tpl/images/align_middle.gif b/modules/editor/components/slide_show/tpl/images/align_middle.gif new file mode 100644 index 000000000..5e9a00d35 Binary files /dev/null and b/modules/editor/components/slide_show/tpl/images/align_middle.gif differ diff --git a/modules/editor/components/slide_show/tpl/images/align_normal.gif b/modules/editor/components/slide_show/tpl/images/align_normal.gif new file mode 100644 index 000000000..f16697d91 Binary files /dev/null and b/modules/editor/components/slide_show/tpl/images/align_normal.gif differ diff --git a/modules/editor/components/slide_show/tpl/images/align_right.gif b/modules/editor/components/slide_show/tpl/images/align_right.gif new file mode 100644 index 000000000..0ac97aa0b Binary files /dev/null and b/modules/editor/components/slide_show/tpl/images/align_right.gif differ diff --git a/modules/editor/components/slide_show/tpl/popup.css b/modules/editor/components/slide_show/tpl/popup.css new file mode 100644 index 000000000..c2fc5eeb7 --- /dev/null +++ b/modules/editor/components/slide_show/tpl/popup.css @@ -0,0 +1,77 @@ +.editor_window { + width:500px; + text-align:center; +} + +.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; +} + +.body { + float:left; + width:350px; + text-align:left; + margin:5px; + font-size:9pt; + font-size:9pt; +} + +.body label { + cursor:pointer; + font-size:9pt; +} + +.image_align { + margin:0px 0px 5px 0px; + float:left; + width:150px; +} + +.image_url { + width:350px; + height:13px; + font-size:9pt; + border:1px solid #AAAAAA; +} + +.editor_input { + width:40px; + height:13px; + font-size:9pt; + border:1px solid #AAAAAA; +} + +.editor_button_area { + border-top:1px solid #AAAAAA; + text-align:center; + background-color:#EEEEEE; + padding:2px 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/slide_show/tpl/popup.html b/modules/editor/components/slide_show/tpl/popup.html new file mode 100644 index 000000000..07e9c9b3a --- /dev/null +++ b/modules/editor/components/slide_show/tpl/popup.html @@ -0,0 +1,64 @@ + + + + +
+
+ +
{$lang->imagelink}
+ +
{$lang->image_url}
+
+ +
{$lang->image_scale}
+
+ px + px + +
+ + +
{$lang->image_alt}
+
+ +
{$lang->image_align}
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
{$lang->image_border}
+
px
+ +
+ + +
+
+
diff --git a/modules/editor/components/slide_show/tpl/popup.js b/modules/editor/components/slide_show/tpl/popup.js new file mode 100644 index 000000000..2dd39dcf0 --- /dev/null +++ b/modules/editor/components/slide_show/tpl/popup.js @@ -0,0 +1,92 @@ +/** + * popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 이미지가 있는지 체크하여 + * 있으면 가져와서 원하는 곳에 삽입 + **/ +function getImage() { + // 부모 위지윅 에디터에서 선택된 영역이 있는지 확인 + if(typeof(opener)=="undefined") return; + + // url이 미리 입력되어 있을 경우 scale구해줌 + if(xGetElementById("image_url").value) { + setTimeout(function() { getImageScale(); }, 500); + return; + } + + // 부모 위지윅 에디터에서 선택된 영역이 있으면 처리 + var node = opener.editorPrevNode; + if(!node || node.nodeName != "IMG") { + return; + } + var src = node.getAttribute("src"); + var border = node.getAttribute("border"); + var align = node.getAttribute("align"); + var alt = node.getAttribute("alt"); + var width = node.getAttribute("width"); + var height = node.getAttribute("height"); + + xGetElementById("image_url").value = src; + xGetElementById("image_alt").value = alt; + + switch(align) { + case 'left' : xGetElementById("align_left").checked = true; break; + case 'middle' : xGetElementById("align_middle").checked = true; break; + case 'right' : xGetElementById("align_right").checked = true; break; + default : xGetElementById("align_normal").checked = true; break; + } + + xGetElementById("image_border").value = border; + + xGetElementById("width").value = width; + xGetElementById("height").value = height; + +} + +function getImageScale() { + var url = xGetElementById("image_url").value; + if(!url) return; + + var img = new Image(); + img.src = url; + + xGetElementById("width").value = img.width; + xGetElementById("height").value = img.height; + +} +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"; + var border = parseInt(xGetElementById("image_border").value,10); + + var width = xGetElementById("width").value; + var height = xGetElementById("height").value; + + if(!url) { + window.close(); + return; + } + + var text = "