handing argument types for wz_tooltips and only using UnTip(), if tooltip is NOT sticky

This commit is contained in:
Ralf Becker 2010-01-24 03:15:12 +00:00
parent 27c2de1986
commit 49b237ec72

View File

@ -113,14 +113,29 @@ 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;
}