tooltip allows now to read it's content from the widget it's set as tooltip

This commit is contained in:
Ralf Becker 2004-05-16 22:54:49 +00:00
parent 5c36352f28
commit 49a44154ce

View File

@ -45,7 +45,8 @@ class html
* *
* Note: The wz_tooltip.js file gets automaticaly loaded at the end of the page * Note: The wz_tooltip.js file gets automaticaly loaded at the end of the page
* *
* @param $text string text or html for the tooltip, all chars allowed, they will be quoted approperiate * @param $text string/boolean text or html for the tooltip, all chars allowed, they will be quoted approperiate
* Or if False the content (innerHTML) of the element itself is used.
* @param $do_lang boolean (default False) should the text be run though lang() * @param $do_lang boolean (default False) should the text be run though lang()
* @param $options array param/value pairs, eg. 'TITLE' => 'I am the title'. Some common parameters: * @param $options array param/value pairs, eg. 'TITLE' => 'I am the title'. Some common parameters:
* title (string) gives extra title-row, width (int,'auto') , padding (int), above (bool), bgcolor (color), bgimg (URL) * title (string) gives extra title-row, width (int,'auto') , padding (int), above (bool), bgcolor (color), bgimg (URL)
@ -72,7 +73,9 @@ class html
$opt_out .= 'this.T_'.strtoupper($option).'='.(is_numeric($value)?$value:"'$value'").'; '; $opt_out .= 'this.T_'.strtoupper($option).'='.(is_numeric($value)?$value:"'$value'").'; ';
} }
} }
return ' onmouseover="'.$opt_out.'return escape(\''.addslashes(@htmlentities(str_replace("\n",' ',$text),ENT_COMPAT,$this->charset)).'\')"'; if ($text === False) return ' onmouseover="'.$opt_out.'return escape(this.innerHTML);"';
return ' onmouseover="'.$opt_out.'return escape(\''.addslashes(@htmlentities(str_replace(array("\n","\r"),' ',$text),ENT_COMPAT,$this->charset)).'\')"';
} }
function activate_links($content) function activate_links($content)