diff options
| author | Cash Costello <cash.costello@gmail.com> | 2011-12-22 08:12:07 -0500 | 
|---|---|---|
| committer | Cash Costello <cash.costello@gmail.com> | 2011-12-22 08:12:07 -0500 | 
| commit | e49df853b2cc3a6a9bc2dd527a64951050142eb9 (patch) | |
| tree | 6f485b560f89331c65fad3993e055a1834b07177 /engine/lib/annotations.php | |
| parent | 5e5b3705a5ca7b66dfe386490c5570af88b49009 (diff) | |
| parent | fea599f1653d7206e34ac33c0c0a668cb587bc20 (diff) | |
| download | elgg-e49df853b2cc3a6a9bc2dd527a64951050142eb9.tar.gz elgg-e49df853b2cc3a6a9bc2dd527a64951050142eb9.tar.bz2  | |
Merge branch '1.8' after 1.8.2 release
Conflicts:
	version.php
Diffstat (limited to 'engine/lib/annotations.php')
| -rw-r--r-- | engine/lib/annotations.php | 32 | 
1 files changed, 27 insertions, 5 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index e40ab2e39..bfd40d1e8 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -529,6 +529,20 @@ function elgg_annotation_exists($entity_guid, $annotation_type, $owner_guid = NU  }  /** + * Return the URL for a comment + * + * @param ElggAnnotation $comment The comment object  + * @return string + * @access private + */ +function elgg_comment_url_handler(ElggAnnotation $comment) { +	$entity = $comment->getEntity(); +	if ($entity) { +		return $entity->getURL() . '#item-annotation-' . $comment->id; +	} +} + +/**   * Register an annotation url handler.   *   * @param string $function_name The function. @@ -540,11 +554,6 @@ function elgg_register_annotation_url_handler($extender_name = "all", $function_  	return elgg_register_extender_url_handler('annotation', $extender_name, $function_name);  } -/** Register the hook */ -elgg_register_plugin_hook_handler("export", "all", "export_annotation_plugin_hook", 2); - -elgg_register_plugin_hook_handler('unit_test', 'system', 'annotations_test'); -  /**   * Register annotation unit tests   * @access private @@ -554,3 +563,16 @@ function annotations_test($hook, $type, $value, $params) {  	$value[] = $CONFIG->path . 'engine/tests/api/annotations.php';  	return $value;  } + +/** + * Initialize the annotation library + * @access private + */ +function elgg_annotations_init() { +	elgg_register_annotation_url_handler('generic_comment', 'elgg_comment_url_handler'); + +	elgg_register_plugin_hook_handler("export", "all", "export_annotation_plugin_hook", 2); +	elgg_register_plugin_hook_handler('unit_test', 'system', 'annotations_test'); +} + +elgg_register_event_handler('init', 'system', 'elgg_annotations_init');  | 
