aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-18 16:13:34 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-18 16:13:34 +0000
commitc5854870424d87372bcc86a7edf75b9bf8841825 (patch)
tree99dc5d53e82ba6decf27846e574ac9826f5743b2 /engine
parent522fccf9ed173e3a5a68b3a616a3b7e1961bc22b (diff)
downloadelgg-c5854870424d87372bcc86a7edf75b9bf8841825.tar.gz
elgg-c5854870424d87372bcc86a7edf75b9bf8841825.tar.bz2
Refs #1793 added ability to add widgets to layout through ajax
git-svn-id: http://code.elgg.org/elgg/trunk@7338 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/widgets.php9
1 files changed, 2 insertions, 7 deletions
diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php
index 1de114833..79a3b37bf 100644
--- a/engine/lib/widgets.php
+++ b/engine/lib/widgets.php
@@ -176,7 +176,7 @@ function display_widget(ElggObject $widget) {
* @param int $column The column to display this widget in (1, 2 or 3)
* @param int $access_id If not specified, it is set to the default access level
*
- * @return bool Depending on success
+ * @return int|false Widget GUID or false on failure
*/
function add_widget($entity_guid, $handler, $context, $order = 0, $column = 1, $access_id = null) {
if (empty($entity_guid) || empty($context) || empty($handler) || !widget_type_exists($handler)) {
@@ -193,17 +193,12 @@ function add_widget($entity_guid, $handler, $context, $order = 0, $column = 1, $
$widget->access_id = get_default_access();
}
- if (!$widget->save()) {
- return false;
- }
-
$widget->handler = $handler;
$widget->context = $context;
$widget->column = $column;
$widget->order = $order;
- // save_widget_location($widget, $order, $column);
- return true;
+ return $widget->save();
}
return false;