From 373ff03a2b6315eea13a97065774972ad3713ab6 Mon Sep 17 00:00:00 2001 From: brettp Date: Sat, 19 Feb 2011 02:12:32 +0000 Subject: Fixes #2753: Default widgets merged into core as extensible admin section and updated to work with new widgets. Will need an upgrade for users running the old default widgets in 1.7. git-svn-id: http://code.elgg.org/elgg/trunk@8302 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/widgets/add.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'actions/widgets/add.php') diff --git a/actions/widgets/add.php b/actions/widgets/add.php index 38686b36d..ac8983115 100644 --- a/actions/widgets/add.php +++ b/actions/widgets/add.php @@ -6,18 +6,22 @@ * @subpackage Widgets.Management */ -$user_guid = get_input('user_guid'); +$owner_guid = get_input('owner_guid'); $handler = get_input('handler'); $context = get_input('context'); $column = get_input('column', 1); +$default_widgets = get_input('default_widgets', 0); elgg_push_context($context); +if ($default_widgets) { + elgg_push_context('default_widgets'); +} elgg_push_context('widgets'); -if (!empty($user_guid)) { - $user = get_entity($user_guid); - if ($user && $user->canEdit()) { - $guid = elgg_create_widget($user->getGUID(), $handler, $context); +if (!empty($owner_guid)) { + $owner = get_entity($owner_guid); + if ($owner && $owner->canEdit()) { + $guid = elgg_create_widget($owner->getGUID(), $handler, $context); if ($guid) { $widget = get_entity($guid); -- cgit v1.2.3