diff options
author | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-03-06 17:50:28 +0000 |
---|---|---|
committer | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-03-06 17:50:28 +0000 |
commit | 4318e9697253546e8bb4f76166ac92ee6918e94e (patch) | |
tree | e4c2f40030d93781109e21f56101af58e8c8482b /engine/lib | |
parent | f411bafa56c557a28f37d6b392579bc05c12ab62 (diff) | |
download | elgg-4318e9697253546e8bb4f76166ac92ee6918e94e.tar.gz elgg-4318e9697253546e8bb4f76166ac92ee6918e94e.tar.bz2 |
Marcus Povey <marcus@dushka.co.uk>
* Added delete annotations, fixed error on annotation search (missing params)
git-svn-id: https://code.elgg.org/elgg/trunk@105 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/annotations.php | 10 | ||||
-rw-r--r-- | engine/lib/sites.php | 15 |
2 files changed, 22 insertions, 3 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index c02ad10fa..d795f590d 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -136,12 +136,14 @@ * * @param int $object_id * @param string $object_type + * @param string $name + * @param mixed $value * @param int $owner_id * @param string $order_by * @param int $limit * @param int $offset */ - function get_annotations($object_id = 0, $object_type = "", $owner_id = 0, $order_by = "created desc", $limit = 10, $offset = 0) + function get_annotations($object_id = 0, $object_type = "", $name = "", $value = "", $owner_id = 0, $order_by = "created desc", $limit = 10, $offset = 0) { global $CONFIG; @@ -168,6 +170,12 @@ if ($owner_id != 0) $where[] = "owner_id=$owner_id"; + if ($name != "") + $where[] = "name='$name'"; + + if ($value != "") + $where[] = "value='$value'"; + // add access controls $access = get_access_list(); $where[] = "(access_id in {$access} or (access_id = 0 and owner_id = {$_SESSION['id']}))"; diff --git a/engine/lib/sites.php b/engine/lib/sites.php index 991493c8a..294ed9c8f 100644 --- a/engine/lib/sites.php +++ b/engine/lib/sites.php @@ -518,8 +518,19 @@ */ function remove_site_annotations($site_id, $name) { - // TODO : Writeme - throw new NotImplementedException("Writeme!"); + $annotations = get_annotations($site_id, 'site', $name); + + if($annotations) + { + foreach ($annotations as $a) + { + delete_annotation($a->id); + } + + return true; + } + + return false; } /** |