delete.php 436 B

1234567891011121314151617181920
  1. <?php
  2. /**
  3. * Elgg widget delete action
  4. *
  5. * @package Elgg.Core
  6. * @subpackage Widgets.Management
  7. */
  8. $widget = get_entity(get_input('widget_guid'));
  9. if ($widget) {
  10. $layout_owner_guid = $widget->getContainerGUID();
  11. elgg_set_page_owner_guid($layout_owner_guid);
  12. if (elgg_can_edit_widget_layout($widget->context) && $widget->delete()) {
  13. forward(REFERER);
  14. }
  15. }
  16. register_error(elgg_echo('widgets:remove:failure'));
  17. forward(REFERER);