Elgg  Version 3.0
annotations.php
Go to the documentation of this file.
1 <?php
17  return _elgg_services()->annotationsTable->get($id);
18 }
19 
29  if (!$annotation) {
30  return false;
31  }
32 
33  return $annotation->delete();
34 }
35 
52 function elgg_get_annotations(array $options = []) {
53  return _elgg_services()->annotationsTable->find($options);
54 }
55 
66  $defaults = [
67  'limit' => 25,
68  'offset' => (int) max(get_input('annoff', 0), 0),
69  ];
70 
71  $options = array_merge($defaults, $options);
72 
73  return elgg_list_entities($options, 'elgg_get_annotations', 'elgg_view_annotation_list');
74 }
75 
88  return _elgg_services()->annotationsTable->deleteAll($options);
89 }
90 
101  return _elgg_services()->annotationsTable->disableAll($options);
102 }
103 
117  return _elgg_services()->annotationsTable->enableAll($options);
118 }
119 
131  $owner_guid = (int) $owner_guid;
132  if ($owner_guid < 1) {
134  }
135 
136  return _elgg_services()->annotationsTable->exists($entity_guid, $name, $owner_guid);
137 }
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
$annotation
Elgg default annotation view.
Definition: default.php:10
elgg_delete_annotations(array $options)
Deletes annotations based on $options.
Definition: annotations.php:87
$defaults
elgg_get_annotations(array $options=[])
Fetch annotations or perform a calculation on them.
Definition: annotations.php:52
elgg_list_entities(array $options=[], $getter= 'elgg_get_entities', $viewer= 'elgg_view_entity_list')
Returns a string of rendered entities.
Definition: entities.php:577
$options
Elgg admin footer.
Definition: footer.php:6
$entity_guid
Definition: save.php:9
elgg_disable_annotations(array $options)
Disables annotations based on $options.
$owner_guid
elgg_list_annotations($options)
Returns a rendered list of annotations with pagination.
Definition: annotations.php:65
$id
River item delete action.
Definition: delete.php:6
elgg_get_annotation_from_id($id)
Elgg annotations Functions to manage object annotations.
Definition: annotations.php:16
elgg_delete_annotation_by_id($id)
Deletes an annotation using its ID.
Definition: annotations.php:27
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
elgg_enable_annotations(array $options)
Enables annotations based on $options.
elgg_annotation_exists($entity_guid, $name, $owner_guid=null)
Check to see if a user has already created an annotation on an object.
_elgg_services()
Get the global service provider.
Definition: elgglib.php:1292
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.
Definition: sessions.php:39