edit.php 764 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. elgg_gatekeeper();
  3. $folder_guid = get_input("folder_guid");
  4. elgg_entity_gatekeeper($folder_guid, "object", FILE_TOOLS_SUBTYPE);
  5. $folder = get_entity($folder_guid);
  6. if (!$folder->canEdit()) {
  7. register_error(elgg_echo("limited_access"));
  8. forward(REFERER);
  9. }
  10. // set context and page_owner
  11. elgg_set_context("file");
  12. elgg_set_page_owner_guid($folder->getContainerGUID());
  13. // build page elements
  14. $title_text = elgg_echo("file_tools:edit:title");
  15. $title = elgg_view_title($title_text);
  16. $edit = elgg_view("file_tools/forms/edit", array("folder" => $folder, "page_owner_entity" => elgg_get_page_owner_entity()));
  17. // build page
  18. $page_data = $title . $edit;
  19. echo elgg_view_page($title_text, elgg_view_layout("one_sidebar", array("content" => $page_data)));