diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-30 13:02:49 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-30 13:02:49 +0000 |
commit | 82254eb5e19732856c7d5f493fc86145754021ed (patch) | |
tree | bafe8db2be9fcaf2faa566c3e268b60f9b08fb2d /engine/lib/metadata.php | |
parent | 66b1c80db62648374ac6112f59c4b6fe2bffac72 (diff) | |
download | elgg-82254eb5e19732856c7d5f493fc86145754021ed.tar.gz elgg-82254eb5e19732856c7d5f493fc86145754021ed.tar.bz2 |
Introducing url handlers for extenders.
git-svn-id: https://code.elgg.org/elgg/trunk@1598 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/metadata.php')
-rw-r--r-- | engine/lib/metadata.php | 51 |
1 files changed, 12 insertions, 39 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php index 14e141ec4..70f563d25 100644 --- a/engine/lib/metadata.php +++ b/engine/lib/metadata.php @@ -744,49 +744,22 @@ { $id = (int)$id; - global $CONFIG; - if ($extender = get_metadata($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 a metadata url handler. + * + * @param string $function_name The function. + * @param string $extender_name The name, default 'all'. + */ + function register_metadata_url_handler($function_name, $extender_name = "all") { + return register_extender_url_handler($function_name, 'metadata', $extender_name);
+ } + /** Register the hook */ register_plugin_hook("export", "all", "export_metadata_plugin_hook", 2); ?>
\ No newline at end of file |