aboutsummaryrefslogtreecommitdiff
path: root/actions/widgets/delete.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-19 19:11:03 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-19 19:11:03 +0000
commitf42382e0bff1692e2ddcd1c8eb316836e3020f1e (patch)
treebd11cb29bbae69f0daff3c0cd9c273203c788dc9 /actions/widgets/delete.php
parentb70654070d83323853f808beccc6780cfcd51ce4 (diff)
downloadelgg-f42382e0bff1692e2ddcd1c8eb316836e3020f1e.tar.gz
elgg-f42382e0bff1692e2ddcd1c8eb316836e3020f1e.tar.bz2
users can delete widgets from layout
git-svn-id: http://code.elgg.org/elgg/trunk@7349 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions/widgets/delete.php')
-rw-r--r--actions/widgets/delete.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/actions/widgets/delete.php b/actions/widgets/delete.php
new file mode 100644
index 000000000..167324b0c
--- /dev/null
+++ b/actions/widgets/delete.php
@@ -0,0 +1,19 @@
+<?php
+/**
+ * Elgg widget delete action
+ *
+ * @package Elgg.Core
+ * @subpackage Widgets.Management
+ */
+
+$guid = get_input('guid');
+
+$user = get_loggedin_user();
+
+$widget = get_entity($guid);
+if ($widget && $user->canEdit() && $widget->delete()) {
+ forward(REFERER);
+}
+
+register_error(elgg_echo('widgets:remove:failure'));
+forward(REFERER);