From b128ec82c4bd149beb6f4436b030e288ae75fb1d Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 17 Nov 2010 22:08:39 +0000 Subject: 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 --- engine/lib/widgets.php | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'engine/lib/widgets.php') 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); } @@ -479,6 +489,25 @@ function reorder_widgets_from_panel($panelstring1, $panelstring2, $panelstring3, return $return; } +/** + * 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 * -- cgit v1.2.3