[TYPO3-core] xhtmlDoctype again
Martin Kutschker
Martin.Kutschker at blackbox.net
Fri Nov 25 14:23:31 CET 2005
Hi!
Here's a new patch for the doctype handling. It suports not only a config.xhtmlDoctype but also a config.xhtmlVersion for easy xhtml version comparisons (no inList needed for most cases).
As the patch is a bit hard to read I have attached the relevant new code.
Masi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-patch
Size: 2405 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20051125/bc7f38ae/attachment.bin
-------------- next part --------------
// Setting XHTML doctype from doctype
if (!$GLOBALS['TSFE']->config['config']['xhtmlDoctype']) {
$GLOBALS['TSFE']->config['config']['xhtmlDoctype'] = $GLOBALS['TSFE']->config['config']['doctype'];
}
if ($GLOBALS['TSFE']->config['config']['xhtmlDoctype']) {
// Setting <html> tag attributes:
switch((string)$GLOBALS['TSFE']->config['config']['xhtmlDoctype']) {
case 'xhtml_trans':
case 'xhtml_strict':
case 'xhtml_frames':
case 'xhtml_basic':
$htmlTagAttributes['xmlns'] = 'http://www.w3.org/1999/xhtml';
$htmlTagAttributes['xml:lang'] = $htmlLang;
$htmlTagAttributes['lang'] = $htmlLang;
break;
case 'xhtml_11':
case 'xhtml_2':
$htmlTagAttributes['xmlns'] = 'http://www.w3.org/1999/xhtml';
$htmlTagAttributes['xml:lang'] = $htmlLang;
break;
}
// Setting xhtml version number:
switch((string)$GLOBALS['TSFE']->config['config']['xhtmlDoctype']) {
case 'xhtml_trans':
case 'xhtml_strict':
case 'xhtml_frames':
$this->xhtmlVersion = 100;
break;
case 'xhtml_basic':
$this->xhtmlVersion = 105;
break;
break;
case 'xhtml_11':
$this->xhtmlVersion = 110;
break;
case 'xhtml_2':
$this->xhtmlVersion = 200;
break;
break;
}
}
More information about the TYPO3-team-core
mailing list