]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Merged r6614:6617 from 1.7 branch into trunk
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 22 Aug 2010 19:04:55 +0000 (19:04 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 22 Aug 2010 19:04:55 +0000 (19:04 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6845 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/annotations.php
engine/lib/api.php
mod/file/start.php
mod/groups/views/default/forms/groups/invite.php
mod/groups/views/default/groups/groupprofile.php
mod/groups/views/default/sharing/invite.php [deleted file]

index ac002f394cf8b9c80469d18389e46b09322bd204..0bb29c408f713bc0fc9d0d3893e6eb2599aed32e 100644 (file)
@@ -564,6 +564,8 @@ $timelower = 0, $timeupper = 0) {
 function list_entities_from_annotations($entity_type = "", $entity_subtype = "", $name = "", $value = "", $limit = 10, $owner_guid = 0, $group_guid = 0, $asc = false, $fullview = true, $viewtypetoggle = false) {
        elgg_deprecated_notice('list_entities_from_annotations is deprecated by elgg_list_entities_from_annotations', 1.8);
 
+       $options = array();
+       
        if ($entity_type) {
                $options['types'] = $entity_type;
        }
index 0da0c82f0343ef958ed70a4749e3a6ace76b2b66..a3869d262637516f893d068b1d4729b26f7698a0 100644 (file)
@@ -290,9 +290,10 @@ class ElggHMACCache extends ElggCache {
  *                     "description" => "Some human readable description"
  *                     "function" = 'my_function_callback'
  *                     "parameters" = array (
- *                             "variable" = array ( // NB, the order should be the same as the function callback
+ *                             "variable" = array ( // the order should be the same as the function callback
  *                                     type => 'int' | 'bool' | 'float' | 'string'
  *                                     required => true (default) | false
+ *                                     default => value // optional
  *                             )
  *                     )
  *                     "call_method" = 'GET' | 'POST'
@@ -313,7 +314,7 @@ $API_METHODS = array();
  * @param string $method The api name to expose - for example "myapi.dosomething"
  * @param string $function Your function callback.
  * @param array $parameters (optional) List of parameters in the same order as in your function.
- * Default values may be set for parameters which would allow REST api users flexibility in
+ * Default values may be set for parameters which allow REST api users flexibility in
  * what parameters are passed. Generally, optional parameters should be after required parameters.
  * This array should be in the format
  *   "variable" = array (
index 06f64fddf89aa12129ae2a4342ed777911cd72a3..e8e70e6cde1bc05c3e8b0dc364e55cb70f7282a6 100644 (file)
                } else {
                        $friendofguid = false;
                }
-               return elgg_view('file/typecloud',array('owner_guid' => $owner_guid, 'friend_guid' => $friendofguid, 'types' => get_tags(0,10,'simpletype','object','file',$owner_guid)));
 
+               elgg_register_tag_metadata_name('simpletype');
+               $types = get_tags(0,10,'simpletype','object','file',$owner_guid);
+
+               return elgg_view('file/typecloud',array('owner_guid' => $owner_guid, 'friend_guid' => $friendofguid, 'types' => $types));
        }
        
        /**
index 11c7fcbdf5bbff044a9745e2901bee8aa709f64e..6fd418cb915cd7b168fd8310a5c2fe76ed6e9b8a 100644 (file)
        $group = $vars['entity'];
        $owner = get_entity($vars['entity']->owner_guid);
        $forward_url = $group->getURL();
-       $options = array(
-               'relationship' => 'friend',
-               'relationship_guid' => get_loggedin_user()->guid,
-               'type' => 'user',
-               'limit' => 9999
-       );
-       $friends = elgg_get_entities_from_relationship($options);
+       $friends = get_loggedin_user()->getFriends('', 0);
+
 if ($friends) {
 ?>
 <form action="<?php echo $vars['url']; ?>action/groups/invite" method="post" id="invite_to_group" class="margin_top">
 
-       <?php
+<?php
        echo elgg_view('input/securitytoken');
 
        echo elgg_view('friends/picker',array('entities' => $friends, 'internalname' => 'user_guid', 'highlight' => 'all'));
-
-       ?>
+?>
        <input type="hidden" name="forward_url" value="<?php echo $forward_url; ?>" />
        <input type="hidden" name="group_guid" value="<?php echo $group->guid; ?>" />
        <input type="submit" value="<?php echo elgg_echo('invite'); ?>" />
index 13b244f88f9719e4f067502271d39082cd1ddd18..7ba24a4c74664b4a86cfc76c756854df201f96e1 100644 (file)
@@ -91,16 +91,7 @@ __HTML;
                                echo "<p><b>" . elgg_echo("groups:owner") . ": </b><a href=\"" . get_user($vars['entity']->owner_guid)->getURL() . "\">" . get_user($vars['entity']->owner_guid)->name . "</a></p>";
                        ?>
                        <p><?php
-                               $options = array(
-                                       'relationship' => 'member',
-                                       'relationship_guid' => $vars['entity']->guid,
-                                       'inverse_relationship' => TRUE,
-                                       'limit' => 0,
-                                       'count' => TRUE
-                               );
-
-                               $count = elgg_get_entities_from_relationship($options);
-
+                               $count = $vars['entity']->getMembers(0, 0, TRUE);
                                echo elgg_echo('groups:members') . ": " . $count;
 
                        ?></p>
diff --git a/mod/groups/views/default/sharing/invite.php b/mod/groups/views/default/sharing/invite.php
deleted file mode 100644 (file)
index bd8e7c8..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-       /**
-        * Elgg groups plugin
-        *
-        * @package ElggGroups
-        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
-        * @author Curverider Ltd
-        * @copyright Curverider Ltd 2008-2010
-        * @link http://elgg.com/
-        */
-
-       $owner = $vars['owner'];
-       $group = $vars['group'];
-
-       $options = array('relationship' => 'friend', 'relationship_guid' => $owner->getGUID(), 'type' => 'user');
-       if ($friends = elgg_get_entities_from_relationship($options)) {
-
-               foreach($friends as $friend) {
-
-                       if (!$group->isMember($friend))
-                       {
-                               $label = elgg_view("profile/icon",array('entity' => $friend, 'size' => 'tiny'));
-                               $label .= "{$friend->name}";
-                               $options[$label] = $friend->getGUID();
-                       }
-               }
-
-               if ($options)
-               {
-                       echo elgg_view('input/checkboxes',array(
-
-                               'internalname' => 'user_guid',
-                               'options' => $options,
-
-                       ));
-               }
-               else
-               {
-                       echo elgg_echo('groups:nofriends');
-               }
-       }
-?>
\ No newline at end of file