aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/views/default/profile/menu/friendlinks.php
blob: ce3af5a3ccbc4211c60c5922d0fbf742f6e1f186 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
/**
 * Elgg profile icon avatar menu: Add / Remove friend links
 * 
 * @package ElggProfile
 * 
 * @uses $vars['entity'] The user entity. If none specified, the current user is assumed. 
 */
$ts = time();
$token = generate_action_token($ts);
if ($vars['entity']->isFriend()) {
	echo elgg_view('output/confirmlink', array(
		'href' => "{$vars['url']}action/friends/remove?friend={$vars['entity']->getGUID()}",
		'text' => elgg_echo('friend:remove'),
		'class' => 'remove_friend'
	));
} else {
	echo elgg_view('output/confirmlink', array(
		'href' => "{$vars['url']}action/friends/add?friend={$vars['entity']->getGUID()}",
		'text' => elgg_echo('friend:add'),
		'class' => 'add_friend'
	));
}