From 30caa93f4d668cad70c903d835c6d1b6a6f6953e Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 29 Dec 2010 20:25:16 +0000 Subject: Fixes #2221 - rewrite of rover functions has been completed with moving elgg_view_river_item() into the views library. The ugly C&P functions were moved into the riverdashboard plugin and new 1.7 style get/list functions were introduced git-svn-id: http://code.elgg.org/elgg/trunk@7755 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/river.php | 28 ---------------------------- engine/lib/views.php | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 28 deletions(-) (limited to 'engine') diff --git a/engine/lib/river.php b/engine/lib/river.php index 50f0c9ac0..f098c0c9e 100644 --- a/engine/lib/river.php +++ b/engine/lib/river.php @@ -460,34 +460,6 @@ function elgg_river_get_action_where_sql($types) { return "(rv.action_type IN ('$type_str'))"; } -/** - * Returns a human-readable representation of a river item - * - * @param ElggRiverItem $item A river item object - * - * @return string|false Depending on success - */ -function elgg_view_river_item($item) { - if (!$item || !$item->getView() || !elgg_view_exists($item->getView())) { - return ''; - } - - $subject = $item->getSubjectEntity(); - $object = $item->getObjectEntity(); - if (!$subject || !$object) { - // subject is disabled or subject/object deleted - return ''; - } - - $vars = array( - 'image' => elgg_view('core/river/image', array('item' => $item)), - 'body' => elgg_view('core/river/body', array('item' => $item)), - 'image_alt' => elgg_view('core/river/controls', array('item' => $item)), - 'class' => 'elgg-river-item', - ); - return elgg_view('layout/objects/image_block', $vars); -} - /** * Sets the access ID on river items for a particular object * diff --git a/engine/lib/views.php b/engine/lib/views.php index 396eb7c12..eff5df394 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -1056,6 +1056,34 @@ function elgg_view_image_block($image, $body, $vars = array()) { return elgg_view('layout/objects/image_block', $vars); } +/** + * Returns a human-readable representation of a river item + * + * @param ElggRiverItem $item A river item object + * + * @return string|false Depending on success + */ +function elgg_view_river_item($item) { + if (!$item || !$item->getView() || !elgg_view_exists($item->getView())) { + return ''; + } + + $subject = $item->getSubjectEntity(); + $object = $item->getObjectEntity(); + if (!$subject || !$object) { + // subject is disabled or subject/object deleted + return ''; + } + + $vars = array( + 'image' => elgg_view('core/river/image', array('item' => $item)), + 'body' => elgg_view('core/river/body', array('item' => $item)), + 'image_alt' => elgg_view('core/river/controls', array('item' => $item)), + 'class' => 'elgg-river-item', + ); + return elgg_view('layout/objects/image_block', $vars); +} + /** * Wrapper function to display search listings. * -- cgit v1.2.3