aboutsummaryrefslogtreecommitdiff
path: root/actions/entities
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-04 15:03:03 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-04 15:03:03 +0000
commit43571d4d5381cc3e2a8ba3e05da6cb6982a1d960 (patch)
treeda27c4d097a784fa9cbfa410d57e0709e0c4afb7 /actions/entities
parent36f52b47f8dc996afcc889b1fd32fd23943103c5 (diff)
downloadelgg-43571d4d5381cc3e2a8ba3e05da6cb6982a1d960.tar.gz
elgg-43571d4d5381cc3e2a8ba3e05da6cb6982a1d960.tar.bz2
Fixes #199
git-svn-id: https://code.elgg.org/elgg/trunk@1682 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions/entities')
-rw-r--r--actions/entities/delete.php32
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