md_scorm.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php /* <!-- md_scorm.php for Dokeos metadata/*.php -->
  2. <!-- 2005/09/20 -->
  3. <!-- Copyright (C) 2005 rene.haentjens@UGent.be - see metadata/md_funcs.php -->
  4. */
  5. /**
  6. ==============================================================================
  7. * Dokeos Metadata: class mdobject for Scorm-type objects
  8. *
  9. * @package dokeos.metadata
  10. ==============================================================================
  11. */
  12. class mdobject
  13. {
  14. var $mdo_course;
  15. var $mdo_type;
  16. var $mdo_id;
  17. var $mdo_eid;
  18. var $mdo_dcmap_e;
  19. var $mdo_dcmap_v;
  20. var $mdo_path;
  21. var $mdo_comment;
  22. var $mdo_filetype;
  23. var $mdo_url;
  24. function mdo_define_htt() { return new xhtdoc(<<<EOD
  25. <!-- {-INDEXABLETEXT-} -->
  26. Title: {-V metadata/lom/general/title/string-} txt-sep
  27. Keyword(s): {-R metadata/lom/general/keyword C KWTEXT-} txt-sep
  28. {-V metadata/lom/general/description[1]/string-}
  29. {-V metadata/lom/technical/location-} txt-end
  30. {-V metadata/lom/general/description[2]/string-} scorm-level-{-V @level-}
  31. {-V metadata/lom/lifeCycle/contribute[1]/entity-}
  32. {-V metadata/lom/lifeCycle/contribute[1]/date/dateTime-}
  33. <!-- {-KWTEXT-} -->
  34. {-V string-}-kw
  35. <!-- {--} -->
  36. EOD
  37. );
  38. }
  39. function mdo_generate_default_xml_metadata()
  40. {
  41. return '<empty/>';
  42. }
  43. function mdo_add_breadcrump_nav()
  44. {
  45. global $interbreadcrumb;
  46. $regs = array(); // for use with ereg()
  47. $docurl = $_SERVER['PHP_SELF']; // should be .../main/xxx/yyy.php
  48. if (ereg('^(.+[^/\.]+)/[^/\.]+/[^/\.]+.[^/\.]+$', $docurl, $regs))
  49. $docurl = $regs[1] . '/scorm/scormdocument.php';
  50. $interbreadcrumb[] = array ('url' => $docurl,
  51. 'name' => get_lang('MdCallingTool'));
  52. }
  53. function mdobject($_course, $id)
  54. {
  55. global $ieee_dcmap_e, $ieee_dcmap_v; // md_funcs
  56. $scormdocument = Database::get_course_scormdocument_table();
  57. $this->mdo_course = $_course; $this->mdo_type = 'Scorm';
  58. $this->mdo_id = $id; $this->mdo_eid = $this->mdo_type . '.' . $id;
  59. $this->mdo_dcmap_e = $ieee_dcmap_e; $this->mdo_dcmap_v = $ieee_dcmap_v;
  60. if (($docinfo = @mysql_fetch_array(api_sql_query(
  61. "SELECT path,comment,filetype FROM $scormdocument
  62. WHERE id='" . addslashes($id) . "'",
  63. __FILE__, __LINE__))))
  64. {
  65. $this->mdo_path = $docinfo['path'];
  66. $this->mdo_comment = $docinfo['comment'];
  67. $this->mdo_filetype = $docinfo['filetype'];
  68. $this->mdo_url = get_course_web() . $this->mdo_course['path'] .
  69. '/scorm' . $this->mdo_path . '/index.php';
  70. }
  71. }
  72. }
  73. ?>