diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-04 12:53:03 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-04 12:53:03 +0000 |
commit | f783b09dc80ee4ee2af8749e6cf8cf62923b07e2 (patch) | |
tree | 40833b5d331d4ca2a56e108a32e12e75bc89995a /mod/groups/views/default/river/ElggRelationship | |
parent | 9c9f2fcbb744bf8a50299676dc70efc7cb4787e8 (diff) | |
download | elgg-f783b09dc80ee4ee2af8749e6cf8cf62923b07e2.tar.gz elgg-f783b09dc80ee4ee2af8749e6cf8cf62923b07e2.tar.bz2 |
Refs #109: River functionality
git-svn-id: https://code.elgg.org/elgg/trunk@1291 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/views/default/river/ElggRelationship')
-rw-r--r-- | mod/groups/views/default/river/ElggRelationship/create.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/mod/groups/views/default/river/ElggRelationship/create.php b/mod/groups/views/default/river/ElggRelationship/create.php new file mode 100644 index 000000000..b302097bc --- /dev/null +++ b/mod/groups/views/default/river/ElggRelationship/create.php @@ -0,0 +1,40 @@ +<?php + /** + * Elgg relationship create event for groups + * Display something in the river when a group is joined + * + * @package ElggGroups + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Marcus Povey + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ + + $performed_by = $vars['performed_by']; + $log_entry = $vars['log_entry']; + $object = $vars['entity']; + + // Find out what type of relationship we're dealing with (will only display a few) + if ($object instanceof ElggRelationship) + { + + switch ($object->relationship) + { + // Friending + case 'member' : + + $user = get_entity($object->guid_one); + $group = get_entity($object->guid_two); + + if (($user instanceof ElggUser) && ($group instanceof ElggGroup)) + { + echo "<a href=\"{$user->getURL()}\">{$user->name}</a> "; + echo elgg_echo("groups:river:member"); + echo " '<a href=\"{$group->getURL()}\">{$group->title}</a>'"; + } + + break; + } + } + +?>
\ No newline at end of file |