aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-24 10:44:46 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-24 10:44:46 +0000
commitf84af9231b1038f56c98a6f0bf7fb7a5fa2f042e (patch)
tree8950eb5fc7e6d66ee7c45cdbfd923315bcc7ebb6 /engine
parentecbb7357f3cedc48ce02d1074287c56d4e8ccd5a (diff)
downloadelgg-f84af9231b1038f56c98a6f0bf7fb7a5fa2f042e.tar.gz
elgg-f84af9231b1038f56c98a6f0bf7fb7a5fa2f042e.tar.bz2
River views now run off subtypes
git-svn-id: https://code.elgg.org/elgg/trunk@1091 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/river.php25
1 files changed, 19 insertions, 6 deletions
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(