* telling IE via X-UA-Compatible IE=edge never to use compatibility modes with old versions (if set eg. via group policy for whole intranet zone)

This commit is contained in:
Ralf Becker 2010-11-10 10:49:16 +00:00
parent 87d4cbcce3
commit c1fea35c29
2 changed files with 22 additions and 19 deletions

View File

@ -270,20 +270,23 @@ abstract class egw_framework
{ {
$lang_code = $GLOBALS['egw_info']['user']['preferences']['common']['lang']; $lang_code = $GLOBALS['egw_info']['user']['preferences']['common']['lang'];
} }
//pngfix defaults to yes // IE specific fixes
if(!$GLOBALS['egw_info']['user']['preferences']['common']['disable_pngfix']) if (html::$user_agent == 'msie')
{
// tell IE to use it's own mode, not old compatibility modes (set eg. via group policy for all intranet sites)
// has to be before any other header tags, but meta and title!!!
$pngfix = '<meta http-equiv="X-UA-Compatible" content="IE=edge" />'."\n";
// pngfix for IE6 defaults to yes
if(!$GLOBALS['egw_info']['user']['preferences']['common']['disable_pngfix'] && html::$ua_version < 7)
{ {
$pngfix_src = $GLOBALS['egw_info']['server']['webserver_url'] . '/phpgwapi/templates/idots/js/pngfix.js'; $pngfix_src = $GLOBALS['egw_info']['server']['webserver_url'] . '/phpgwapi/templates/idots/js/pngfix.js';
$pngfix ='<!-- This solves the Internet Explorer PNG-transparency bug, but only for IE 5.5 - 6.0 and higher --> $pngfix .= '<!-- This solves the Internet Explorer PNG-transparency bug, but only for IE 5.5 - 6.0 and higher -->
<!--[if lt IE 7.0]> <!--[if lt IE 7.0]>
<script src="'.$pngfix_src.'" type="text/javascript"> <script src="'.$pngfix_src.'" type="text/javascript">
</script> </script>
<![endif]-->'; <![endif]-->';
} }
// tell IE > 7 to use it's own mode, not old compatibility mode eg. IE=7 for IE8
if (html::$user_agent == 'msie' && html::$ua_version > 7)
{
$pngfix .= "\n\t\t".'<meta http-equiv="X-UA-Compatible" content="IE='.(int)html::$ua_version.'" />';
} }
if(!$GLOBALS['egw_info']['user']['preferences']['common']['disable_slider_effects']) if(!$GLOBALS['egw_info']['user']['preferences']['common']['disable_slider_effects'])

View File

@ -3,12 +3,13 @@
<head> <head>
<title>{website_title}</title> <title>{website_title}</title>
<meta http-equiv="content-type" content="text/html; charset={charset}" /> <meta http-equiv="content-type" content="text/html; charset={charset}" />
<meta name="keywords" content="eGroupWare" /> <meta name="keywords" content="EGroupware" />
<meta name="description" content="eGroupWare" /> <meta name="description" content="EGroupware" />
<meta name="keywords" content="eGroupWare" /> <meta name="keywords" content="EGroupware" />
<meta name="copyright" content="eGroupWare http://www.egroupware.org (c) 2006" /> <meta name="copyright" content="EGroupware http://www.egroupware.org (c) 2010" />
<meta name="language" content="{lang_code}" /> <meta name="language" content="{lang_code}" />
<meta name="author" content="eGroupWare http://www.egroupware.org" /> <meta name="author" content="EGroupware http://www.egroupware.org" />
{pngfix}
{meta_robots} {meta_robots}
<link rel="icon" href="{img_icon}" type="image/x-ico" /> <link rel="icon" href="{img_icon}" type="image/x-ico" />
<link rel="shortcut icon" href="{img_shortcut}" /> <link rel="shortcut icon" href="{img_shortcut}" />
@ -16,7 +17,6 @@
<link href="{print_css}" type="text/css" media="print" rel="StyleSheet" /> <link href="{print_css}" type="text/css" media="print" rel="StyleSheet" />
{slider_effects} {slider_effects}
{simple_show_hide} {simple_show_hide}
{pngfix}
<style type="text/css"> <style type="text/css">
{app_css} {app_css}
</style> </style>