siteimagesall.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * Most recently uploaded images - all images
  4. *
  5. */
  6. // set up breadcrumbs
  7. elgg_push_breadcrumb(elgg_echo('photos'), 'photos/siteimagesall');
  8. $offset = (int)get_input('offset', 0);
  9. $limit = (int)get_input('limit', 16);
  10. // grab the html to display the most recent images
  11. $result = elgg_list_entities(array('type' => 'object',
  12. 'subtype' => 'image',
  13. 'owner_guid' => NULL,
  14. 'limit' => $limit,
  15. 'offset' => $offset,
  16. 'full_view' => false,
  17. 'list_type' => 'gallery',
  18. 'gallery_class' => 'tidypics-gallery'
  19. ));
  20. $title = elgg_echo('tidypics:siteimagesall');
  21. if (elgg_is_logged_in()) {
  22. $logged_in_guid = elgg_get_logged_in_user_guid();
  23. elgg_register_menu_item('title', array('name' => 'addphotos',
  24. 'href' => "ajax/view/photos/selectalbum/?owner_guid=" . $logged_in_guid,
  25. 'text' => elgg_echo("photos:addphotos"),
  26. 'link_class' => 'elgg-button elgg-button-action elgg-lightbox'));
  27. }
  28. // only show slideshow link if slideshow is enabled in plugin settings and there are images
  29. if (elgg_get_plugin_setting('slideshow', 'tidypics') && !empty($result)) {
  30. $url = elgg_get_site_url() . "photos/siteimagesall?limit=64&offset=$offset&view=rss";
  31. $url = elgg_format_url($url);
  32. $slideshow_link = "javascript:PicLensLite.start({maxScale:0, feedUrl:'$url'})";
  33. elgg_register_menu_item('title', array('name' => 'slideshow',
  34. 'href' => $slideshow_link,
  35. 'text' => "<img src=\"".elgg_get_site_url() ."mod/tidypics/graphics/slideshow.png\" alt=\"".elgg_echo('album:slideshow')."\">",
  36. 'title' => elgg_echo('album:slideshow'),
  37. 'link_class' => 'elgg-button elgg-button-action'));
  38. }
  39. if (!empty($result)) {
  40. $area2 = $result;
  41. } else {
  42. $area2 = elgg_echo('tidypics:siteimagesall:nosuccess');
  43. }
  44. $body = elgg_view_layout('content', array(
  45. 'filter_override' => elgg_view('filter_override/siteimages', array('selected' => 'all')),
  46. 'content' => $area2,
  47. 'title' => $title,
  48. 'sidebar' => elgg_view('photos/sidebar', array('page' => 'all')),
  49. ));
  50. // Draw it
  51. echo elgg_view_page($title, $body);