content.php 804 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Tidypics Plugin
  4. *
  5. * Groups page Latest Albums widget for Widget Manager plugin
  6. *
  7. */
  8. // get widget settings
  9. $count = sanitise_int($vars["entity"]->tp_latest_albums_count, false);
  10. if(empty($count)){
  11. $count = 6;
  12. }
  13. $prev_context = elgg_get_context();
  14. elgg_set_context('groups');
  15. $image_html = elgg_list_entities(array(
  16. 'type' => 'object',
  17. 'subtype' => 'album',
  18. 'container_guid' => elgg_get_page_owner_guid(),
  19. 'limit' => $count,
  20. 'full_view' => false,
  21. 'pagination' => false,
  22. ));
  23. elgg_set_context($prev_context);
  24. $image_html .= elgg_view('output/url', array(
  25. 'href' => "photos/add/" . elgg_get_page_owner_guid(),
  26. 'text' => elgg_echo('photos:add'),
  27. 'is_trusted' => true,
  28. ));
  29. echo $image_html;