From c1e50bd0e460ef668b91f901fa7af28ee641b9fe Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 12 Mar 2011 14:06:23 +0000 Subject: improved documentation of can write to container method/function git-svn-id: http://code.elgg.org/elgg/trunk@8656 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggEntity.php | 2 +- engine/lib/entities.php | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'engine') diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php index bfb7ce063..248756b17 100644 --- a/engine/classes/ElggEntity.php +++ b/engine/classes/ElggEntity.php @@ -904,7 +904,7 @@ abstract class ElggEntity extends ElggData implements } /** - * Can a user write to this entity + * Can a user add an entity to this container * * @param int $user_guid The user. * @param string $type The type of entity we're looking to write diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 3bf3259e2..85ab527e7 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -416,7 +416,7 @@ function update_entity($guid, $owner_guid, $access_id, $container_guid = null) { } /** - * Determine if a given user is can write to an entity container. + * Determine if a given user can write to an entity container. * * An entity can be a container for any other entity by setting the * container_guid. container_guid can differ from owner_guid. @@ -424,7 +424,7 @@ function update_entity($guid, $owner_guid, $access_id, $container_guid = null) { * A plugin hook container_permissions_check:$entity_type is emitted to allow granular * access controls in plugins. * - * @param int $user_guid The user guid, or 0 for elgg_get_logged_in_user_guid() + * @param int $user_guid The user guid, or 0 for logged in user * @param int $container_guid The container, or 0 for the current page owner. * @param string $type The type of entity we're looking to write * @param string $subtype The subtype of the entity we're looking to write @@ -457,7 +457,7 @@ function can_write_to_container($user_guid = 0, $container_guid = 0, $type = 'al } // Basics, see if the user is a member of the group. - // @todo this should be moved to the groups plugin + // @todo this should be moved to the groups plugin/library if ($user && $container instanceof ElggGroup) { if (!$container->isMember($user)) { $return = FALSE; @@ -468,8 +468,15 @@ function can_write_to_container($user_guid = 0, $container_guid = 0, $type = 'al } // See if anyone else has anything to say - return elgg_trigger_plugin_hook('container_permissions_check', $type, - array('container' => $container, 'user' => $user, 'subtype' => $subtype), $return); + return elgg_trigger_plugin_hook( + 'container_permissions_check', + $type, + array( + 'container' => $container, + 'user' => $user, + 'subtype' => $subtype + ), + $return); } /** -- cgit v1.2.3