$friend = get_entity(sanitize_int(get_input("guid")));\r
\r
if(remove_entity_relationship($friend->guid, 'friendrequest', $user->guid)) {\r
- system_message(elgg_echo("friendrequest:decline:success", array($user->name)));\r
+ system_message(elgg_echo("friendrequest:decline:success", array($friend->name)));\r
} else {\r
system_message(elgg_echo("friendrequest:decline:fail"));\r
}\r
elgg_register_page_handler('friendrequests', 'friendrequest_page_handler');
if (elgg_is_logged_in()) {
+
+ $count = elgg_get_entities_from_relationship(array(
+ 'type' => 'user',
+ 'relationship' => 'friendrequest',
+ 'relationship_guid' => $page_owner->guid,
+ 'inverse_relationship' => true,
+ 'limit' => 0,
+ 'count' => true,
+ ));
+
$params = array(
'name' => 'friendrequests',
- 'text' => elgg_echo('friendrequest'),
+ 'text' => elgg_echo('friendrequest').($count? " ($count)": ""),
'href' => "friendrequests",
'contexts' => array('friends'),
);