From f84af9231b1038f56c98a6f0bf7fb7a5fa2f042e Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 24 Jun 2008 10:44:46 +0000 Subject: River views now run off subtypes git-svn-id: https://code.elgg.org/elgg/trunk@1091 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/river.php | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/river.php b/engine/lib/river.php index 174b358ab..5a18fb34e 100644 --- a/engine/lib/river.php +++ b/engine/lib/river.php @@ -82,12 +82,25 @@ if (isset($by_user_obj) && $by_user_obj instanceof ElggUser) { } else { $by_user_obj = get_entity($log->performed_by_guid); - } - $tam = elgg_view("river/$class/$event", array( - 'performed_by' => $by_user_obj, - 'log_entry' => $log, - 'object' => $object - )); + } + if ($object instanceof ElggEntity) { + $subtype = $object->subtype; + } else { + $subtype = ""; + } + if (!empty($subtype) && elgg_view_exists("river/{$subtype}/event")) { + $tam = elgg_view("river/{$subtype}/$event", array( + 'performed_by' => $by_user_obj, + 'log_entry' => $log, + 'object' => $object + )); + } else { + $tam = elgg_view("river/$class/$event", array( + 'performed_by' => $by_user_obj, + 'log_entry' => $log, + 'object' => $object + )); + } if (!empty($tam)) { $tam = elgg_view("river/wrapper",array( -- cgit v1.2.3