aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/entities.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 0f9f24c81..0fd7d6976 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1507,10 +1507,12 @@
global $CONFIG;
$owner_guid = (int) $owner_guid;
- if ($entity = get_entity($owner_guid)) {
- if ($entity->canEdit()) {
- $res = update_data("UPDATE {$CONFIG->dbprefix}entities set enabled='no' where owner_guid={$owner_guid} or container_guid = {$owner_guid}");
- return $res;
+ if ($entity = get_entity($owner_guid)) {
+ if (trigger_elgg_event('disable',$entity->type,$entity)) {
+ if ($entity->canEdit()) {
+ $res = update_data("UPDATE {$CONFIG->dbprefix}entities set enabled='no' where owner_guid={$owner_guid} or container_guid = {$owner_guid}");
+ return $res;
+ }
}
}
return false;
@@ -1533,7 +1535,7 @@
access_show_hidden_entities(true);
if ($entity = get_entity($guid)) {
- if (trigger_elgg_event('delete',$entity->type,$entity)) {
+ if (trigger_elgg_event('enable',$entity->type,$entity)) {
if ($entity->canEdit()) {
access_show_hidden_entities($access_status);