mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 23:29:31 +01:00
load wz_tooltips only if required: $GLOBALS[egw_info][flags][include_wz_tooltip] set or html::tooltip() called before calling common::egw_header(), calling header again as end of home page to allow apps to load stuff into the header (not only wz_tooltip)
This commit is contained in:
parent
44051ca146
commit
3eb021ff20
@ -225,7 +225,8 @@ class calendar_ui
|
||||
*/
|
||||
function do_header()
|
||||
{
|
||||
$GLOBALS['egw_info']['flags']['include_xajax'] = true;
|
||||
// tell egw_framework to include wz_tooltip
|
||||
$GLOBALS['egw_info']['flags']['include_wz_tooltip'] = true;
|
||||
common::egw_header();
|
||||
|
||||
if ($_GET['msg']) echo '<p class="redItalic" align="center">'.html::htmlspecialchars($_GET['msg'])."</p>\n";
|
||||
|
@ -19,13 +19,9 @@
|
||||
*/
|
||||
$GLOBALS['egw_info'] = array(
|
||||
'flags' => array(
|
||||
'noheader' => true,//False,
|
||||
'nonavbar' => true,//False,
|
||||
'noheader' => true,
|
||||
'nonavbar' => true,
|
||||
'currentapp' => 'home',
|
||||
'enable_network_class' => False,
|
||||
'enable_contacts_class' => False,
|
||||
'enable_nextmatchs_class' => False,
|
||||
'include_xajax' => True,
|
||||
)
|
||||
);
|
||||
|
||||
@ -33,9 +29,6 @@
|
||||
auth::check_password_age('home','index');
|
||||
$GLOBALS['egw_info']['flags']['nonavbar']=false;
|
||||
|
||||
// Display the header which contains all includes etc.
|
||||
common::egw_header();
|
||||
|
||||
/*
|
||||
** Initializing the template
|
||||
*/
|
||||
@ -237,4 +230,4 @@
|
||||
}
|
||||
//_debug_array($GLOBALS['egw_info']['user']['preferences']);
|
||||
|
||||
common::egw_footer();
|
||||
$GLOBALS['egw']->framework->render(ob_get_clean());
|
||||
|
@ -322,8 +322,8 @@ abstract class egw_framework
|
||||
$var['favicon_file'] = common::image('phpgwapi',$GLOBALS['egw_info']['server']['favicon_file']?$GLOBALS['egw_info']['server']['favicon_file']:'favicon.ico');
|
||||
}
|
||||
|
||||
$wz_tooltip = '/phpgwapi/js/wz_tooltip/wz_tooltip.js';
|
||||
if (file_exists(EGW_SERVER_ROOT.$wz_tooltip))
|
||||
if ($GLOBALS['egw_info']['flags']['include_wz_tooltip'] &&
|
||||
file_exists(EGW_SERVER_ROOT.($wz_tooltip = '/phpgwapi/js/wz_tooltip/wz_tooltip.js')))
|
||||
{
|
||||
$include_wz_tooltip = '<script src="'.$GLOBALS['egw_info']['server']['webserver_url'].
|
||||
$wz_tooltip.'?'.filemtime(EGW_SERVER_ROOT.$wz_tooltip).'" type="text/javascript"></script>';
|
||||
|
@ -50,11 +50,6 @@ class html
|
||||
* @var string
|
||||
*/
|
||||
static $api_js_url;
|
||||
/**
|
||||
* do we need to set the wz_tooltip class, to be included at the end of the page
|
||||
* @var boolean
|
||||
*/
|
||||
static private $wz_tooltip_included = False;
|
||||
|
||||
/**
|
||||
* initialise our static vars
|
||||
@ -110,8 +105,6 @@ class html
|
||||
/**
|
||||
* Handles tooltips via the wz_tooltip class from Walter Zorn
|
||||
*
|
||||
* Note: The wz_tooltip.js file gets automaticaly loaded at the end of the page
|
||||
*
|
||||
* @param string $text text or html for the tooltip, all chars allowed, they will be quoted approperiate
|
||||
* @param boolean $do_lang (default False) should the text be run though lang()
|
||||
* @param array $options param/value pairs, eg. 'TITLE' => 'I am the title'. Some common parameters:
|
||||
@ -121,6 +114,9 @@ class html
|
||||
*/
|
||||
static function tooltip($text,$do_lang=False,$options=False)
|
||||
{
|
||||
// tell egw_framework to include wz_tooltip.js
|
||||
$GLOBALS['egw_info']['flags']['include_wz_tooltip'] = true;
|
||||
|
||||
if ($do_lang) $text = lang($text);
|
||||
|
||||
$ttip = ' onmouseover="Tip(\''.str_replace(array("\n","\r","'",'"'),array('','',"\\'",'"'),$text).'\'';
|
||||
@ -564,7 +560,7 @@ class html
|
||||
// this one is for testing how it will turn out, if you do not have the device or agent ready at your fingertips
|
||||
// if (stripos($_SERVER[HTTP_USER_AGENT],'mozilla') !== false) return false;
|
||||
|
||||
// CKeditor3 will doublecheck availability for us, but its fallback does not look nice, and you will get
|
||||
// CKeditor3 will doublecheck availability for us, but its fallback does not look nice, and you will get
|
||||
// no conversion of html content to plain text, so we provide a check for known USER_AGENTS to fail the test
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user