Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.823 diff -u -p -r1.823 common.inc --- includes/common.inc 10 Nov 2008 05:22:59 -0000 1.823 +++ includes/common.inc 11 Nov 2008 16:04:18 -0000 @@ -2715,6 +2715,7 @@ function _drupal_bootstrap_full() { require_once DRUPAL_ROOT . '/includes/form.inc'; require_once DRUPAL_ROOT . '/includes/mail.inc'; require_once DRUPAL_ROOT . '/includes/actions.inc'; + require_once DRUPAL_ROOT . '/includes/rdf.inc'; // Set the Drupal custom error handler. set_error_handler('_drupal_error_handler'); set_exception_handler('_drupal_exception_handler'); Index: includes/rdf.inc =================================================================== RCS file: includes/rdf.inc diff -N includes/rdf.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ includes/rdf.inc 11 Nov 2008 16:04:18 -0000 @@ -0,0 +1,57 @@ + 'http://rdfs.org/sioc/ns#', + * 'foaf' => 'http://xmlns.com/foaf/0.1/', + * ); + * } + * @endcode + * + * @return + * An array containing all the RDF namespaces defined by the modules. + */ +function rdf_get_namespaces() { + $namespaces = array(); + + foreach (module_list() as $module) { + if ($module_namespaces = module_invoke($module, 'rdf_namespace')) { + // Loop through each namespace defined by the module and register the + // namespace if it has not been registered yet. + foreach ($module_namespaces as $prefix => $uri) { + if (!isset($namespaces[$prefix])) { + $namespaces[$prefix] = $uri; + } + // Prevent modules from overriding already defined prefixes. + elseif ($namespaces[$prefix] != $uri) { + drupal_set_message(t('The RDF namespace prefix %prefix cannot be defined twice with different URIs.', array('%prefix' => $prefix)), 'error'); + } + } + } + } + + return $namespaces; +} + Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.450 diff -u -p -r1.450 theme.inc --- includes/theme.inc 10 Nov 2008 15:40:03 -0000 1.450 +++ includes/theme.inc 11 Nov 2008 16:04:18 -0000 @@ -1885,6 +1885,14 @@ function template_preprocess_page(&$vari // Closure should be filled last. $variables['closure'] = theme('closure'); + // Construct RDFa elements to annotate the page. + $xml_rdf_namespaces = array(); + foreach (rdf_get_namespaces() as $prefix => $uri) { + $xml_rdf_namespaces[] = 'xmlns:' . $prefix . '="' . $uri . '"'; + } + $variables['rdf_namespaces'] = implode(' ', $xml_rdf_namespaces); + $variables['grddl_profile'] = GRDDL_PROFILE; + if ($node = menu_get_object()) { $variables['node'] = $node; } Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.635 diff -u -p -r1.635 system.module --- modules/system/system.module 31 Oct 2008 02:18:22 -0000 1.635 +++ modules/system/system.module 11 Nov 2008 16:04:19 -0000 @@ -197,6 +197,26 @@ function system_perm() { } /** + * Implementation of hook_rdf_namespace(). + */ +function system_rdf_namespace() { + return array( + 'admin' => 'http://webns.net/mvcb/', + 'content' => 'http://purl.org/rss/1.0/modules/content/', + 'dc' => 'http://purl.org/dc/elements/1.1/', + 'dcterms' => 'http://purl.org/dc/terms/', + 'foaf' => 'http://xmlns.com/foaf/0.1/', + 'owl' => 'http://www.w3.org/2002/07/owl#', + 'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', + 'rdfs' => 'http://www.w3.org/2000/01/rdf-schema#', + 'rss' => 'http://purl.org/rss/1.0/', + 'sioc' => 'http://rdfs.org/sioc/ns#', + 'xsi' => 'http://www.w3.org/2001/XMLSchema-instance#', + 'xsd' => 'http://www.w3.org/2001/XMLSchema#', + ); +} + +/** * Implementation of hook_elements(). */ function system_elements() { Index: themes/garland/page.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/themes/garland/page.tpl.php,v retrieving revision 1.21 diff -u -p -r1.21 page.tpl.php --- themes/garland/page.tpl.php 14 Sep 2008 02:03:35 -0000 1.21 +++ themes/garland/page.tpl.php 11 Nov 2008 16:04:19 -0000 @@ -1,9 +1,9 @@ - - +?> +> + <?php print $head_title ?>