Index: typo3/template.php =================================================================== --- typo3/template.php (revision 5342) +++ typo3/template.php (working copy) @@ -125,6 +125,7 @@ if (!defined('TYPO3_MODE')) die("Can't include this file directly."); require_once(PATH_t3lib.'class.t3lib_ajax.php'); +require_once(PATH_t3lib.'class.t3lib_matchcondition.php'); @@ -134,7 +135,6 @@ - /** * Deprecated fontwrap function. Is just transparent now. * @@ -650,34 +650,25 @@ switch($this->docType) { case 'html_3': - $headerStart = ' -'; + $headerStart = ''; $htmlTag = ''; break; case 'xhtml_strict': $headerStart = ' -charset.'"?> - -'; + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; break; case 'xhtml_frames': $headerStart = ' -charset.'"?> -'; + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'; break; // The fallthrough is intended as XHTML 1.0 transitional is the default for the BE. case 'xhtml_trans': default: $headerStart = ' -charset.'"?> - -'; + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'; } // This loads the tabulator-in-textarea feature. It automatically modifies @@ -686,8 +677,33 @@ $this->loadJavascriptLib('tab.js'); } + // Get the browser info + $matchObject = t3lib_div::makeInstance('t3lib_matchCondition'); + $browserInfo = $matchObject->browserInfo(t3lib_div::getIndpEnv('HTTP_USER_AGENT')); + + // Set the XML prologue + $xmlPrologue = 'charset . '"?>'; + + // Set the XML stylesheet + $xmlStylesheet = ''; + + // Add the XML prologue for XHTML doctypes + if ($this->docType !== 'html_3') { + // Put the XML prologue before or after the doctype declaration according to browser + if ($browserInfo['browser'] === 'msie' && $browserInfo['version'] < 7) { + $headerStart = $headerStart . chr(10) . $xmlPrologue; + } else { + $headerStart = $xmlPrologue . chr(10) . $headerStart; + } + + // Add the xml stylesheet according to doctype + if ($this->docType !== 'xhtml_frames') { + $headerStart = $headerStart . chr(10) . $xmlStylesheet; + } + } + // Construct page header. - $str = $headerStart . $htmlTag . ' + $str = $headerStart . chr(10) . $htmlTag . ' '.$charSet.' @@ -1319,9 +1335,9 @@ */ protected function removeJavascriptLib($lib) { if (count($this->JScodeLibArray)) { - $scripts = array_keys($this->JScodeLibArray); + $scripts = array_keys($this->JScodeLibArray); foreach ($scripts as $script) { - if (strpos($script, '/' . $lib . '/') !== false) { + if (strpos($script, '/' . $lib . '/') !== false) { unset ($this->JScodeLibArray[$script]); } } @@ -1985,7 +2001,7 @@ } // resolve dependencies if (in_array('dragdrop', $mods) || in_array('controls', $mods)) { - $mods = array_merge(array('effects'), $mods); + $mods = array_merge(array('effects'), $mods); } if (count($mods)) { @@ -2096,7 +2112,7 @@ $this->addExtJSdebug = true; } - + }