aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views/default/river/ElggRelationship/create.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/groups/views/default/river/ElggRelationship/create.php')
-rw-r--r--mod/groups/views/default/river/ElggRelationship/create.php40
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