diff options
author | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-10 16:32:05 +0000 |
---|---|---|
committer | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-10 16:32:05 +0000 |
commit | 9456cf380a51d4863dd0ee96499763bb32f54284 (patch) | |
tree | 510773dbfd611deb6c399958e728f735d16a2ed2 /mod/riverdashboard/views/default/river/relationship | |
parent | 90c80171f9f089b4f2448c496e72d33432b5d724 (diff) | |
download | elgg-9456cf380a51d4863dd0ee96499763bb32f54284.tar.gz elgg-9456cf380a51d4863dd0ee96499763bb32f54284.tar.bz2 |
the beginnings of a new activity river with ajax notification and conversation clustering.
git-svn-id: http://code.elgg.org/elgg/trunk@5344 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/riverdashboard/views/default/river/relationship')
-rw-r--r-- | mod/riverdashboard/views/default/river/relationship/friend/create.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/mod/riverdashboard/views/default/river/relationship/friend/create.php b/mod/riverdashboard/views/default/river/relationship/friend/create.php new file mode 100644 index 000000000..916efd407 --- /dev/null +++ b/mod/riverdashboard/views/default/river/relationship/friend/create.php @@ -0,0 +1,36 @@ +<?php +/** + * Elgg relationship create event. + * Display something in the river when a relationship is created. + */ + +$statement = $vars['statement']; + +$performed_by = $statement->getSubject(); +$event = $statement->getEvent(); +$object = $statement->getObject(); + +if (is_array($object)) { + switch ($object['relationship']) { + // Friending + case 'friend' : + case 'friends' : // 'friends' shouldn't be used, but just incase :) + + // Get second object + $userb = $object['object']; + + // Only users can be friends + if (($performed_by instanceof ElggUser) && ($userb instanceof ElggUser)) { + // User A + echo "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a> "; + + // Verb + echo elgg_echo('river:relationship:friend'); + + // user B + echo " <a href=\"{$userb->getURL()}\">{$userb->name}</a>"; + } + + break; + } +}
\ No newline at end of file |