diff options
author | cash <cash.costello@gmail.com> | 2011-12-03 15:42:40 -0500 |
---|---|---|
committer | cash <cash.costello@gmail.com> | 2011-12-03 15:42:40 -0500 |
commit | 092197523f135b1aec3de8ff50df0dcf724c8094 (patch) | |
tree | a58f96da95f9349e2cbae13be3bc144944aee343 /views/default/river/object/tidypics_batch | |
parent | 5e7ea5369519949ea6dc7954a61f4d4eba29b0d0 (diff) | |
download | elgg-092197523f135b1aec3de8ff50df0dcf724c8094.tar.gz elgg-092197523f135b1aec3de8ff50df0dcf724c8094.tar.bz2 |
river finished up for image, batch, album
Diffstat (limited to 'views/default/river/object/tidypics_batch')
-rw-r--r-- | views/default/river/object/tidypics_batch/create.php | 79 |
1 files changed, 39 insertions, 40 deletions
diff --git a/views/default/river/object/tidypics_batch/create.php b/views/default/river/object/tidypics_batch/create.php index e7a4d1409..1dfce6925 100644 --- a/views/default/river/object/tidypics_batch/create.php +++ b/views/default/river/object/tidypics_batch/create.php @@ -1,51 +1,50 @@ <?php +/** + * Batch river view + */ -$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; -} +$batch = $vars['item']->getObjectEntity(); // 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\">"; + 'relationship' => 'belongs_to_batch', + 'relationship_guid' => $batch->getGUID(), + 'inverse_relationship' => true, + 'type' => 'object', + 'subtype' => 'image', + 'offset' => 0, +)); + +$album = $batch->getContainerEntity(); +$album_link = elgg_view('output/url', array( + 'href' => $album->getURL(), + 'text' => $album->getTitle(), + 'is_trusted' => true, +)); + +$subject = $vars['item']->getSubjectEntity(); +$subject_link = elgg_view('output/url', array( + 'href' => $subject->getURL(), + 'text' => $subject->name, + 'class' => 'elgg-river-subject', + 'is_trusted' => true, +)); if (count($images)) { + $attachments = '<ul class="tidypics-river-list">'; 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>'; + $attachments .= '<li class="tidypics-photo-item">'; + $attachments .= elgg_view('output/img', array( + 'src' => $image->getSrcUrl('thumb'), + 'class' => 'elgg-photo', + )); + $attachments .= '</li>'; } + $attachments .= '</ul>'; } -$string .= "</div>"; - -echo $string; +echo elgg_view('river/elements/layout', array( + 'item' => $vars['item'], + 'attachments' => $attachments, + 'summary' => elgg_echo('image:river:created:multiple', array($subject_link, count($images), $album_link)), +)); |