group_module.php 942 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Group album module
  4. */
  5. $group = $vars['entity'];
  6. if ($group->photos_enable == "no") {
  7. return true;
  8. }
  9. $all_link = elgg_view('output/url', array(
  10. 'href' => "photos/group/$group->guid/all",
  11. 'text' => elgg_echo('link:view:all'),
  12. 'is_trusted' => true,
  13. ));
  14. elgg_push_context('widgets');
  15. $options = array(
  16. 'type' => 'object',
  17. 'subtype' => 'album',
  18. 'container_guid' => elgg_get_page_owner_guid(),
  19. 'limit' => 6,
  20. 'full_view' => false,
  21. 'pagination' => false,
  22. );
  23. $content = elgg_list_entities($options);
  24. elgg_pop_context();
  25. if (!$content) {
  26. $content = '<p>' . elgg_echo('tidypics:none') . '</p>';
  27. }
  28. $new_link = elgg_view('output/url', array(
  29. 'href' => "photos/add/$group->guid",
  30. 'text' => elgg_echo('photos:add'),
  31. 'is_trusted' => true,
  32. ));
  33. echo elgg_view('groups/profile/module', array(
  34. 'title' => elgg_echo("tidypics:albums_mostrecent"),
  35. 'content' => $content,
  36. 'all_link' => $all_link,
  37. 'add_link' => $new_link,
  38. ));