48 'href' =>
'friends/' .
$owner->username,
49 'contexts' => array(
'friends')
54 'name' =>
'friends:of',
56 'href' =>
'friendsof/' .
$owner->username,
57 'contexts' => array(
'friends')
66 'href' =>
"friends/{$viewer->username}",
85 $isFriend =
$user->isFriend();
89 'name' =>
'remove_friend',
92 'section' =>
'action',
93 'item_class' => $isFriend ?
'' :
'hidden',
97 'name' =>
'add_friend',
100 'section' =>
'action',
101 'item_class' => $isFriend ?
'hidden' :
'',
152 if (isset($page_elements[0])) {
153 switch ($page_elements[0]) {
168 case 'pickercallback':
188 'name' =>
'friends:view:collections',
189 'text' =>
elgg_echo(
'friends:collections'),
190 'href' =>
"collections/owner/$user->username",
191 'contexts' => array(
'friends')
207 if (
$object->relationship !=
'friend') {
220 ), $user_two->language);
226 ), $user_two->language);
230 'action' =>
'add_friend',
231 'object' => $user_one,
232 'friend' => $user_two,
239 $events->registerHandler(
'init',
'system',
'_elgg_friends_init');
$object
These two snippets demonstrates triggering an event and how to register for that event.
elgg_view_icon($name, $vars=array())
View one of the icons.
elgg_is_logged_in()
Returns whether or not the user is currently logged in.
elgg_add_action_tokens_to_url($url, $html_encode=false)
Adds action tokens to URL.
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
elgg_view_resource($name, array $vars=[])
Render a resource view.
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
elgg_set_page_owner_guid($guid)
Set the guid of the entity that owns this page.
_elgg_friends_page_setup()
Register some menu items for friends UI private.
get_user_by_username($username)
Get user by username.
_elgg_collections_page_handler($page_elements)
Page handler for friends collections.
_elgg_friends_init()
Init friends library.
_elgg_friends_page_handler($segments, $handler)
Page handler for friends-related pages.
elgg_set_context($context)
Sets the page context.
notify_user($to, $from=0, $subject= '', $message= '', array $params=array(), $methods_override=null)
Notify a user via their preferences.
elgg echo
Translates a string.
elgg_register_page_handler($identifier, $function)
Registers a page handler for a particular identifier.
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
_elgg_send_friend_notification($event, $type, $object)
Notify user that someone has friended them.
elgg_register_menu_item($menu_name, $menu_item)
Register an item for an Elgg menu.
_elgg_friends_setup_user_hover_menu($hook, $type, $return, $params)
Adds friending to user hover menu.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
elgg_register_action($action, $filename="", $access= 'logged_in')
Registers an action.
_elgg_setup_collections_menu()
Adds collection sidebar menu items.
elgg_get_page_owner_guid($guid=0)
Gets the guid of the entity that owns the current page.
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.
get_entity($guid)
Loads and returns an entity object from a guid.