From 0f358045ecba1b04a74c198514796fc1dda81d9e Mon Sep 17 00:00:00 2001 From: marcus Date: Tue, 15 Jul 2008 11:06:34 +0000 Subject: Closes #140 git-svn-id: https://code.elgg.org/elgg/trunk@1424 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/river/ElggRelationship/create.php | 15 ++--- views/default/river/wrapper.php | 74 +++++++++++++------------ 2 files changed, 47 insertions(+), 42 deletions(-) (limited to 'views/default') diff --git a/views/default/river/ElggRelationship/create.php b/views/default/river/ElggRelationship/create.php index 27c0a8e9e..9033ee0da 100644 --- a/views/default/river/ElggRelationship/create.php +++ b/views/default/river/ElggRelationship/create.php @@ -10,21 +10,22 @@ * @link http://elgg.com/ */ - $performed_by = $vars['performed_by']; - $log_entry = $vars['log_entry']; - $object = $vars['entity']; + $statement = $vars['statement']; - // Find out what type of relationship we're dealing with (will only display a few) - if ($object instanceof ElggRelationship) + $performed_by = $statement->getSubject(); + $event = $statement->getEvent(); + $object = $statement->getObject(); + + if (is_array($object)) { - switch ($object->relationship) + 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); + $userb = $object['object']; // Only users can be friends if (($performed_by instanceof ElggUser) && ($userb instanceof ElggUser)) diff --git a/views/default/river/wrapper.php b/views/default/river/wrapper.php index 0a38b1ac0..fe5c961d5 100644 --- a/views/default/river/wrapper.php +++ b/views/default/river/wrapper.php @@ -10,38 +10,42 @@ * @copyright Curverider Ltd 2008 * @link http://elgg.com/ */ - - if (isset($vars['entity']) && $vars['entity'] instanceof ElggEntity) { - - $subtype = $vars['entity']->getSubtype(); - if (empty($subtype)) $subtype = $vars['entity']->type; - if (empty($subtype)) $subtype = "general"; - - } else if ($vars['log']->object_class == "ElggRelationship") { - $subtype = "relationship_" . $vars['entity']->relationship; - } - -?> - -
- -
-
-

- - - (time_created); - - ?>) - -

-
-
- -
\ No newline at end of file + + $statement = $vars['statement']; + $time = $vars['time']; + $event = $vars['event']; + $entry = $vars['entry']; + + if ($statement->getObject() instanceof ElggEntity) { + + $obj = $statement->getObject(); + $subtype = $obj->getSubtype(); + if (empty($subtype)) $subtype = $obj->type; + if (empty($subtype)) $subtype = "general"; + } else if (is_array($statement->getObject())) { + $obj = $statement->getObject(); + $subtype = "relationship_" . $obj['relationship']; + } +?> +
+ +
+
+

+ + + () + +

+
+
+ +
-- cgit v1.2.3