list.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Display an album as an item in a list
  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_link = elgg_view('output/url', array(
  13. 'href' => "photos/owner/$owner->username",
  14. 'text' => $owner->name,
  15. 'is_trusted' => true,
  16. ));
  17. $author_text = elgg_echo('byline', array($owner_link));
  18. $date = elgg_view_friendly_time($album->time_created);
  19. $categories = elgg_view('output/categories', $vars);
  20. $subtitle = "$author_text $date $categories";
  21. $title = elgg_view('output/url', array(
  22. 'text' => $album->getTitle(),
  23. 'href' => $album->getURL(),
  24. ));
  25. $params = array(
  26. 'entity' => $album,
  27. 'title' => $title,
  28. 'metadata' => null,
  29. 'subtitle' => $subtitle,
  30. 'tags' => elgg_view('output/tags', array('tags' => $album->tags)),
  31. );
  32. $params = $params + $vars;
  33. $summary = elgg_view('object/elements/summary', $params);
  34. $icon = elgg_view_entity_icon($album, 'tiny');
  35. echo $header = elgg_view_image_block($icon, $summary);