From 49b237ec72c4a881a17c0400df1ea6ee33246b81 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 24 Jan 2010 03:15:12 +0000 Subject: [PATCH] handing argument types for wz_tooltips and only using UnTip(), if tooltip is NOT sticky --- phpgwapi/inc/class.html.inc.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php index 3e4255c6f2..7fdd73aa0c 100644 --- a/phpgwapi/inc/class.html.inc.php +++ b/phpgwapi/inc/class.html.inc.php @@ -113,15 +113,30 @@ class html $ttip = ' onmouseover="Tip(\''.str_replace(array("\n","\r","'",'"'),array('','',"\\'",'"'),$text).'\''; + $sticky = false; if (is_array($options)) { foreach($options as $option => $value) { - $ttip .= ','.strtoupper($option).','.$value; + $option = strtoupper($option); + if ($option == 'STICKY') $sticky = (bool)$value; + + switch(gettype($value)) + { + case 'boolean': + $value = $value ? 'true' : 'false'; + break; + case 'string': + $value = "'$value'"; + break; + } + $ttip .= ','.$option.','.$value; } } - $ttip .= ')" onmouseout="UnTip()"'; - + $ttip .= ')"'; + + if (!$sticky) $ttip .= ' onmouseout="UnTip()"'; + return $ttip; }