aboutsummaryrefslogtreecommitdiff
path: root/views/default/river
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2010-10-31 12:47:25 +0000
committerCash Costello <cash.costello@gmail.com>2010-10-31 12:47:25 +0000
commit92ec25ec441330323e4fcbdfa33ebcf900420097 (patch)
tree5516b59d4feced2cd7bc1b60f2b897ce42a63354 /views/default/river
parentf1b63cb2469bd332a20ed8f47109ab52f6381f4c (diff)
downloadelgg-92ec25ec441330323e4fcbdfa33ebcf900420097.tar.gz
elgg-92ec25ec441330323e4fcbdfa33ebcf900420097.tar.bz2
integrated Jeff's batch code into trunk
Diffstat (limited to 'views/default/river')
-rw-r--r--views/default/river/object/image/create.php2
-rw-r--r--views/default/river/object/tidypics_batch/create.php51
2 files changed, 52 insertions, 1 deletions
diff --git a/views/default/river/object/image/create.php b/views/default/river/object/image/create.php
index 8a0a8deff..9de043e91 100644
--- a/views/default/river/object/image/create.php
+++ b/views/default/river/object/image/create.php
@@ -5,7 +5,7 @@ $image = get_entity($vars['item']->object_guid);
if ($image->title) {
$title = $image->title;
} else {
- $title = "untitled";
+ $title = elgg_echo("untitled");
}
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
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 @@
+<?php
+
+$performed_by = get_entity($vars['item']->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 = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
+$album_link = "<a href='" . $album->getURL() . "'>" . $album->title . "</a>";
+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 = "<a href=\"" . $images[0]->getURL() . "\">" . $title . "</a>";
+ $string = sprintf($image_text, $user_link, $image_link, $album_link);
+}
+
+$string .= "<div class=\"river_content\">";
+
+if (count($images)) {
+ foreach($images as $image) {
+ $string .= "<a href=\"" . $image->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>';
+ }
+}
+
+$string .= "</div>";
+
+echo $string;