summary.php 762 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Summary of an image for lists/galleries
  4. *
  5. * @uses $vars['entity'] TidypicsImage
  6. *
  7. * @author Cash Costello
  8. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
  9. */
  10. $image = elgg_extract('entity', $vars);
  11. $img = elgg_view_entity_icon($image, 'small');
  12. $img_title = $image->getTitle();
  13. if (strlen($img_title) > 20) {
  14. $img_title = substr($img_title, 0, 17).'...';
  15. }
  16. $header = elgg_view('output/url', array(
  17. 'text' => $img_title,
  18. 'href' => $image->getURL(),
  19. 'is_trusted' => true,
  20. 'class' => 'tidypics-heading',
  21. ));
  22. $body = elgg_view('output/url', array(
  23. 'text' => $img,
  24. 'href' => $image->getURL(),
  25. 'encode_text' => false,
  26. 'is_trusted' => true,
  27. ));
  28. echo elgg_view_module('tidypics-image', $header, $body);