aboutsummaryrefslogtreecommitdiff
path: root/views/default/profile/hover.php
blob: 85d6912ba1bb2b244a639293680b1fa291e4e27e (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
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php


$user = $vars['entity'];
$username = $vars['username'];
$name = $vars['name'];

?>

<div class="avatar_menu_button"><img src="<?php echo elgg_get_site_url(); ?>_graphics/spacer.gif" border="0" width="15" height="15" /></div>
<div class="sub_menu">
	<h3 class="displayname">
		<a href="<?php echo $user->getURL(); ?>">
			<?php echo $name; ?>
			<span class="username">
				<?php echo "&#64;" . $username; ?>
			</span>
		</a>
	</h3>
	<ul class='sub_menu_list'>
<?php
if (isloggedin()) {
	// if not looking at your own avatar menu
	if ($user->getGUID() != get_loggedin_userid()) {

		// Add / Remove friend link
		$friendlinks = elgg_view('profile/menu/friendlinks',$vars);
		if (!empty($friendlinks)) {
			echo "<li class='user_menu_profile'>{$friendlinks}</li>";
		}
		// view for plugins to extend
		echo elgg_view('profile/menu/links',$vars);
	} else {
		// if looking at your own avatar menu - provide a couple of handy links
?>
		<li class="user_menu_profile">
			<a class="edit_profile" href="<?php echo elgg_get_site_url()?>pg/profile/<?php echo $username; ?>/edit/details">
				<?php echo elgg_echo("profile:edit"); ?>
			</a>
		</li>
		<li class="user_menu_profile">
			<a class="edit_avatar" href="<?php echo elgg_get_site_url()?>pg/profile/<?php echo $username; ?>/edit/icon">
				<?php echo elgg_echo("profile:editicon"); ?>
			</a>
		</li>
<?php
	}

	// if Admin is logged in, and not looking at admins own avatar menu
	if (isadminloggedin() && get_loggedin_userid() != $user->guid) {
		$params = array(
			'user' => $user,
			'sort_by' => 'order',
		);
		$admin_links = elgg_view_menu('user_admin', $params);
		if (!empty($admin_links)) {
			echo "<li class='user_menu_admin'>{$admin_links}</li>";
		}
	}
}
?>
	</ul>
</div>