content.php 745 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Tidypics Plugin
  4. *
  5. * Index page Latest Photos widget for Widget Manager plugin
  6. *
  7. */
  8. // get widget settings
  9. $count = sanitise_int($vars["entity"]->tp_latest_photos_count, false);
  10. if(empty($count)){
  11. $count = 12;
  12. }
  13. $prev_context = elgg_get_context();
  14. elgg_set_context('front');
  15. $image_html = elgg_list_entities(array(
  16. 'type' => 'object',
  17. 'subtype' => 'image',
  18. 'limit' => $count,
  19. 'full_view' => false,
  20. 'list_type_toggle' => false,
  21. 'list_type' => 'gallery',
  22. 'pagination' => false,
  23. 'gallery_class' => 'tidypics-gallery-widget',
  24. ));
  25. elgg_set_context($prev_context);
  26. echo $image_html;