all.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * View all albums on the site
  4. *
  5. * @author Cash Costello
  6. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
  7. */
  8. elgg_push_breadcrumb(elgg_echo('photos'), 'photos/siteimagesall');
  9. elgg_push_breadcrumb(elgg_echo('tidypics:albums'));
  10. $offset = (int)get_input('offset', 0);
  11. $limit = (int)get_input('limit', 16);
  12. $content = elgg_list_entities(array(
  13. 'type' => 'object',
  14. 'subtype' => 'album',
  15. 'limit' => $limit,
  16. 'offset' => $offset,
  17. 'full_view' => false,
  18. 'list_type' => 'gallery',
  19. 'list_type_toggle' => false,
  20. 'gallery_class' => 'tidypics-gallery',
  21. ));
  22. if (!$content) {
  23. $content = elgg_echo('tidypics:none');
  24. }
  25. $title = elgg_echo('album:all');
  26. if (elgg_is_logged_in()) {
  27. $logged_in_guid = elgg_get_logged_in_user_guid();
  28. elgg_register_menu_item('title', array('name' => 'addphotos',
  29. 'href' => "ajax/view/photos/selectalbum/?owner_guid=" . $logged_in_guid,
  30. 'text' => elgg_echo("photos:addphotos"),
  31. 'link_class' => 'elgg-button elgg-button-action elgg-lightbox'));
  32. }
  33. elgg_register_title_button('photos');
  34. $body = elgg_view_layout('content', array(
  35. 'filter_context' => 'all',
  36. 'content' => $content,
  37. 'title' => $title,
  38. 'sidebar' => elgg_view('photos/sidebar', array('page' => 'all')),
  39. ));
  40. echo elgg_view_page($title, $body);