Project

General

Profile

Bug #22688 ยป 14442.diff

Administrator Admin, 2010-05-20 00:23

View differences:

typo3/template.php (Arbeitskopie)
* @return string HTML body tag
*/
function docBodyTagBegin() {
$bodyContent = 'body onclick="if (top.menuReset) top.menuReset();" '.trim($this->bodyTagAdditions.($this->bodyTagId ? ' id="'.$this->bodyTagId.'"' : ''));
// add browser identification as classes
$bodyTagBrowserInfo = $this->bodyTagBrowserInfo();
if (strpos($this->bodyTagAdditions, 'class="') === FALSE) {
$bodyTagAdditions = 'class="' . $bodyTagBrowserInfo . '"';
} else {
$bodyTagAdditions = str_replace('class="', 'class="' . $bodyTagBrowserInfo . ' ', $this->bodyTagAdditions);
}
$bodyContent = 'body onclick="if (top.menuReset) top.menuReset();" ' . trim($bodyTagAdditions . ($this->bodyTagId ? ' id="' . $this->bodyTagId . '"' : ''));
return '<'.trim($bodyContent).'>';
}
/**
* Creates class attributes for body tag, dependent on the user agent
*
* @return string classes for browser, browser version and operating system
*/
protected function bodyTagBrowserInfo() {
$browserInfo = t3lib_utility_Client::getBrowserInfo(t3lib_div::getIndpEnv('HTTP_USER_AGENT'));
// concatenate all information together to a string like
// t3-browser-firefox t3-browser-firefox-3 t3-browser-firefox-3.6 t3-system-mac
$browserClass = implode(' ', array(
// browser name (msie, firefox)
't3-browser-' . $browserInfo['browser'],
// browser major version (msie-6, firefox-3)
't3-browser-' . $browserInfo['browser'] . '-' . substr($browserInfo['version'], 0, strrpos($browserInfo['version'], '.')),
// browser minor version (msie-6.0, firefox-3.6)
't3-browser-' . $browserInfo['browser'] . '-' . $browserInfo['version'],
// operating system (winNT, mac)
't3-system-' . $browserInfo['system'],
));
return $browserClass;
}
/**
* Outputting document style
*
* @return string HTML style section/link tags
    (1-1/1)