album.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Post comment on album river view
  4. */
  5. $item = $vars['item'];
  6. $comment = $item->getObjectEntity();
  7. $subject = $item->getSubjectEntity();
  8. $target = $item->getTargetEntity();
  9. $subject_link = elgg_view('output/url', array(
  10. 'href' => $subject->getURL(),
  11. 'text' => $subject->name,
  12. 'class' => 'elgg-river-subject',
  13. 'is_trusted' => true,
  14. ));
  15. $target_link = elgg_view('output/url', array(
  16. 'href' => $target->getURL(),
  17. 'text' => $target->getDisplayName(),
  18. 'class' => 'elgg-river-target',
  19. 'is_trusted' => true,
  20. ));
  21. $river_comments_thumbnails = elgg_get_plugin_setting('river_comments_thumbnails', 'tidypics');
  22. if ($river_comments_thumbnails == "small") {
  23. $album = $target;
  24. $image = $album->getCoverImage();
  25. if ($image) {
  26. $attachments = elgg_view_entity_icon($image, 'small');
  27. }
  28. }
  29. else if ($river_comments_thumbnails == "tiny") {
  30. $album = $target;
  31. $image = $album->getCoverImage();
  32. if ($image) {
  33. $attachments = elgg_view_entity_icon($image, 'tiny');
  34. }
  35. }
  36. $summary = elgg_echo('river:comment:object:album', array($subject_link, $target_link));
  37. echo elgg_view('river/elements/layout', array(
  38. 'item' => $vars['item'],
  39. 'attachments' => $attachments,
  40. 'message' => elgg_get_excerpt($comment->description),
  41. 'summary' => $summary,
  42. ));