move.php 516 B

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