From 4dc9076224a0d93f0dc078124aa9fb94a669f16c Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 19 Nov 2010 03:28:41 +0000 Subject: saving widget position after moving git-svn-id: http://code.elgg.org/elgg/trunk@7343 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/widgets/add.php | 4 ++-- actions/widgets/move.php | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 actions/widgets/move.php (limited to 'actions/widgets') diff --git a/actions/widgets/add.php b/actions/widgets/add.php index 78f73e267..33a818e54 100644 --- a/actions/widgets/add.php +++ b/actions/widgets/add.php @@ -15,10 +15,10 @@ $guid = false; if (!empty($user_guid)) { $user = get_entity($user_guid); if ($user && $user->canEdit()) { - $guid = elgg_add_widget($user->getGUID(), $handler); + $guid = elgg_create_widget($user->getGUID(), $handler); if ($guid) { $widget = get_entity($guid); - elgg_prepend_widget($widget, $context, $column); + elgg_move_widget($widget, $context, $column, 0); // send widget html for insertion echo elgg_view_entity($widget); diff --git a/actions/widgets/move.php b/actions/widgets/move.php new file mode 100644 index 000000000..2747c149f --- /dev/null +++ b/actions/widgets/move.php @@ -0,0 +1,22 @@ +canEdit()) { + elgg_move_widget($widget, $widget->context, $column, $position); + forward(REFERER); +} + +register_error(elgg_echo('widgets:move:failure')); +forward(REFERER); \ No newline at end of file -- cgit v1.2.3