From af5507bcfa20aec69b453663ae96cd18f5512608 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Sep 2012 16:13:12 +0200 Subject: [PATCH] Fix: restore correct behaviour. Space is output only if there is an img + text. img alone is not enough. --- htdocs/core/class/html.form.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ed1193e696e..d2eb3c0f4af 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -357,7 +357,6 @@ class Form $tag='td'; if ($notabs == 2) $tag='div'; if ($notabs == 3) $tag='span'; - // Sanitize tooltip $htmltext=str_replace("\\","\\\\",$htmltext); $htmltext=str_replace("\r","",$htmltext); @@ -368,12 +367,11 @@ class Form else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag - $s=""; if (empty($notabs)) $s.=''; - if ($direction < 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.' '; - if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.''; - if ($direction > 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14"> '.$img.''; + if ($direction < 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; + if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').''; + if ($direction > 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; if (empty($notabs)) $s.='
'; return $s;