From 98956afd5c17af993d3142d837f0042c3044ef7e Mon Sep 17 00:00:00 2001 From: Regis Houssin <regis@dolibarr.fr> Date: Thu, 6 Jan 2011 15:05:23 +0000 Subject: [PATCH] New: possibility to add specific css class --- htdocs/core/class/html.form.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 62f6d31acd7..27422180287 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -140,7 +140,7 @@ class Form * @return string Code html du tooltip (texte+picto) * @see Use function textwithpicto if you can. */ - function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='') + function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$extracss='') { global $conf; @@ -157,7 +157,8 @@ class Form $htmltext=str_replace("\n","",$htmltext); $htmltext=str_replace('"',""",$htmltext); - $paramfortooltip.=' class="classfortooltip" title="'.$htmltext.'"'; // Attribut to put on td tag to store tooltip + $extracss = (!empty($extracss) ? ' '.$extracss : ''); + $paramfortooltip.=' class="classfortooltip'.$extracss.'" title="'.$htmltext.'"'; // Attribut to put on td tag to store tooltip $s=""; $s.='<table class="nobordernopadding" summary=""><tr>'; @@ -194,7 +195,7 @@ class Form * @param type Type of picto (info, help, warning, superadmin...) * @return string HTML code of text, picto, tooltip */ - function textwithpicto($text,$htmltext,$direction=1,$type='help') + function textwithpicto($text,$htmltext,$direction=1,$type='help',$extracss='') { global $conf; @@ -219,7 +220,7 @@ class Form // Warnings if ($type == 'warning') $img=img_warning($alt); - return $this->textwithtooltip($text,$htmltext,2,$direction,$img); + return $this->textwithtooltip($text,$htmltext,2,$direction,$img,$extracss); } /** -- GitLab