- added function to create tooltips with the wz_tooltip class

- reformatted the file, it was totaly messed up
This commit is contained in:
Ralf Becker 2004-05-07 21:21:20 +00:00
parent 218a56178e
commit 5a008e6768

View File

@ -17,6 +17,7 @@
var $user_agent,$ua_version; // 'mozilla','msie','konqueror'
var $prefered_img_title;
var $charset,$phpgwapi_js_url;
var $need_footer = False; // do we need to be called at the end of the page
function html()
{
@ -39,6 +40,21 @@
$this->phpgwapi_js_url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/phpgwapi/js';
}
function tooltip($text,$do_lang=False)
{
if (!$this->wz_tooltip_included)
{
if (!strstr('wz_tooltip',$GLOBALS['phpgw_info']['flags']['need_footer']))
{
$GLOBALS['phpgw_info']['flags']['need_footer'] .= '<script language="JavaScript" type="text/javascript" src="'.$this->phpgwapi_js_url.'/wz_tooltip/wz_tooltip.js"></script>'."\n";
}
$this->wz_tooltip_included = True;
}
if ($do_lang) $text = lang($text);
return ' onmouseover="return escape(\''.addslashes(@htmlentities($text,ENT_COMPAT,$this->charset)).'\')"';
}
function activate_links($content)
{
// Exclude everything which is already a link
@ -198,7 +214,8 @@
else
{
$GLOBALS['phpgw_info']['flags']['java_script'] .=
'<script type="text/javascript" src="'.ereg_replace('[?&]*click_history=[0-9a-f]*','',$GLOBALS['phpgw']->link('/phpgwapi/inc/htmlarea-lang.php',array('lang'=>$lang))).'"></script>'."\n";
'<script type="text/javascript" src="'.ereg_replace('[?&]*click_history=[0-9a-f]*','',
$GLOBALS['phpgw']->link('/phpgwapi/inc/htmlarea-lang.php',array('lang'=>$lang))).'"></script>'."\n";
}
$GLOBALS['phpgw_info']['flags']['java_script_thirst'] .=
@ -419,8 +436,7 @@
function sbox_submit( $sbox,$no_script=0 )
{
$html = str_replace('<select','<select onchange="this.form.submit()" ',
$sbox);
$html = str_replace('<select','<select onchange="this.form.submit()" ',$sbox);
if ($no_script)
{
$html .= '<noscript>'.$this->submit_button('send','>').'</noscript>';
@ -540,8 +556,7 @@
*/
function theme2css()
{
return
".th { background: ".$GLOBALS['phpgw_info']['theme']['th_bg']."; }\n".
return ".th { background: ".$GLOBALS['phpgw_info']['theme']['th_bg']."; }\n".
".row_on,.th_bright { background: ".$GLOBALS['phpgw_info']['theme']['row_on']."; }\n".
".row_off { background: ".$GLOBALS['phpgw_info']['theme']['row_off']."; }\n";
}