image.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Post comment on image 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. $image = $target;
  24. $attachments = elgg_view_entity_icon($image, 'small');
  25. }
  26. else if ($river_comments_thumbnails == "tiny") {
  27. $image = $target;
  28. $attachments = elgg_view_entity_icon($image, 'tiny');
  29. }
  30. $summary = elgg_echo('river:comment:object:image', array($subject_link, $target_link));
  31. echo elgg_view('river/elements/layout', array(
  32. 'item' => $vars['item'],
  33. 'attachments' => $attachments,
  34. 'message' => elgg_get_excerpt($comment->description),
  35. 'summary' => $summary,
  36. ));