aboutsummaryrefslogtreecommitdiff
path: root/views/default/widgets/friends/content.php
blob: f20f001946b49c087e6e38c11995357ef3e55492 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php

/**
 * Elgg Friends
 * Friend widget display view
 *
 * @package ElggFriends
 * @subpackage Core
 */


// owner of the widget
$owner = $vars['entity']->getOwnerEntity();

// the number of friends to display
$num = (int) $vars['entity']->num_display;

// get the correct size
$size = $vars['entity']->icon_size;

// Get the user's friends
if ($owner) {
	$friends = $owner->getFriends("", $num);
}
// If there are any friends to view, view them
if (is_array($friends) && sizeof($friends) > 0) {

	echo "<div id=\"widget_friends_list\">";

	foreach($friends as $friend) {
		echo "<div class=\"widget_friends_singlefriend\" >";
		echo elgg_view_entity_icon(get_user($friend->guid), $size);
		echo "</div>";
	}

	echo "</div>";
}