diff options
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'); |