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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
<?php
/**
* Elgg user display
*
* @uses $vars['entity'] ElggUser entity
* @uses $vars['size'] Size of the icon
*/
$entity = $vars['entity'];
$size = elgg_extract('size', $vars, 'tiny');
$icon = elgg_view_entity_icon($entity, $size, $vars);
// Simple XFN
$rel = '';
if (elgg_get_logged_in_user_guid() == $entity->guid) {
$rel = 'rel="me"';
} elseif (check_entity_relationship(elgg_get_logged_in_user_guid(), 'friend', $entity->guid)) {
$rel = 'rel="friend"';
}
$title = "<a href=\"" . $entity->getUrl() . "\" $rel>" . $entity->name . "</a>";
$metadata = elgg_view_menu('entity', array(
'entity' => $entity,
'sort_by' => 'priority',
'class' => 'elgg-menu-hz',
));
if (elgg_in_context('owner_block') || elgg_in_context('widgets')) {
$metadata = '';
}
if (elgg_get_context() == 'gallery') {
echo $icon;
} else {
if ($entity->isBanned()) {
$banned = elgg_echo('banned');
$params = array(
'entity' => $entity,
'title' => $title,
'metadata' => $metadata,
);
} else {
$params = array(
'entity' => $entity,
'title' => $title,
'metadata' => $metadata,
'subtitle' => $entity->briefdescription,
'content' => elgg_view('user/status', array('entity' => $entity)),
);
}
$list_body = elgg_view('user/elements/summary', $params);
echo elgg_view_image_block($icon, $list_body);
}
|