aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/widgets.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-17 22:08:39 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-17 22:08:39 +0000
commitb128ec82c4bd149beb6f4436b030e288ae75fb1d (patch)
tree7d63a7b8e473073c95bff122f006f28983e1ee21 /engine/lib/widgets.php
parentfc7f4e880ddfed812438fabc791c5f5056f541e6 (diff)
downloadelgg-b128ec82c4bd149beb6f4436b030e288ae75fb1d.tar.gz
elgg-b128ec82c4bd149beb6f4436b030e288ae75fb1d.tar.bz2
Refs #1793 - added a basic add new widgets view - it is not wired up yet
git-svn-id: http://code.elgg.org/elgg/trunk@7333 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/widgets.php')
-rw-r--r--engine/lib/widgets.php35
1 files changed, 32 insertions, 3 deletions
diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php
index e3ab07227..1de114833 100644
--- a/engine/lib/widgets.php
+++ b/engine/lib/widgets.php
@@ -146,13 +146,23 @@ function get_widgets($user_guid, $context, $column) {
}
/**
- * Displays a particular widget
+ * Get widgets for a particular context in order of display
*
- * @param ElggObject $widget The widget to display
+ * @param int $user_guid The owner user GUID
+ * @param string $context The context (profile, dashboard, etc)
*
- * @return string The HTML for the widget, including JavaScript wrapper
+ * @return array|false An array of widget ElggObjects, or false
+ */
+function elgg_get_widgets($user_guid, $context) {
+ // @todo implement elgg_get_entities_from_private_settings() first
+ return false;
+}
+
+/**
+ * @deprecated 1.8
*/
function display_widget(ElggObject $widget) {
+ elgg_deprecated_notice("display_widget() was been deprecated. Use elgg_view_entity().", 1.8);
return elgg_view_entity($widget);
}
@@ -480,6 +490,25 @@ function reorder_widgets_from_panel($panelstring1, $panelstring2, $panelstring3,
}
/**
+ * Can the user edit the widgets
+ *
+ * @param int $user_guid The GUID of the user or 0 for logged in user
+ * @return bool
+ */
+function elgg_can_edit_widgets($user_guid = 0) {
+ $return = false;
+ if (isadminloggedin()) {
+ $return = true;
+ }
+ if (elgg_get_page_owner_guid() == get_loggedin_userid()) {
+ $return = true;
+ }
+
+ // @todo add plugin hook
+ return $return;
+}
+
+/**
* Regsiter entity of object, widget as ElggWidget objects
*
* @return void