upload.scorm.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Process part of the SCORM sub-process for upload. This script MUST BE included by upload/index.php
  5. * as it prepares most of the variables needed here.
  6. *
  7. * @package chamilo.upload
  8. *
  9. * @author Yannick Warnier <ywarnier@beeznest.org>
  10. */
  11. $cwdir = getcwd();
  12. require_once '../lp/lp_upload.php';
  13. // Reinit current working directory as many functions in upload change it
  14. chdir($cwdir);
  15. if (api_get_setting('search_enabled') === 'true') {
  16. require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
  17. $specific_fields = get_specific_field_list();
  18. foreach ($specific_fields as $specific_field) {
  19. $values = explode(',', trim($_POST[$specific_field['code']]));
  20. if (!empty($values)) {
  21. foreach ($values as $value) {
  22. $value = trim($value);
  23. if (!empty($value)) {
  24. add_specific_field_value(
  25. $specific_field['id'],
  26. api_get_course_id(),
  27. TOOL_LEARNPATH,
  28. $oScorm->lp_id,
  29. $value
  30. );
  31. }
  32. }
  33. }
  34. }
  35. }
  36. header('location: ../lp/lp_controller.php?action=list&'.api_get_cidreq());
  37. exit;