edit.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Edit the image information for a batch of images
  4. *
  5. * @author Cash Costello
  6. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
  7. */
  8. gatekeeper();
  9. $guid = (int) get_input('guid');
  10. if (!$batch = get_entity($guid)) {
  11. // @todo either deleted or do not have access
  12. forward('photos/all');
  13. }
  14. if (!$batch->canEdit()) {
  15. // @todo cannot change it
  16. forward('photos/all');
  17. }
  18. $album = $batch->getContainerEntity();
  19. elgg_set_page_owner_guid($batch->getContainerEntity()->getContainerGUID());
  20. $owner = elgg_get_page_owner_entity();
  21. $title = elgg_echo('tidypics:editprops');
  22. elgg_push_breadcrumb(elgg_echo('photos'), 'photos/siteimagesall');
  23. elgg_push_breadcrumb(elgg_echo('tidypics:albums'), 'photos/all');
  24. elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username");
  25. elgg_push_breadcrumb($album->getTitle(), $album->getURL());
  26. elgg_push_breadcrumb($title);
  27. $content = elgg_view_form('photos/batch/edit', array(), array('batch' => $batch));
  28. $body = elgg_view_layout('content', array(
  29. 'filter' => false,
  30. 'content' => $content,
  31. 'title' => elgg_echo('tidypics:editprops'),
  32. 'sidebar' => elgg_view('photos/sidebar', array('page' => 'album')),
  33. ));
  34. echo elgg_view_page($title, $body);