function _uuid_link_entity_url in UUID Link 7
Helper function for getting an language aware url.
2 calls to _uuid_link_entity_url()
- uuid_link_entity_url in ./
uuid_link.module - Get URL to an entity.
- uuid_link_tokens in ./
uuid_link.module - Implements hook_tokens().
File
- ./
uuid_link.module, line 247 - Provides a filter and UI for adding links to entities that are not affected by changes in URL alias.
Code
function _uuid_link_entity_url($uri, $entity) {
$languages =& drupal_static(__FUNCTION__);
if (empty($languages)) {
$languages = language_list();
}
if (!isset($uri['options']['language']) && !empty($entity->language) && LANGUAGE_NONE !== $entity->language) {
$uri['options']['language'] = $languages[$entity->language];
}
return url($uri['path'], empty($uri['options']) ? array() : $uri['options']);
}