edit.php 837 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. $form_vars = array(
  16. "id" => "file_tools_edit_form"
  17. );
  18. $body_vars = array(
  19. "folder" => $folder,
  20. "page_owner_entity" => elgg_get_page_owner_entity()
  21. );
  22. $edit = elgg_view_form("file_tools/folder/edit", $form_vars, $body_vars);
  23. // build page
  24. $body = elgg_view_layout("one_sidebar", array(
  25. "title" => $title_text,
  26. "content" => $edit
  27. ));
  28. echo elgg_view_page($title_text, $body);