diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 84094255f..f3074dc8d 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -675,7 +675,7 @@ **/ function transContent($content) { // 에디터 컴포넌트를 찾아서 결과 코드로 변환 - $content = preg_replace_callback('!<(div|img)([^\>]*?)>(<\/div>)?!is', array($this,'_transMultimedia'), $content); + $content = preg_replace_callback('!<(div|img)([^\>]*)editor_component=([^\>]*?)>!is', array($this,'_transEditorComponent'), $content); //
코드 변환 $content = str_replace(array("
","
","
"),"
", $content); @@ -690,7 +690,7 @@ * @brief 내용의 멀티미디어 태그를 html 태그로 변경 * 로 되어 있는 코드를 변경 **/ - function _transMultimedia($matches) { + function _transEditorComponent($matches) { // IE에서는 태그의 특성중에서 " 를 빼어 버리는 경우가 있기에 정규표현식으로 추가해줌 $buff = $matches[0]; $buff = preg_replace('/([^=^"^ ]*)=([^"])([^=^ ]*)/i', '$1="$2$3"', $buff); diff --git a/common/js/common.js b/common/js/common.js index b390faa80..d543ea885 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -111,7 +111,27 @@ function resizeImagePopup(evt) { if(popup) popup.focus(); } -// 에디터에서 사용하는 내용 여닫는 코드 (고정) +// 에디터에서 사용하는 내용 여닫는 코드 (고정, zbxe용) +function zbxe_folder_open(id) { + var open_text_obj = xGetElementById("folder_open_"+id); + var close_text_obj = xGetElementById("folder_close_"+id); + var folder_obj = xGetElementById("folder_"+id); + open_text_obj.style.display = "none"; + close_text_obj.style.display = "block"; + folder_obj.style.display = "block"; +} + +function zbxe_folder_close(id) { + var open_text_obj = xGetElementById("folder_open_"+id); + var close_text_obj = xGetElementById("folder_close_"+id); + var folder_obj = xGetElementById("folder_"+id); + open_text_obj.style.display = "block"; + close_text_obj.style.display = "none"; + folder_obj.style.display = "none"; +} + + +// 에디터에서 사용하는 내용 여닫는 코드 (고정, zb5 beta 호환용) function svc_folder_open(id) { var open_text_obj = xGetElementById("_folder_open_"+id); var close_text_obj = xGetElementById("_folder_close_"+id); diff --git a/modules/editor/components/quotation/lang/ko.lang.php b/modules/editor/components/quotation/lang/ko.lang.php index 0a7d388b5..324ca3fd4 100644 --- a/modules/editor/components/quotation/lang/ko.lang.php +++ b/modules/editor/components/quotation/lang/ko.lang.php @@ -6,7 +6,7 @@ **/ $lang->quotation = "인용구 사용하기"; - $lang->quotation_use_folder = "폴더기능 사용"; + $lang->quotation_use_folder = "접기 기능 사용"; $lang->quotation_opener = "열기 버튼 이름"; $lang->quotation_closer = "닫기 버튼 이름"; $lang->quotation_padding = "내부 여백"; @@ -14,6 +14,15 @@ $lang->quotation_border_color = "테두리 색"; $lang->quotation_border_thickness = "테두리 굵기"; + $lang->folder_text_bold = "글자 굵게"; + $lang->about_folder_text_bold = "선택하시면 링크의 글자가 굵게 표시됩니다"; + + $lang->folder_text_color = "링크 색상 "; + $lang->folder_text_color_blue = "파란색"; + $lang->folder_text_color_red = "붉은색"; + $lang->folder_text_color_yellow = "노란색"; + $lang->folder_text_color_green = "녹색"; + $lang->quotation_border_style = "테두리 종류"; $lang->quotation_border_style_list = array( "없음", diff --git a/modules/editor/components/quotation/quotation.class.php b/modules/editor/components/quotation/quotation.class.php index 052a2299a..f8b110b19 100644 --- a/modules/editor/components/quotation/quotation.class.php +++ b/modules/editor/components/quotation/quotation.class.php @@ -56,24 +56,66 @@ * 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; + $use_folder = $xml_obj->attrs->use_folder; + $folder_opener = $xml_obj->attrs->folder_opener; + if(!$folder_opener) $folder_opener = "more..."; + $folder_closer = $xml_obj->attrs->folder_closer; + if(!$folder_closer) $folder_closer= "close..."; + $bold = $xml_obj->attrs->bold; + $color = $xml_obj->attrs->color; + $margin = $xml_obj->attrs->margin; + $padding = $xml_obj->attrs->padding; + $border_style = $xml_obj->attrs->border_style; + $border_thickness = $xml_obj->attrs->border_thickness; + $border_color = $xml_obj->attrs->border_color; + $bg_color = $xml_obj->attrs->bg_color; - $src = str_replace(array('&','"'), array('&','&qout;'), $src); - if(!$alt) $alt = $src; + $output = ""; + $style = sprintf('margin:%spx;padding:%spx;background-color:#%s;', $margin, $padding, $bg_color); + switch($border_style) { + case "solid" : + $style .= "border:".$border_thickness."px solid #".$border_color.";"; + break; + case "dotted" : + $style .= "border:".$border_thickness."px dotted #".$border_color.";"; + break; + case "left_solid" : + $style .= "border-left:".$border_thickness."px solid #".$border_color.";"; + break; + case "left_dotted" : + $style .= "border-elft:".$border_thickness."px dotted #".$border_color.";"; + break; + } - $output = array(); - $output = array("src=\"".$src."\""); - if($alt) $output[] = "alt=\"".$alt."\""; - if($width) $output[] = "width=\"".$width."\""; - if($height) $output[] = "height=\"".$height."\""; - if($align) $output[] = "align=\"".$align."\""; - if($border) $output[] = "border=\"".$border."\""; - return ""; + if($use_folder == "Y") { + $folder_id = rand(1000000,9999999); + + if($bold == "Y") $class = "bold"; + switch($color) { + case "red" : + $class .= " editor_red_text"; + break; + case "yellow" : + $class .= " editor_yellow_text"; + break; + case "green" : + $class .= " editor_green_text"; + break; + default : + $class .= " editor_blue_text"; + break; + } + + $style .= "display:none;"; + $output .= sprintf('
%s
', $folder_id, $margin, $class, $folder_id, $folder_opener); + $output .= sprintf('', $folder_id, $margin, $class, $folder_id, $folder_closer); + + $output .= sprintf('
', $style, $folder_id); + } else { + $output .= sprintf('
', $style); + } + debugPrint($output); + return $output; } } diff --git a/modules/editor/components/quotation/tpl/popup.css b/modules/editor/components/quotation/tpl/popup.css index bdd148989..e4162b759 100644 --- a/modules/editor/components/quotation/tpl/popup.css +++ b/modules/editor/components/quotation/tpl/popup.css @@ -1,5 +1,5 @@ .editor_window { - width:550px; + width:555px; text-align:center; } @@ -29,12 +29,19 @@ .body { float:left; - width:410px; + width:400px; text-align:left; margin:5px; font-size:9pt; } +#folder_area { + clear:left; + height:115px; + border:1px dotted #DDDDDD; + margin:0px 10px 10px 10px; +} + .body label { cursor:pointer; font-size:9pt; @@ -48,7 +55,7 @@ } .editor_input_long { - width:350px; + width:380px; height:13px; font-size:9pt; border:1px solid #AAAAAA; @@ -113,6 +120,7 @@ img.bg_preview_color { .editor_color_box { clear:both; height:65px; + width:400px; border:1px solid #DDDDDD; padding:2px; margin-bottom:3px; diff --git a/modules/editor/components/quotation/tpl/popup.html b/modules/editor/components/quotation/tpl/popup.html index af9111d3e..e4a2a2353 100644 --- a/modules/editor/components/quotation/tpl/popup.html +++ b/modules/editor/components/quotation/tpl/popup.html @@ -10,13 +10,34 @@
+
{$lang->quotation_opener}
+
-
{$lang->quotation_opener}
-
+
{$lang->quotation_closer}
+
-
{$lang->quotation_closer}
-
+
{$lang->folder_text_bold}
+
+
{$lang->folder_text_color}
+
+ + + + + + + + + + + + + + + + +
{$lang->quotation_padding}
diff --git a/modules/editor/components/quotation/tpl/popup.js b/modules/editor/components/quotation/tpl/popup.js index cca9bc925..3a2629c45 100644 --- a/modules/editor/components/quotation/tpl/popup.js +++ b/modules/editor/components/quotation/tpl/popup.js @@ -15,6 +15,8 @@ function getQuotation() { var use_folder = node.getAttribute("use_folder"); var folder_opener = node.getAttribute("folder_opener"); var folder_closer = node.getAttribute("folder_closer"); + var bold = node.getAttribute("bold"); + var color = node.getAttribute("color"); var margin = node.getAttribute("margin"); var padding = node.getAttribute("padding"); var border_style = node.getAttribute("border_style"); @@ -24,6 +26,23 @@ function getQuotation() { if(use_folder=="Y") xGetElementById("quotation_use").checked = true; else xGetElementById("quotation_use").checked = false; + toggle_folder( xGetElementById("quotation_use") ); + + if(bold=="Y") xGetElementById("quotation_bold").checked = true; + switch(color) { + case "red" : + xGetElementById("quotation_color_red").checked = true; + break; + case "yellow" : + xGetElementById("quotation_color_yellow").checked = true; + break; + case "green" : + xGetElementById("quotation_color_green").checked = true; + break; + default : + xGetElementById("quotation_color_blue").checked = true; + break; + } xGetElementById("quotation_opener").value = folder_opener; xGetElementById("quotation_closer").value = folder_closer; @@ -65,6 +84,13 @@ function insertQuotation() { var folder_closer = xGetElementById("quotation_closer").value; if(!folder_opener||!folder_closer) use_folder = "N"; + var bold = "N"; + if(xGetElementById("quotation_bold").checked) bold = "Y"; + var color = "blue"; + if(xGetElementById("quotation_color_red").checked) color = "red"; + if(xGetElementById("quotation_color_yellow").checked) color = "yellow"; + if(xGetElementById("quotation_color_green").checked) color = "green"; + var margin = parseInt(xGetElementById("quotation_margin").value,10); var padding = parseInt(xGetElementById("quotation_padding").value,10); @@ -104,12 +130,29 @@ function insertQuotation() { if(!content) content = " "; - var text = "\n
"+content+"
\n"; - opener.editorFocus(opener.editorPrevSrl); - var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl) - opener.editorReplaceHTML(iframe_obj, text); - opener.editorFocus(opener.editorPrevSrl); + if(selected_node) { + selected_node.setAttribute("use_folder", use_folder); + selected_node.setAttribute("folder_opener", folder_opener); + selected_node.setAttribute("folder_closer", folder_closer); + selected_node.setAttribute("bold", bold); + selected_node.setAttribute("color", color); + selected_node.setAttribute("margin", margin); + selected_node.setAttribute("padding", padding); + selected_node.setAttribute("border_style", border_style); + selected_node.setAttribute("border_thickness", border_thickness); + selected_node.setAttribute("border_color", border_color); + selected_node.setAttribute("bg_color", bg_color); + selected_node.setAttribute("style", style); + opener.editorFocus(opener.editorPrevSrl); + } else { + var text = "\n
"+content+"
\n"; + + opener.editorFocus(opener.editorPrevSrl); + var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl) + opener.editorReplaceHTML(iframe_obj, text); + opener.editorFocus(opener.editorPrevSrl); + } window.close(); } diff --git a/modules/editor/components/url_link/lang/ko.lang.php b/modules/editor/components/url_link/lang/ko.lang.php index af94a83a6..d8ab9b5dd 100644 --- a/modules/editor/components/url_link/lang/ko.lang.php +++ b/modules/editor/components/url_link/lang/ko.lang.php @@ -9,7 +9,7 @@ $lang->urllink_title = "제목"; $lang->urllink_url = "URL"; $lang->urllink_open_window = "새창열기"; - $lang->urllink_bold = " 글자 굵게"; + $lang->urllink_bold = "글자 굵게"; $lang->urllink_color = "링크 색상 "; $lang->urllink_color_blue = "파란색";