diff options
Diffstat (limited to 'engine/lib/annotations.php')
-rw-r--r-- | engine/lib/annotations.php | 50 |
1 files changed, 12 insertions, 38 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index 255e8a9b0..5d2029591 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -683,47 +683,21 @@ { $id = (int)$id; - global $CONFIG; - if ($extender = get_annotation($id)) { - - $view = elgg_get_viewtype(); - - $guid = $extender->entity_guid; - $type = $extender->type; - - $url = ""; - - /*if (isset($CONFIG->entity_url_handler[$entity->getType()][$entity->getSubType()])) { - $function = $CONFIG->entity_url_handler[$entity->getType()][$entity->getSubType()]; - if (is_callable($function)) { - $url = $function($entity); - } - } - if (isset($CONFIG->entity_url_handler[$entity->getType()]['all'])) { - $function = $CONFIG->entity_url_handler[$entity->getType()]['all']; - if (is_callable($function)) { - $url = $function($entity); - } - } - if (isset($CONFIG->entity_url_handler['all']['all'])) { - $function = $CONFIG->entity_url_handler['all']['all']; - if (is_callable($function)) { - $url = $function($entity); - } - }*/ - - - if ($url == "") { - $nameid = $extender->id; - if ($type == 'volatile') - $nameid== $extender->name; - $url = $CONFIG->wwwroot . "$view/$guid/$type/$nameid/"; - } - return $url; - + return get_extender_url($extender); } return false; + } + + + /** + * Register an annotation url handler. + * + * @param string $function_name The function. + * @param string $extender_name The name, default 'all'. + */ + function register_annotation_url_handler($function_name, $extender_name = "all") { + return register_extender_url_handler($function_name, 'annotation', $extender_name); }
/** Register the hook */
|