create.php 1022 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Album river view
  4. *
  5. * @author Cash Costello
  6. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
  7. */
  8. $album = $vars['item']->getObjectEntity();
  9. $album_river_view = elgg_get_plugin_setting('album_river_view', 'tidypics');
  10. if ($album_river_view == "set") {
  11. $images = $album->getImages(7);
  12. if (count($images)) {
  13. $attachments = '<ul class="tidypics-river-list">';
  14. foreach($images as $image) {
  15. $attachments .= '<li class="tidypics-photo-item">';
  16. $attachments .= elgg_view_entity_icon($image, 'tiny');
  17. $attachments .= '</li>';
  18. }
  19. $attachments .= '</ul>';
  20. }
  21. } else {
  22. $image = $album->getCoverImage();
  23. if ($image) {
  24. $attachments = elgg_view_entity_icon($image, 'tiny');
  25. }
  26. }
  27. echo elgg_view('river/elements/layout', array(
  28. 'item' => $vars['item'],
  29. 'attachments' => $attachments,
  30. ));