aboutsummaryrefslogtreecommitdiff
path: root/actions/widgets/move.php
blob: 2747c149fe5c14d6e6c0b27c2a4702290b7734c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
/**
 * Elgg widget move action
 *
 * @package Elgg.Core
 * @subpackage Widgets.Management
 */

$guid = get_input('guid');
$column = get_input('column', 1);
$position = get_input('position');

$user = get_loggedin_user();

$widget = get_entity($guid);
if ($widget && $user->canEdit()) {
	elgg_move_widget($widget, $widget->context, $column, $position);
	forward(REFERER);
}

register_error(elgg_echo('widgets:move:failure'));
forward(REFERER);