new.php 864 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. elgg_gatekeeper();
  3. $page_owner = elgg_get_page_owner_entity();
  4. if (empty($page_owner) || (!elgg_instanceof($page_owner, "user") && !elgg_instanceof($page_owner, "group"))) {
  5. forward(REFERER);
  6. }
  7. // set page owner & context
  8. elgg_set_context("file");
  9. // get data
  10. // build page elements
  11. $title_text = elgg_echo("file_tools:new:title");
  12. $form_vars = array(
  13. "id" => "file_tools_edit_form"
  14. );
  15. $body_vars = array(
  16. "page_owner_entity" => $page_owner
  17. );
  18. // draw page
  19. if (elgg_is_xhr()) {
  20. echo "<div style='width: 550px; height:550px;'>";
  21. echo elgg_view_title($title_text);
  22. echo elgg_view_form("file_tools/folder/edit", $form_vars, $body_vars);
  23. echo "</div>";
  24. } else {
  25. echo elgg_view_page($title_text, elgg_view_layout("one_sidebar", array(
  26. "title" => $title_text,
  27. "content" => elgg_view_form("file_tools/folder/edit", $form_vars, $body_vars)
  28. )));
  29. }