Merge pull request #1114 from victorsl/BUG-10199

BUG 10199 "Error en IE 8, por problema de compatibilidad" SOLVED
This commit is contained in:
julceslauhub
2012-12-18 12:29:03 -08:00

View File

@@ -259,34 +259,36 @@ class SkinEngine
$template->assign('styles', $styles);
$template->assign('bodyTemplate', $body);
// verify is RTL
$oServerConf =& serverConf::getSingleton();
if ($oServerConf->isRtl(SYS_LANG)) {
$template->assign('dirBody', 'dir="RTL"');
$doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
$meta = null;
$dirBody = null;
if (preg_match("/^.*\(.*MSIE (\d+)\..+\).*$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch)) {
$ie = intval($arrayMatch[1]);
$swTrident = (preg_match("/^.*Trident.*$/", $_SERVER["HTTP_USER_AGENT"]))? 1 : 0; //Trident only in IE8+
$sw = 1;
if ((($ie == 7 && $swTrident == 1) || $ie == 8) && !preg_match("/^ux.+$/", SYS_SKIN)) { //IE8
$sw = 0;
}
if ($sw == 1) {
$doctype = null;
$meta = "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=$ie\" />";
}
}
// end verify
// verify is IE
$doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
$meta = '';
$iexplores = array(
'IE=10' => '(MSIE 10\.[0-9]+)',
'IE=9' => '(MSIE 9\.[0-9]+)',
'IE=8' => '(MSIE 8\.[0-9]+)',
'IE=7' => '(MSIE 7\.[0-9]+)',
'IE=6' => '(MSIE 6\.[0-9]+)'
);
$serverConf = &serverConf::getSingleton();
foreach ($iexplores as $browser => $pattern) {
if (preg_match('/'.$pattern.'/', $_SERVER['HTTP_USER_AGENT'])) {
$doctype = '';
$meta = '<meta http-equiv="X-UA-Compatible" content="'. $browser .'"/>';
}
if ($serverConf->isRtl(SYS_LANG)) {
$dirBody = "dir=\"RTL\"";
}
// end verify
$template->assign('meta', $meta);
$template->assign('doctype', $doctype);
$template->assign("doctype", $doctype);
$template->assign("meta", $meta);
$template->assign("dirBody", $dirBody);
echo $template->getOutputContent();
}
@@ -718,4 +720,3 @@ class SkinEngine
}