full.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * Full view of an album
  4. *
  5. * @uses $vars['entity'] TidypicsAlbum
  6. *
  7. * @author Cash Costello
  8. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
  9. */
  10. $album = elgg_extract('entity', $vars);
  11. $owner = $album->getOwnerEntity();
  12. $owner_icon = elgg_view_entity_icon($owner, 'tiny');
  13. $metadata = elgg_view_menu('entity', array(
  14. 'entity' => $album,
  15. 'handler' => 'photos',
  16. 'sort_by' => 'priority',
  17. 'class' => 'elgg-menu-hz',
  18. ));
  19. $owner_link = elgg_view('output/url', array(
  20. 'href' => "photos/owner/$owner->username",
  21. 'text' => $owner->name,
  22. 'is_trusted' => true,
  23. ));
  24. $author_text = elgg_echo('byline', array($owner_link));
  25. $date = elgg_view_friendly_time($album->time_created);
  26. $categories = elgg_view('output/categories', $vars);
  27. $subtitle = "$author_text $date $categories";
  28. $params = array(
  29. 'entity' => $album,
  30. 'title' => false,
  31. 'metadata' => $metadata,
  32. 'subtitle' => $subtitle,
  33. 'tags' => elgg_view('output/tags', array('tags' => $album->tags)),
  34. );
  35. $params = $params + $vars;
  36. $summary = elgg_view('object/elements/summary', $params);
  37. $body = '';
  38. if ($album->description) {
  39. $body = elgg_view('output/longtext', array(
  40. 'value' => $album->description,
  41. 'class' => 'mbm',
  42. ));
  43. }
  44. $body .= $album->viewImages();
  45. $body .= elgg_view_comments($album);
  46. echo elgg_view('object/elements/full', array(
  47. 'entity' => $album,
  48. 'icon' => $owner_icon,
  49. 'summary' => $summary,
  50. 'body' => $body,
  51. ));