Added feature #16395: Add basic support for RDFa in core (semantic web)
authorJochen Rau <j.rau@web.de>
Wed, 17 Nov 2010 10:23:23 +0000 (10:23 +0000)
committerJochen Rau <j.rau@web.de>
Wed, 17 Nov 2010 10:23:23 +0000 (10:23 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9436 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_pagegen.php

index d5aeb16..b45f769 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-11-17  Jochen Rau <jochen.rau@typoplanet.de>
+
+       * Added feature #16395: Add basic support for RDFa in core (semantic web)
+
 2010-11-17  Steffen Gebert  <steffen@steffen-gebert.de>
 
        * Fixed bug #14449: Deprecate usage of ImageMagick version 4 and 5
@@ -13904,4 +13908,4 @@ Charsets:
 
 --------------------
 
-SVN ID: $Id$
+SVN ID: $Id$
\ No newline at end of file
index c69b6a3..bc00651 100644 (file)
@@ -230,6 +230,7 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
                                        $GLOBALS['TSFE']->xhtmlVersion = 105;
                                break;
                                case 'xhtml_11':
+                               case 'xhtml+rdfa_10':
                                        $GLOBALS['TSFE']->xhtmlVersion = 110;
                                break;
                                case 'xhtml_2':
@@ -388,8 +389,9 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
                                $docTypeParts[] = $GLOBALS['TSFE']->config['config']['xmlprologue'];
                }
                // Part 2: DTD
-               if ($GLOBALS['TSFE']->config['config']['doctype']) {
-                       switch ((string) $GLOBALS['TSFE']->config['config']['doctype']) {
+               $doctype = $GLOBALS['TSFE']->config['config']['doctype'];
+               if ($doctype) {
+                       switch ($doctype) {
                                case 'xhtml_trans' :
                                        $docTypeParts[] = '<!DOCTYPE html
      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -420,13 +422,18 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
        PUBLIC "-//W3C//DTD XHTML 2.0//EN"
        "http://www.w3.org/TR/xhtml2/DTD/xhtml2.dtd">';
                                        break;
+                               case 'xhtml+rdfa_10' :
+                                       $docTypeParts[] = '<!DOCTYPE html
+       PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
+       "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">';
+                                       break;
                                case 'html_5' :
                                        $docTypeParts[] = '<!DOCTYPE html>';
                                        break;
                                case 'none' :
                                        break;
                                default :
-                                       $docTypeParts[] = $GLOBALS['TSFE']->config['config']['doctype'];
+                                       $docTypeParts[] = $doctype;
                        }
                } else {
                        $docTypeParts[] = '<!DOCTYPE html
@@ -434,12 +441,15 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
                }
 
                if ($GLOBALS['TSFE']->xhtmlVersion) {
-
-                       // Setting <html> tag attributes:
-                       $htmlTagAttributes['xmlns'] = 'http://www.w3.org/1999/xhtml';
                        $htmlTagAttributes['xml:lang'] = $htmlLang;
-                       if ($GLOBALS['TSFE']->xhtmlVersion < 110) {
-                               $htmlTagAttributes['lang'] = $htmlLang;
+               }
+               if ($GLOBALS['TSFE']->xhtmlVersion < 110 || $doctype === 'html_5') {
+                       $htmlTagAttributes['lang'] = $htmlLang;
+               }
+               if ($GLOBALS['TSFE']->xhtmlVersion || $doctype === 'html_5') {
+                       $htmlTagAttributes['xmlns'] = 'http://www.w3.org/1999/xhtml'; // We add this to HTML5 to achieve a slightly better backwards compatibility
+                       foreach ($GLOBALS['TSFE']->config['config']['namespaces.'] as $prefix => $uri) {
+                               $htmlTagAttributes['xmlns:' . htmlspecialchars($prefix)] = $uri; // $uri gets htmlspecialchared later
                        }
                }
 
@@ -1187,4 +1197,4 @@ class FE_loadDBGroup extends t3lib_loadDBGroup {
        var $fromTC = 0;        // Means that everything is returned instead of only uid and label-field
 }
 
-?>
+?>
\ No newline at end of file