From 92ec25ec441330323e4fcbdfa33ebcf900420097 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 31 Oct 2010 12:47:25 +0000 Subject: integrated Jeff's batch code into trunk --- .../default/river/object/tidypics_batch/create.php | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 views/default/river/object/tidypics_batch/create.php (limited to 'views/default/river/object/tidypics_batch/create.php') diff --git a/views/default/river/object/tidypics_batch/create.php b/views/default/river/object/tidypics_batch/create.php new file mode 100644 index 000000000..e7a4d1409 --- /dev/null +++ b/views/default/river/object/tidypics_batch/create.php @@ -0,0 +1,51 @@ +subject_guid); +$batch = get_entity($vars['item']->object_guid); +$album = get_entity($batch->container_guid); + +if (!$batch || !$album) { + return true; +} + +// Get images related to this batch +$images = elgg_get_entities_from_relationship(array( + 'relationship' => 'belongs_to_batch', + 'relationship_guid' => $batch->getGUID(), + 'inverse_relationship' => true, + 'types' => array('object'), + 'subtypes' => array('image'), + 'offset' => 0, + )); + +// nothing to show +if (!$images) { + return true; +} + +$user_link = "getURL()}\">{$performed_by->name}"; +$album_link = "" . $album->title . ""; +if (count($images) > 1) { + $image_text = elgg_echo("image:river:created:multiple"); + $string = sprintf($image_text, $user_link, count($images), $album_link); +} else { + $image_text = elgg_echo("image:river:created"); + $title = $images[0]->title; + if (!$title) { + $title = elgg_echo("untitled"); + } + $image_link = "getURL() . "\">" . $title . ""; + $string = sprintf($image_text, $user_link, $image_link, $album_link); +} + +$string .= "
"; + +if (count($images)) { + foreach($images as $image) { + $string .= "getURL() . "\"> wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> '; + } +} + +$string .= "
"; + +echo $string; -- cgit v1.2.3