From 49a44154ce99c1ec4588f21d16c3985fe7b12c87 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 16 May 2004 22:54:49 +0000 Subject: [PATCH] tooltip allows now to read it's content from the widget it's set as tooltip --- phpgwapi/inc/class.html.inc.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php index 226d711ad8..5ca09fbb9d 100644 --- a/phpgwapi/inc/class.html.inc.php +++ b/phpgwapi/inc/class.html.inc.php @@ -45,7 +45,8 @@ class html * * 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 $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) @@ -72,7 +73,9 @@ class html $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) @@ -368,13 +371,13 @@ htmlareaConfig.editorURL = '."'$this->phpgwapi_js_url/htmlarea/';"; //echo "

html::link(url='$url',vars='"; print_r($vars); echo "')

\n"; if (!is_array($vars)) { - parse_str($vars,$vars); + parse_str($vars,$vars); } list($url,$v) = explode('?',$url); // url may contain additional vars if ($v) { - parse_str($v,$v); - $vars += $v; + parse_str($v,$v); + $vars += $v; } return $GLOBALS['phpgw']->link($url,$vars); }