diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-05-27 16:19:23 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-05-27 16:19:23 +0000 |
commit | 252990170bc0f55c159328cf186012174cab0a93 (patch) | |
tree | 49950f00d6d783d1ea269dc96bd3bf1827d1adda | |
parent | acfe3fb53ed587c012e424f965b6efaec44aa8aa (diff) | |
download | elgg-252990170bc0f55c159328cf186012174cab0a93.tar.gz elgg-252990170bc0f55c159328cf186012174cab0a93.tar.bz2 |
Delete event now triggered on metadata and annotation delete
git-svn-id: https://code.elgg.org/elgg/trunk@3305 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/annotations.php | 8 | ||||
-rw-r--r-- | engine/lib/metadata.php | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index 47903616a..df0f2a043 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -785,8 +785,12 @@ $id = (int)$id;
$access = get_access_sql_suffix();
-
- return delete_data("DELETE from {$CONFIG->dbprefix}annotations where id=$id and $access");
+ $annotation = get_annotation($id); + + if (trigger_elgg_event('delete', 'annotation', $annotation))
+ return delete_data("DELETE from {$CONFIG->dbprefix}annotations where id=$id and $access"); + + return false;
}
/**
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php index ca127c386..da189fe30 100644 --- a/engine/lib/metadata.php +++ b/engine/lib/metadata.php @@ -362,9 +362,10 @@ $metabyname_memcache = new ElggMemcache('metabyname_memcache');
if ($metabyname_memcache) $metabyname_memcache->delete("{$metadata->entity_guid}:{$metadata->name_id}");
- if ($metadata->canEdit())
+ if (($metadata->canEdit()) && (trigger_elgg_event('delete', 'metadata', $obj)))
return delete_data("DELETE from {$CONFIG->dbprefix}metadata where id=$id");
-
+ + return false;
}
/**
|