aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/views/default/profile/icon.php
blob: 21e4c8e0ea7008241cdee0d203737faf72e285db (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php

	/**
	 * Elgg profile icon
	 * 
	 * @package ElggProfile
	 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
	 * @author Ben Werdmuller <ben@curverider.co.uk>
	 * @copyright Curverider Ltd 2008
	 * @link http://elgg.com/
	 * 
	 * @uses $vars['entity'] The user entity. If none specified, the current user is assumed.
	 * @uses $vars['size'] The size - small, medium or large. If none specified, medium is assumed. 
	 */

	// Get entity
		if (empty($vars['entity']))
			$vars['entity'] = $vars['user'];

		$name = htmlentities($vars['entity']->name);
		$username = $vars['entity']->username;
		
		if ($icontime = $vars['entity']->icontime) {
			$icontime = "{$icontime}";
		} else {
			$icontime = "default";
		}
			
	// Get size
		if (!in_array($vars['size'],array('small','medium','large','tiny','master')))
			$vars['size'] = "medium";
			
	// Get any align and js
		if (!empty($vars['align'])) {
			$align = " align=\"{$vars['align']}\" ";
		} else {
			$align = "";
		}
		
	// Get the hoverover menu
		$hoverover = elgg_view('profile/hoverover',$vars);
		$hoverover = htmlentities($hoverover);
		$hoverover = str_replace("\n","",$hoverover);
		$hoverover = str_replace("\r","",$hoverover);
		$hoverover = str_replace("\t","",$hoverover);
			
?>

<div class="usericon">
<div class="avatar_menu_button"><img src="<?php echo $vars['url']; ?>_graphics/avatar_menu_arrow.gif" width="15" height="15" class="arrow" /></div>

	<div class="sub_menu">
		<a href="<?php echo $vars['entity']->getURL(); ?>"><h3><?php echo $vars['entity']->name; ?></h3></a>
<!-- <a href="#" class="item_line">Remove friend</a>
		<a href="#">Friends</a>
		<a href="#">Friends of</a>

		<a href="#" class="item_line">Recent activity</a>
		<a href="#">Visit blog</a>
		<a href="#" class="item_line">Send private message</a>
		<a href="#" class="item_line">Ban</a>
		<a href="#">Edit</a>
		<a href="#">Report</a> -->
		<?php

			$links = elgg_view('profile/menu/actions',$vars);
			if ($vars['entity']->getGUID() == $vars['user']->getGUID()) {
				$links .= elgg_view('profile/menu/linksownpage',$vars);
			} else {
				$links .= elgg_view('profile/menu/links',$vars);
			}
			
			$links = preg_replace('/\<p.*\>/','',$links);
			$links = preg_replace('/\<\/p.*\>/','',$links);
			
			echo $links;
		
		?>

	</div>	
	<a href="<?php echo $vars['entity']->getURL(); ?>" class="icon" rel="<?php echo $hoverover; ?>"><img src="<?php echo $vars['url']; ?>pg/icon/<?php echo $username; ?>/<?php echo $vars['size']; ?>/<?php echo $icontime; ?>.jpg" border="0" <?php echo $align; ?> title="<?php echo $name; ?>" <?php echo $vars['js']; ?> /></a>
</div>