]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
improved documentation of can write to container method/function
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 12 Mar 2011 14:06:23 +0000 (14:06 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 12 Mar 2011 14:06:23 +0000 (14:06 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8656 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggEntity.php
engine/lib/entities.php

index bfb7ce063d5fa6acdc3690771dd5dbc8a1c92179..248756b17439ecdf5caf945ec89d309138b3f105 100644 (file)
@@ -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
index 3bf3259e2ff1ae8a3db2870a2cfcbc24d6e5dbc6..85ab527e719c9cf65cd20b2366347350074f060b 100644 (file)
@@ -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);
 }
 
 /**