diff options
author | Sem <sembrestels@riseup.net> | 2011-11-18 07:32:27 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2011-11-18 07:32:27 +0100 |
commit | e53d410129701ea1c9d19529afa493f11b5f5b70 (patch) | |
tree | d9963b24bf8932654b4a47e36602c75975e50dba /engine/lib/annotations.php | |
parent | 377da25d2965c64941f83baae119fc970ec60982 (diff) | |
parent | 08a962c98e2923724f8013d6eaae89101243752a (diff) | |
download | elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.gz elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.bz2 |
Merge github.com:Elgg/Elgg
Conflicts:
engine/lib/input.php
Diffstat (limited to 'engine/lib/annotations.php')
-rw-r--r-- | engine/lib/annotations.php | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index 80ffbe74e..e40ab2e39 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -13,6 +13,7 @@ * @param stdClass $row Db row result object * * @return ElggAnnotation + * @access private */ function row_to_elggannotation($row) { if (!($row instanceof stdClass)) { @@ -55,14 +56,14 @@ function elgg_delete_annotation_by_id($id) { * @param int $entity_guid Entity Guid * @param string $name Name of annotation * @param string $value Value of annotation - * @param string $value_type Type of value - * @param int $owner_guid Owner of annotation + * @param string $value_type Type of value (default is auto detection) + * @param int $owner_guid Owner of annotation (default is logged in user) * @param int $access_id Access level of annotation * * @return int|bool id on success or false on failure */ -function create_annotation($entity_guid, $name, $value, $value_type, -$owner_guid, $access_id = ACCESS_PRIVATE) { +function create_annotation($entity_guid, $name, $value, $value_type = '', +$owner_guid = 0, $access_id = ACCESS_PRIVATE) { global $CONFIG; $result = false; @@ -213,7 +214,7 @@ function elgg_get_annotations(array $options = array()) { * * @param array $options An options array. {@See elgg_get_annotations()} * @return mixed - * @since 1.8 + * @since 1.8.0 */ function elgg_delete_annotations(array $options) { if (!elgg_is_valid_options_for_batch_operation($options, 'annotations')) { @@ -231,7 +232,7 @@ function elgg_delete_annotations(array $options) { * * @param array $options An options array. {@See elgg_get_annotations()} * @return mixed - * @since 1.8 + * @since 1.8.0 */ function elgg_disable_annotations(array $options) { if (!elgg_is_valid_options_for_batch_operation($options, 'annotations')) { @@ -249,7 +250,7 @@ function elgg_disable_annotations(array $options) { * * @param array $options An options array. {@See elgg_get_annotations()} * @return mixed - * @since 1.8 + * @since 1.8.0 */ function elgg_enable_annotations(array $options) { if (!$options || !is_array($options)) { @@ -267,7 +268,7 @@ function elgg_enable_annotations(array $options) { * {@see elgg_get_annotations()} and {@see elgg_list_entities()}. * * @return string The list of entities - * @since 1.8 + * @since 1.8.0 */ function elgg_list_annotations($options) { $defaults = array( @@ -285,14 +286,12 @@ function elgg_list_annotations($options) { */ /** - * Returns entities based upon annotations. Accepts the same values as - * elgg_get_entities_from_metadata() but uses the annotations table. + * Returns entities based upon annotations. Also accepts all options available + * to elgg_get_entities() and elgg_get_entities_from_metadata(). * - * NB: Entity creation time is selected as max_time. To sort based upon + * Entity creation time is selected as maxtime. To sort based upon * this, pass 'order_by' => 'maxtime asc' || 'maxtime desc' * - * time_created in this case will be the time the annotation was created. - * * @see elgg_get_entities * @see elgg_get_entities_from_metadata * @@ -321,7 +320,7 @@ function elgg_list_annotations($options) { * * annotation_ids => NULL|ARR Annotation IDs * - * @return array + * @return mixed If count, int. If not count, array. false on errors. * @since 1.7.0 */ function elgg_get_entities_from_annotations(array $options = array()) { @@ -379,7 +378,7 @@ function elgg_get_entities_from_annotations(array $options = array()) { * @see elgg_get_entities_from_annotations() * @see elgg_list_entities() * - * @return str + * @return string */ function elgg_list_entities_from_annotations($options = array()) { return elgg_list_entities($options, 'elgg_get_entities_from_annotations'); @@ -398,7 +397,7 @@ function elgg_list_entities_from_annotations($options = array()) { * 'metadata_names' => The name of metadata on the entity. * 'metadata_values' => The value of metadata on the entitiy. * - * @return mixed + * @return mixed If count, int. If not count, array. false on errors. */ function elgg_get_entities_from_annotation_calculation($options) { $db_prefix = elgg_get_config('dbprefix'); @@ -451,6 +450,7 @@ function elgg_list_entities_from_annotation_calculation($options) { * @elgg_plugin_hook export all * * @return mixed + * @access private */ function export_annotation_plugin_hook($hook, $entity_type, $returnvalue, $params) { // Sanity check values @@ -547,6 +547,7 @@ elgg_register_plugin_hook_handler('unit_test', 'system', 'annotations_test'); /** * Register annotation unit tests + * @access private */ function annotations_test($hook, $type, $value, $params) { global $CONFIG; |