]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
river finished up for image, batch, album
authorcash <cash.costello@gmail.com>
Sat, 3 Dec 2011 20:42:40 +0000 (15:42 -0500)
committercash <cash.costello@gmail.com>
Sat, 3 Dec 2011 20:42:40 +0000 (15:42 -0500)
languages/en.php
views/default/river/object/album/create.php
views/default/river/object/image/create.php
views/default/river/object/tidypics_batch/create.php
views/default/tidypics/css.php

index 40be85fd6f7a64840190b4898d4dc3a5b7adf17d..c701f98f43f501fcfbca051c28e436a7bc675f3a 100644 (file)
@@ -161,8 +161,9 @@ The photo can be viewed here: %s",
 
                //  river
                        'river:create:object:image' => "%s uploaded the photo %s",
+                       'river:create:object:tidypics_batch' => "%s uploaded some photos",
                        'image:river:created' => "%s added the photo %s to the album %s",
-                       'image:river:created:multiple' => "%s added %u photos to album %s",
+                       'image:river:created:multiple' => "%s added %u photos to the album %s",
                        'image:river:item' => "a photo",
                        'image:river:annotate' => "a comment on the photo",
                        'image:river:tagged' => "%s tagged %s in the photo %s",
index a60891ff8eaaa2abdabacdba22f7d36c2149d267..3f9c42d7aa5bff1554f4398ef443f9712f9fb659 100644 (file)
@@ -17,11 +17,12 @@ if ($album_river_view == "cover") {
        $images = $album->getImages(7);
 
        if (count($images)) {
-               $attachments = '<ul>';
+               $attachments = '<ul class="tidypics-river-list">';
                foreach($images as $image) {
-                       $attachments .= '<li>';
+                       $attachments .= '<li class="tidypics-photo-item">';
                        $attachments .= elgg_view('output/img', array(
                                'src' => $image->getSrcUrl('thumb'),
+                               'class' => 'elgg-photo',
                        ));
                        $attachments .= '</li>';
                }
index 0919561250929beb769a1ffd99102f375392f9ce..44efa0c594ba2d45eca3a372f6c3a32428755e4a 100644 (file)
@@ -14,6 +14,7 @@ $subject_link = elgg_view('output/url', array(
 $image = $vars['item']->getObjectEntity();
 $attachments = elgg_view('output/img', array(
        'src' => $image->getSrcUrl('thumb'),
+       'class' => 'elgg-photo',
 ));
 $image_link = elgg_view('output/url', array(
        'href' => $image->getURL(),
index e7a4d1409318f9fba005027ae177bb7be0cbf547..1dfce69253b4f9b32c879c14554d1a74eb3381e7 100644 (file)
@@ -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)),
+));
index 82594db0e87440611287f03448c8d90fc427912b..b95e24193393c0566a17287cabcfbce97d5f1018 100644 (file)
 }
 
 #tidypics-sort li {
-width:153px;
-height:153px;
+       width:153px;
+       height:153px;
+}
+
+.tidypics-river-list > li {
+       display: inline-block;
+}
+
+.tidypics-photo-item + .tidypics-photo-item {
+       margin-left: 7px;
 }