full.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * Full view of an image
  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 = $photo = $vars['entity'];
  11. $album = $image->getContainerEntity();
  12. $img = elgg_view_entity_icon($image, 'large', array(
  13. 'href' => $image->getIconURL('master'),
  14. 'img_class' => 'tidypics-photo',
  15. 'link_class' => 'tidypics-lightbox',
  16. ));
  17. $owner_link = elgg_view('output/url', array(
  18. 'href' => "photos/owner/" . $photo->getOwnerEntity()->username,
  19. 'text' => $photo->getOwnerEntity()->name,
  20. ));
  21. $author_text = elgg_echo('byline', array($owner_link));
  22. $date = elgg_view_friendly_time($image->time_created);
  23. $owner_icon = elgg_view_entity_icon($photo->getOwnerEntity(), 'tiny');
  24. $metadata = elgg_view_menu('entity', array(
  25. 'entity' => $vars['entity'],
  26. 'handler' => 'photos',
  27. 'sort_by' => 'priority',
  28. 'class' => 'elgg-menu-hz',
  29. ));
  30. $subtitle = "$author_text $date";
  31. $params = array(
  32. 'entity' => $photo,
  33. 'title' => false,
  34. 'metadata' => $metadata,
  35. 'subtitle' => $subtitle,
  36. 'tags' => $tags,
  37. );
  38. $list_body = elgg_view('object/elements/summary', $params);
  39. $params = array('class' => 'mbl');
  40. $summary = elgg_view_image_block($owner_icon, $list_body, $params);
  41. echo $summary;
  42. echo '<div class="tidypics-photo-wrapper center">';
  43. if ($album->getSize() > 1) {
  44. echo elgg_view('object/image/navigation', $vars);
  45. }
  46. echo elgg_view('photos/tagging/help', $vars);
  47. echo elgg_view('photos/tagging/select', $vars);
  48. echo $img;
  49. echo elgg_view('photos/tagging/tags', $vars);
  50. echo '</div>';
  51. if ($photo->description) {
  52. echo elgg_view('output/longtext', array(
  53. 'value' => $photo->description,
  54. 'class' => 'mbl',
  55. ));
  56. }
  57. echo elgg_view_comments($photo);