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. * @package chamilo.upload
  7. * @author Yannick Warnier <ywarnier@beeznest.org>
  8. */
  9. $cwdir = getcwd();
  10. require_once '../lp/lp_upload.php';
  11. // Reinit current working directory as many functions in upload change it
  12. chdir($cwdir);
  13. if (api_get_setting('search_enabled') === 'true') {
  14. require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
  15. $specific_fields = get_specific_field_list();
  16. foreach ($specific_fields as $specific_field) {
  17. $values = explode(',', trim($_POST[$specific_field['code']]));
  18. if (!empty($values)) {
  19. foreach ($values as $value) {
  20. $value = trim($value);
  21. if (!empty($value)) {
  22. add_specific_field_value(
  23. $specific_field['id'],
  24. api_get_course_id(),
  25. TOOL_LEARNPATH,
  26. $oScorm->lp_id,
  27. $value
  28. );
  29. }
  30. }
  31. }
  32. }
  33. }
  34. header('location: ../lp/lp_controller.php?action=list?'.api_get_cidreq());
  35. exit;