diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 0b45de0569c..9bb44f40588 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -31,7 +31,7 @@
* \file htdocs/core/class/html.form.class.php
* \ingroup core
* \brief File of class with all html predefined components
- * \version $Id: html.form.class.php,v 1.190 2011/07/17 19:01:26 eldy Exp $
+ * \version $Id: html.form.class.php,v 1.191 2011/07/21 22:55:06 eldy Exp $
*/
@@ -137,17 +137,18 @@ class Form
/**
* Show a text and picto with tooltip on text or picto
* @param text Text to show
- * @param htmltext Content html of tooltip, coded into HTML/UTF8
+ * @param htmltext Content html of tooltip. Must be HTML/UTF8 encoded.
* @param tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2
* @param direction -1=Le picto est avant, 0=pas de picto, 1=le picto est apres
* @param img Code img du picto (use img_xxx() function to get it)
* @param extracss Add a CSS style to td tags
* @param notabs Do not include table and tr tags
* @param incbefore Include code before the text
+ * @param noencodehtmltext Do not encode into html entity the htmltext
* @return string Code html du tooltip (texte+picto)
* @see Use function textwithpicto if you can.
*/
- function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$extracss='',$notabs=0,$incbefore='')
+ function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$extracss='',$notabs=0,$incbefore='',$noencodehtmltext=0)
{
global $conf;
@@ -160,7 +161,7 @@ class Form
$htmltext=str_replace("\n","",$htmltext);
$htmltext=str_replace('"',""",$htmltext);
- $paramfortooltipimg=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.dol_escape_htmltag($htmltext,1).'"'; // Attribut to put on td img tag to store tooltip
+ $paramfortooltipimg=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td img tag to store tooltip
$paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
$s="";
@@ -197,9 +198,10 @@ class Form
* @param direction 1=Icon is after text, -1=Icon is before text
* @param type Type of picto (info, help, warning, superadmin...)
* @param extracss Add a CSS style to td tags
+ * @param noencodehtmltext Do not encode into html entity the htmltext
* @return string HTML code of text, picto, tooltip
*/
- function textwithpicto($text,$htmltext,$direction=1,$type='help',$extracss='')
+ function textwithpicto($text,$htmltext,$direction=1,$type='help',$extracss='',$noencodehtmltext=0)
{
global $conf;
@@ -225,7 +227,7 @@ class Form
// Warnings
if ($type == 'warning') $img=img_warning($alt);
- return $this->textwithtooltip($text,$htmltext,2,$direction,$img,$extracss);
+ return $this->textwithtooltip($text,$htmltext,2,$direction,$img,$extracss,0,'',$noencodehtmltext);
}
/**