diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-09-15 10:57:32 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-09-15 10:57:32 +0000 |
commit | 321e3a7f7019286a9d2a0e6b34cdc20a4a113074 (patch) | |
tree | 136b0895e5373c8943a941a11bf60d6e1dfae02e | |
parent | a3fb50f366dd63a99968d28503110f5933cdad92 (diff) | |
download | elgg-321e3a7f7019286a9d2a0e6b34cdc20a4a113074.tar.gz elgg-321e3a7f7019286a9d2a0e6b34cdc20a4a113074.tar.bz2 |
Closes #346: More granularity on enable/disable.
git-svn-id: https://code.elgg.org/elgg/trunk@2082 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/entities.php | 12 |
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); |