diff options
Diffstat (limited to 'actions/entities/delete.php')
-rw-r--r-- | actions/entities/delete.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/actions/entities/delete.php b/actions/entities/delete.php new file mode 100644 index 000000000..251e1f01c --- /dev/null +++ b/actions/entities/delete.php @@ -0,0 +1,22 @@ +<?php +/** + * Default entity delete action + * + * @package Elgg + * @subpackage Core + */ + +$guid = get_input('guid'); +$entity = get_entity($guid); + +if (($entity) && ($entity->canEdit())) { + if ($entity->delete()) { + system_message(elgg_echo('entity:delete:success', array($guid))); + } else { + register_error(elgg_echo('entity:delete:fail', array($guid))); + } +} else { + register_error(elgg_echo('entity:delete:fail', array($guid))); +} + +forward(REFERER); |