From 995c29ecd238aa1661a94b3644dfb6f4fc2fc9f5 Mon Sep 17 00:00:00 2001 From: misol Date: Mon, 19 Jan 2009 06:35:10 +0000 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=A7=81?= =?UTF-8?q?=ED=81=AC=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20-=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95=ED=95=9C=20=EA=B2=83=20?= =?UTF-8?q?(sandbox=20=EB=A6=AC=EB=B9=84=EC=A0=84=20r5381=20=EC=9D=B4?= =?UTF-8?q?=ED=9B=84=EC=97=90=20=EC=88=98=EC=A0=95=EB=90=9C=20=EA=B2=83?= =?UTF-8?q?=EC=9D=B8=EB=8D=B0,=20r5381=20=EC=9D=B4=EC=A0=84=EC=97=90=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=ED=95=9C=20=EA=B2=83=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=83=9D=EA=B8=B4=20=EB=AC=B8=EC=A0=9C=EC=A0=90=20=EC=88=98?= =?UTF-8?q?=EC=A0=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5402 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- .../components/image_link/image_link.class.php | 13 ++++++++++--- modules/editor/components/image_link/tpl/popup.js | 6 ++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/modules/editor/components/image_link/image_link.class.php b/modules/editor/components/image_link/image_link.class.php index dc5a1d82c..8f91428b8 100644 --- a/modules/editor/components/image_link/image_link.class.php +++ b/modules/editor/components/image_link/image_link.class.php @@ -66,8 +66,10 @@ $attr_output[] = "title=\"".$alt."\""; } if($margin) { - $style = preg_replace('/margin[: 0-9a-z]+\;/i','', $style); - $style .= 'margin:'.$margin.'px;'; + $style = trim(preg_replace('/margin[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';'; + $style = str_replace(';;',';',$style); + if($style == ';') $style = ''; + $style .= ' margin:'.$margin.'px;'; } if($align) $attr_output[] = "align=\"".$align."\""; @@ -75,7 +77,12 @@ if($width) $attr_output[] = 'width="'.$width.'"'; if($height) $attr_output[] = 'height="'.$height.'"'; - if($border) $attr_output[] = 'border="'.$border.'"'; + if($border) { + $style = trim(preg_replace('/border[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';'; + $style = str_replace(';;',';',$style); + if($style == ';') $style = ''; + $style .= ' border-style: solid; border-width:'.$border.'px;'; + } $code = sprintf("", implode(' ',$attr_output), $style); diff --git a/modules/editor/components/image_link/tpl/popup.js b/modules/editor/components/image_link/tpl/popup.js index 6c97366d5..357e82452 100644 --- a/modules/editor/components/image_link/tpl/popup.js +++ b/modules/editor/components/image_link/tpl/popup.js @@ -57,7 +57,9 @@ function getImage() { xGetElementById('image_margin').value = margin; } - xGetElementById("image_border").value = border; + if(border) { + xGetElementById("image_border").value = border; + } xGetElementById("width").value = width; xGetElementById("height").value = height; @@ -110,7 +112,7 @@ function insertImage(obj) { if(height) text+= " height=\""+height+"\""; if(link_url) text+= " link_url=\""+link_url+"\""; if(open_window=='Y') text+= " open_window=\"Y\""; - if(align || border){ + if(align || border || margin){ text+= " style=\""; if(align) text+= align+"; "; if(border) text+= "border: solid "+border+"px; ";