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

$guid = get_input('guid');
$params = get_input('params');

$result = elgg_save_widget_settings($guid, $params);

if (!$result) {
	register_error(elgg_echo('widgets:save:failure'));
} else {
	// send back the widget contents
	$widget = get_entity($guid);
	$view = "widgets/$widget->handler/view";
	echo elgg_view($view, array('entity' => $widget));
}

forward(REFERER);