aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/annotations.php
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-30 13:02:49 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-30 13:02:49 +0000
commit82254eb5e19732856c7d5f493fc86145754021ed (patch)
treebafe8db2be9fcaf2faa566c3e268b60f9b08fb2d /engine/lib/annotations.php
parent66b1c80db62648374ac6112f59c4b6fe2bffac72 (diff)
downloadelgg-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/annotations.php')
-rw-r--r--engine/lib/annotations.php50
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 */