diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-11-22 13:55:27 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-11-22 13:55:27 +0000 |
commit | 151ed277865cf3a72bb16610b7855207e38e082c (patch) | |
tree | 4236495ad709c486b07e34a4ff26e7d7c1f3caa2 /includes | |
parent | 33cf35a6e8a7cab73147af368f2ee4d16a41dbd0 (diff) | |
download | brdo-151ed277865cf3a72bb16610b7855207e38e082c.tar.gz brdo-151ed277865cf3a72bb16610b7855207e38e082c.tar.bz2 |
- Patch #332980 by scor: added an RDF namespace registry. Oh my ... :-)
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 12 | ||||
-rw-r--r-- | includes/theme.inc | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc index e944ca300..76eac625b 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -113,6 +113,18 @@ function drupal_get_breadcrumb() { } /** + * Returns a string containing RDF namespaces for the html tag of a XHTML page. + */ +function drupal_get_rdf_namespaces() { + // Serialize the RDF namespaces used in RDFa annotation. + $xml_rdf_namespaces = array(); + foreach (module_invoke_all('rdf_namespaces') as $prefix => $uri) { + $xml_rdf_namespaces[] = 'xmlns:' . $prefix . '="' . $uri . '"'; + } + return implode("\n ", $xml_rdf_namespaces); +} + +/** * Add output to the head tag of the HTML page. * * This function can be called as long the headers aren't sent. diff --git a/includes/theme.inc b/includes/theme.inc index d2eedcf80..00b8b50af 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1881,6 +1881,11 @@ function template_preprocess_page(&$variables) { $variables['scripts'] = drupal_get_js(); $variables['tabs'] = theme('menu_local_tasks'); $variables['title'] = drupal_get_title(); + // RDFa annotatates XHTML with RDF data, while GRDDL provides + // mechanisms for extraction of this RDF content via XSLT transformation + // using an associated GRDDL profile. + $variables['rdf_namespaces'] = drupal_get_rdf_namespaces(); + $variables['grddl_profile'] = 'http://ns.inria.fr/grddl/rdfa/'; // Closure should be filled last. $variables['closure'] = theme('closure'); |