diff options
Diffstat (limited to 'actions')
-rw-r--r-- | actions/entities/delete.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/actions/entities/delete.php b/actions/entities/delete.php new file mode 100644 index 000000000..223e5557d --- /dev/null +++ b/actions/entities/delete.php @@ -0,0 +1,32 @@ +<?php + /** + * Default entity delete action + * + * @package Elgg + * @subpackage Core + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Marcus Povey + * @copyright Curverider Ltd 2008 + * @link http://elgg.org/ + */ + + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + + gatekeeper(); + + $guid = get_input('guid'); + + $entity = get_entity($guid); + + if (($entity) && ($entity->canEdit())) + { + if ($entity->delete()) + system_message(sprintf(elgg_echo('entity:delete:success'), $guid)); + else + register_error(sprintf(elgg_echo('entity:delete:fail'), $guid)); + } + else + register_error(sprintf(elgg_echo('entity:delete:fail'), $guid)); + + forward($_SERVER['HTTP_REFERER']); +?>
\ No newline at end of file |