aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/widgets.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-22 21:11:36 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-22 21:11:36 +0000
commitd45a24be28b2eb2d0c2731708b589788a5b87215 (patch)
treed73568e65b05c42cc23b8c355a80907684be2cb5 /engine/lib/widgets.php
parent46c278c3603765b623fa441e2435274fbeda05ad (diff)
downloadelgg-d45a24be28b2eb2d0c2731708b589788a5b87215.tar.gz
elgg-d45a24be28b2eb2d0c2731708b589788a5b87215.tar.bz2
Merged r6671:6683 from 1.7 branch to trunk
git-svn-id: http://code.elgg.org/elgg/trunk@6847 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/widgets.php')
-rw-r--r--engine/lib/widgets.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php
index 7884f263a..1862ef7e4 100644
--- a/engine/lib/widgets.php
+++ b/engine/lib/widgets.php
@@ -201,9 +201,9 @@ function display_widget(ElggObject $widget) {
}
/**
- * Add a new widget
+ * Add a new widget instance
*
- * @param int $user_guid User GUID to associate this widget with
+ * @param int $entity_guid GUID of entity that owns this widget
* @param string $handler The handler for this widget
* @param string $context The page context for this widget
* @param int $order The order to display this widget in
@@ -211,15 +211,15 @@ function display_widget(ElggObject $widget) {
* @param int $access_id If not specified, it is set to the default access level
* @return true|false Depending on success
*/
-function add_widget($user_guid, $handler, $context, $order = 0, $column = 1, $access_id = null) {
- if (empty($user_guid) || empty($context) || empty($handler) || !widget_type_exists($handler)) {
+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)) {
return false;
}
- if ($user = get_user($user_guid)) {
+ if ($entity = get_entity($entity_guid)) {
$widget = new ElggWidget;
- $widget->owner_guid = $user_guid;
- $widget->container_guid = $user_guid;
+ $widget->owner_guid = $entity_guid;
+ $widget->container_guid = $entity_guid;
if (isset($access_id)) {
$widget->access_id = $access_id;
} else {
@@ -237,7 +237,6 @@ function add_widget($user_guid, $handler, $context, $order = 0, $column = 1, $ac
// save_widget_location($widget, $order, $column);
return true;
-
}
return false;