delete.php 451 B

1234567891011121314151617181920212223
  1. <?php
  2. /**
  3. * Default entity delete action
  4. *
  5. * @package Elgg
  6. * @subpackage Core
  7. */
  8. $guid = get_input('guid');
  9. $entity = get_entity($guid);
  10. if (($entity) && ($entity->canEdit())) {
  11. if ($entity->delete()) {
  12. system_message(elgg_echo('entity:delete:success', array($guid)));
  13. } else {
  14. register_error(elgg_echo('entity:delete:fail', array($guid)));
  15. }
  16. } else {
  17. register_error(elgg_echo('entity:delete:fail', array($guid)));
  18. }
  19. forward(REFERER);