aboutsummaryrefslogtreecommitdiff
path: root/views/default/user/default.php
blob: 7106e6016144378bc35034a037ceae5cc59b1e13 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
 * Elgg user display
 *
 * @package Elgg
 * @subpackage Core
 */

$user = $vars['entity'];

$icon = elgg_view_entity_icon($user, 'tiny');

// Simple XFN
$rel = '';
if (elgg_get_logged_in_user_guid() == $user->guid) {
	$rel = 'rel="me"';
} elseif (check_entity_relationship(elgg_get_logged_in_user_guid(), 'friend', $user->guid)) {
	$rel = 'rel="friend"';
}

$title = "<a href=\"" . $user->getUrl() . "\" $rel>" . $user->name . "</a>";


$metadata = "<ul class=\"elgg-menu elgg-menu-metadata\"><li>$user->location</li>";
$metadata .= elgg_view("entity/metadata", array('entity' => $user));
$metadata .= "</ul>";

if (elgg_in_context('owner_block') || elgg_in_context('widgets')) {
	$metadata = '';
}

if ($user->isBanned()) {
	$params = array(
		'entity' => $user,
		'title' => $title,
		'metadata' => '<ul class="elgg-menu elgg-menu-metadata"><li>banned</li></ul>',
	);
} else {
	$params = array(
		'entity' => $user,
		'title' => $title,
		'metadata' => $metadata,
		'subtitle' => $user->briefdescription,
		'content' => elgg_view('user/status', array('entity' => $user)),
	);
}

$list_body = elgg_view('page/components/list/body', $params);

echo elgg_view_image_block($icon, $list_body);