From 52195a6b1dd478875a93935df27d7bcacb14f289 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 11 Feb 2010 15:52:13 +0000 Subject: #525622 by scor, catch, and yched: Allow Entity path callback to deal with options. --- includes/common.inc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index 5285e7311..cea7b037b 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -6567,19 +6567,21 @@ function entity_prepare_view($entity_type, $entities) { } /** - * Returns the path to an entity. + * Returns the uri elements of an entity. * * @param $entity_type * The entity type; e.g. 'node' or 'user'. * @param $entity * The entity for which to generate a path. * @return - * The path for the entity, or NULL if the entity has no page of its own. + * An array containing the 'path' and 'options' keys used to build the uri of + * the entity, and matching the signature of url(). NULL if the entity has no + * uri of its own. */ -function entity_path($entity_type, $entity) { +function entity_uri($entity_type, $entity) { $info = entity_get_info($entity_type); - if (isset($info['path callback']) && function_exists($info['path callback'])) { - return $info['path callback']($entity); + if (isset($info['uri callback']) && function_exists($info['uri callback'])) { + return $info['uri callback']($entity) + array('options' => array()); } } /** -- cgit v1.2.3