이미지 링크 컴포넌트 - 오류 수정한 것 (sandbox 리비전 r5381 이후에 수정된 것인데, r5381 이전에 수정한 것으로 생긴 문제점 수정)

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5402 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
misol 2009-01-19 06:35:10 +00:00
parent f5f3136470
commit 995c29ecd2
2 changed files with 14 additions and 5 deletions

View file

@ -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("<img %s style=\"%s\" />", implode(' ',$attr_output), $style);

View file

@ -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; ";