diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-30 13:54:45 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-30 13:54:45 +0000 |
commit | 5c13b26a250c5bd8cc18790d5b39fc46c86020f8 (patch) | |
tree | 233ef4a9828f45a9438709cd306a427f02ca6ef6 /engine/lib/extender.php | |
parent | 07cd0838215d49e0029e818d5e6d904548a0b175 (diff) | |
download | elgg-5c13b26a250c5bd8cc18790d5b39fc46c86020f8.tar.gz elgg-5c13b26a250c5bd8cc18790d5b39fc46c86020f8.tar.bz2 |
Refs #186: Get URL for relationships
git-svn-id: https://code.elgg.org/elgg/trunk@1601 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/extender.php')
-rw-r--r-- | engine/lib/extender.php | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/engine/lib/extender.php b/engine/lib/extender.php index 20b1750f5..e444a4d55 100644 --- a/engine/lib/extender.php +++ b/engine/lib/extender.php @@ -375,7 +375,7 @@ if (!isset($CONFIG->extender_url_handler[$extender_type])) { $CONFIG->extender_url_handler[$extender_type] = array(); } - $CONFIG->entity_url_handler[$extender_type][$extender_name] = $function_name; + $CONFIG->extender_url_handler[$extender_type][$extender_name] = $function_name; return true; @@ -391,33 +391,32 @@ { global $CONFIG; - $view = elgg_get_viewtype(); - $guid = $extender->entity_guid; - $type = $extender->type; - - $url = ""; - - $function = ""; - if (isset($CONFIG->extender_url_handler[$type][$extender->name])) - $function = $CONFIG->extender_url_handler[$type][$extender->name]; - if (isset($CONFIG->extender_url_handler[$type]['all'])) - $function = $CONFIG->extender_url_handler[$type]['all']; - if (isset($CONFIG->extender_url_handler['all']['all'])) - $function = $CONFIG->extender_url_handler['all']['all']; - - if (is_callable($function)) { - $url = $function($extender); - } + $guid = $extender->entity_guid; + $type = $extender->type; + + $url = ""; + + $function = ""; + if (isset($CONFIG->extender_url_handler[$type][$extender->name])) + $function = $CONFIG->extender_url_handler[$type][$extender->name]; + if (isset($CONFIG->extender_url_handler[$type]['all'])) + $function = $CONFIG->extender_url_handler[$type]['all']; + if (isset($CONFIG->extender_url_handler['all']['all'])) + $function = $CONFIG->extender_url_handler['all']['all']; - if ($url == "") { - $nameid = $extender->id; - if ($type == 'volatile') - $nameid== $extender->name; - $url = $CONFIG->wwwroot . "export/$view/$guid/$type/$nameid/"; - } - return $url; + if (is_callable($function)) { + $url = $function($extender); + } + + if ($url == "") { + $nameid = $extender->id; + if ($type == 'volatile') + $nameid== $extender->name; + $url = $CONFIG->wwwroot . "export/$view/$guid/$type/$nameid/"; + } + return $url; }
/** Register the hook */ |