diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-04-06 19:49:03 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-04-06 19:49:03 +0000 |
commit | ba96cffdb7d3f76254ff7391523a6fc34abf10e2 (patch) | |
tree | dd42dc052efda70657a1e73ab1e47964c920d734 /modules/rdf | |
parent | c2b1029595afe103b5f1533604cfe658755f1f8d (diff) | |
download | brdo-ba96cffdb7d3f76254ff7391523a6fc34abf10e2.tar.gz brdo-ba96cffdb7d3f76254ff7391523a6fc34abf10e2.tar.bz2 |
- Patch #699440 by scor, effulgentsia, noahb, catch: add bundle support to entity_uri() callback to remove performance overhead of forum_url_outbound_alter().
Diffstat (limited to 'modules/rdf')
-rw-r--r-- | modules/rdf/rdf.module | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/modules/rdf/rdf.module b/modules/rdf/rdf.module index 9e971ce05..105a9680c 100644 --- a/modules/rdf/rdf.module +++ b/modules/rdf/rdf.module @@ -534,29 +534,31 @@ function rdf_preprocess_field(&$variables) { * Implements MODULE_preprocess_HOOK(). */ function rdf_preprocess_user_profile(&$variables) { - // Adds RDFa markup to the user profile page. Fields displayed in this page - // will automatically describe the user. $account = $variables['elements']['#account']; + $uri = entity_uri('user', $account); + + // Adds RDFa markup to the user profile page. Fields displayed in this page + // will automatically describe the user. if (!empty($account->rdf_mapping['rdftype'])) { $variables['attributes_array']['typeof'] = $account->rdf_mapping['rdftype']; - $variables['attributes_array']['about'] = url('user/' . $account->uid); + $variables['attributes_array']['about'] = url($uri['path'], $uri['options']); } // Adds the relationship between the sioc:User and the foaf:Person who holds // the account. $account_holder_meta = array( '#tag' => 'meta', '#attributes' => array( - 'about' => url('user/' . $account->uid, array('fragment' => 'me')), + 'about' => url($uri['path'], array_merge($uri['options'], array('fragment' => 'me'))), 'typeof' => array('foaf:Person'), 'rel' => array('foaf:account'), - 'resource' => url('user/' . $account->uid), + 'resource' => url($uri['path'], $uri['options']), ), ); // Adds the markup for username. $username_meta = array( '#tag' => 'meta', '#attributes' => array( - 'about' => url('user/' . $account->uid), + 'about' => url($uri['path'], $uri['options']), 'property' => $account->rdf_mapping['name']['predicates'], 'content' => $account->name, ) @@ -629,7 +631,8 @@ function rdf_preprocess_comment(&$variables) { // Adds RDFa markup to the comment container. The about attribute specifies // the URI of the resource described within the HTML element, while the // typeof attribute indicates its RDF type (e.g. sioc:Post, etc.). - $variables['attributes_array']['about'] = url('comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid)); + $uri = entity_uri('comment', $comment); + $variables['attributes_array']['about'] = url($uri['path'], $uri['options']); $variables['attributes_array']['typeof'] = $comment->rdf_mapping['rdftype']; } |