diff options
-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; } /** |