diff options
Diffstat (limited to 'actions')
-rw-r--r-- | actions/widgets/delete.php | 19 |
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); |