sort.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Album sort page
  4. *
  5. * This displays a listing of all the photos so that they can be sorted
  6. */
  7. gatekeeper();
  8. group_gatekeeper();
  9. // get the album entity
  10. $album_guid = (int) get_input('guid');
  11. $album = get_entity($album_guid);
  12. // panic if we can't get it
  13. if (!$album) {
  14. forward();
  15. }
  16. // container should always be set, but just in case
  17. $owner = $album->getContainerEntity();
  18. elgg_set_page_owner_guid($owner->getGUID());
  19. $title = elgg_echo('tidypics:sort', array($album->getTitle()));
  20. // set up breadcrumbs
  21. elgg_push_breadcrumb(elgg_echo('photos'), 'photos/siteimagesall');
  22. elgg_push_breadcrumb(elgg_echo('tidypics:albums'), 'photos/all');
  23. if (elgg_instanceof($owner, 'group')) {
  24. elgg_push_breadcrumb($owner->name, "photos/group/$owner->guid/all");
  25. } else {
  26. elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username");
  27. }
  28. elgg_push_breadcrumb($album->getTitle(), $album->getURL());
  29. elgg_push_breadcrumb(elgg_echo('album:sort'));
  30. if ($album->getSize()) {
  31. $content = elgg_view_form('photos/album/sort', array(), array('album' => $album));
  32. } else {
  33. $content = elgg_echo('tidypics:sort:no_images');
  34. }
  35. $body = elgg_view_layout('content', array(
  36. 'filter' => false,
  37. 'content' => $content,
  38. 'title' => $title,
  39. 'sidebar' => elgg_view('photos/sidebar', array('page' => 'album')),
  40. ));
  41. echo elgg_view_page($title, $body);