From c33a7b4847a5d1537dcc7272dc056bc64f3f1cb3 Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 4 Jun 2010 15:41:31 +0000 Subject: Merged r6349:6351 from 1.7 to trunk. git-svn-id: http://code.elgg.org/elgg/trunk@6357 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../views/default/widgets/a_users_groups/view.php | 77 +++++++++++----------- 1 file changed, 39 insertions(+), 38 deletions(-) (limited to 'mod/groups/views/default/widgets/a_users_groups') diff --git a/mod/groups/views/default/widgets/a_users_groups/view.php b/mod/groups/views/default/widgets/a_users_groups/view.php index f020e07c4..687ba7251 100644 --- a/mod/groups/views/default/widgets/a_users_groups/view.php +++ b/mod/groups/views/default/widgets/a_users_groups/view.php @@ -1,50 +1,51 @@ num_display; - if (!$number) - $number = 4; +//the number of groups to display +$number = (int) $vars['entity']->num_display; +if (!$number) { + $number = 4; +} - //the page owner - $owner = $vars['entity']->owner_guid; +//the page owner +$owner = $vars['entity']->owner_guid; - //$groups = get_users_membership($owner); - //$groups = list_entities_from_relationship('member',$owner,false,'group','',0,$number,false,false,false); +//$groups = get_users_membership($owner); +//$groups = list_entities_from_relationship('member',$owner,false,'group','',0,$number,false,false,false); +$groups = get_entities_from_relationship('member', $owner, false, "group", "", 0, "", $number, 0, false, 0); - $options = array( - 'relationship' => 'member', - 'relationship_guid' => $owner, - 'type' => 'group', - 'limit' => $number, - ); - $groups = elgg_get_entities_from_relationship($options); +if ($groups) { + echo "
"; - if($groups){ - - echo "
"; - - foreach($groups as $group){ - $icon = elgg_view( + foreach ($groups as $group) { + $icon = elgg_view( "groups/icon", array( - 'entity' => $group, - 'size' => 'small', - ) - ); - - echo "
" . $icon . "

" . $group->name . "
"; - echo $group->briefdescription . "

"; + 'entity' => $group, + 'size' => 'small', + ) + ); + + $group_link = $group->getURL(); + + echo <<<___END + +
+ $icon +
+

+ $group->name
+ $group->briefdescription +

+
+
+
+___END; - } - echo "
"; } - - -// echo $groups; - -?> \ No newline at end of file + echo "
"; +} -- cgit v1.2.3