diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-17 11:05:26 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-17 11:05:26 +0000 |
commit | 81150f406a14503ae5ff8198c153bc545c67b10c (patch) | |
tree | 7515799ab94015cc46ffc787ad037e1e124620bb /views/default/river/ElggRelationship/create.php | |
parent | bfeb658e58ce894b03fd9ba867bbf61b682f57f2 (diff) | |
download | elgg-81150f406a14503ae5ff8198c153bc545c67b10c.tar.gz elgg-81150f406a14503ae5ff8198c153bc545c67b10c.tar.bz2 |
CLOSED - #35: Create specific river views for dashboard
http://trac.elgg.org/elgg/ticket/35
git-svn-id: https://code.elgg.org/elgg/trunk@945 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/river/ElggRelationship/create.php')
-rw-r--r-- | views/default/river/ElggRelationship/create.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/views/default/river/ElggRelationship/create.php b/views/default/river/ElggRelationship/create.php new file mode 100644 index 000000000..95f27b512 --- /dev/null +++ b/views/default/river/ElggRelationship/create.php @@ -0,0 +1,46 @@ +<?php + /** + * Elgg relationship create event. + * Display something in the river when a relationship is created. + * + * @package Elgg + * @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['object']; + + // Find out what type of relationship we're dealing with (will only display a few) + if ($object instanceof ElggRelationship) + { + switch ($object->relationship) + { + // Friending + case 'friend' : + case 'friends' : // 'friends' shouldn't be used, but just incase :) + + // Get second object + $userb = get_entity($object->guid_two); + + // 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 |