update.php 959 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. require_once 'dropbox_init.inc.php';
  4. api_protect_course_script();
  5. if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
  6. api_not_allowed(true);
  7. }
  8. $id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
  9. if (empty($id)) {
  10. api_not_allowed(true);
  11. }
  12. $work = new Dropbox_SentWork($id);
  13. if (empty($work)) {
  14. api_not_allowed(true);
  15. }
  16. if (isset($_POST['submitWork'])) {
  17. store_add_dropbox(null, $work);
  18. }
  19. $viewReceivedCategory = isset($_GET['view_received_category']) ? Security::remove_XSS($_GET['view_received_category']) : '';
  20. $viewSentCategory = isset($_GET['view_sent_category']) ? Security::remove_XSS($_GET['view_sent_category']) : '';
  21. $view = isset($_GET['view']) ? Security::remove_XSS($_GET['view']) : '';
  22. echo Display::page_header($work->title);
  23. display_add_form(
  24. $viewReceivedCategory,
  25. $viewSentCategory,
  26. $view,
  27. $id
  28. );
  29. Display::display_footer();