dokeos-metadata
[ class tree: dokeos-metadata ] [ index: dokeos-metadata ] [ all elements ]

Source for file md_scorm.php

Documentation is available at md_scorm.php

  1. <?php /*                         <!-- md_scorm.php for Dokeos metadata/*.php -->
  2.                                                              <!-- 2006/12/15 -->
  3.  
  4. <!-- Copyright (C) 2005 rene.haentjens@UGent.be -  see metadata/md_funcs.php -->
  5.  
  6. */
  7.  
  8. /**
  9. ==============================================================================
  10. *    Dokeos Metadata: class mdobject for Scorm-type objects
  11. *
  12. *    @package dokeos.metadata
  13. ==============================================================================
  14. */
  15.  
  16. class mdobject
  17. {
  18.  
  19. var $mdo_type;
  20. var $mdo_id;
  21. var $mdo_eid;
  22.  
  23. var $mdo_dcmap_e;
  24. var $mdo_dcmap_v;
  25.  
  26. var $mdo_path;
  27. var $mdo_url;
  28.  
  29.  
  30. function mdo_define_htt(return new xhtdoc(<<<EOD
  31.  
  32. <!-- {-INDEXABLETEXT-} -->
  33.  
  34. {-D scormlevel {-V @level-}-}{-D two 2-}
  35. Title: {-V metadata/lom/general/title/string-} txt-sep
  36. {-T scormlevel == two Author(s): {-V metadata/lom/lifeCycle/contribute[1]/entity-} txt-sep-}
  37. Keyword(s): {-R metadata/lom/general/keyword C KWTEXT-} txt-sep
  38.  {-V metadata/lom/general/description[1]/string-}
  39.  {-V metadata/lom/technical/location-} txt-end
  40.  {-V metadata/lom/general/description[2]/string-} scorm-level-{-P scormlevel-}
  41.  {-V metadata/lom/lifeCycle/contribute[1]/entity-}
  42.  {-V metadata/lom/lifeCycle/contribute[1]/date/dateTime-}
  43.  
  44.  
  45. <!-- {-KWTEXT-} -->
  46.  
  47.  {-V string-}-kw
  48.  
  49.  
  50. <!-- {--} -->
  51. EOD
  52. );
  53. }
  54.  
  55.  
  56. function mdo_generate_default_xml_metadata()
  57. {
  58.     return '<empty/>';
  59. }
  60.  
  61.  
  62. function mdo_add_breadcrump_nav()
  63. {
  64.     global $interbreadcrumb;
  65.     $regs array()// for use with ereg()
  66.  
  67.     $docurl api_get_self();  // should be .../main/xxx/yyy.php
  68.     if (ereg('^(.+[^/\.]+)/[^/\.]+/[^/\.]+.[^/\.]+$'$docurl$regs))
  69.         $docurl $regs[1'/newscorm/index.php';
  70.  
  71.     $interbreadcrumb[array ('url' => $docurl,
  72.         'name' => get_lang('MdCallingTool'));
  73. }
  74.  
  75.  
  76. function mdobject($_course$id)
  77. {
  78.     global $ieee_dcmap_e$ieee_dcmap_v;  // md_funcs
  79.  
  80.     $scormdocument Database::get_course_table('lp');
  81.  
  82.     $this->mdo_course = $_course$this->mdo_type = 'Scorm';
  83.     $this->mdo_id = $id$this->mdo_eid = $this->mdo_type . '.' $id;
  84.  
  85.     $this->mdo_dcmap_e $ieee_dcmap_e$this->mdo_dcmap_v $ieee_dcmap_v;
  86.     $sql "SELECT path,description,lp_type FROM $scormdocument WHERE id='addslashes($id"'";
  87.     if (($docinfo @mysql_fetch_array(api_sql_query($sql,__FILE____LINE__))))
  88.     {
  89.         $this->mdo_path =     $docinfo['path'];
  90.         //Sometimes the new scorm-tool adds '/.' at the end of a directory name, so remove this before continue
  91.         //the process -- bmol
  92.         if(substr($this->mdo_path,-2== '/.')
  93.         {
  94.             $this->mdo_path = substr($this->mdo_path,0strlen($this->mdo_path)-2);
  95.         }
  96.         $this->mdo_comment =  $docinfo['description'];
  97.          //Don't think the next line is correct. There used to be a 'type' field in the scormdocument table.
  98.          //This metadata tool only works on folder types -- bmol
  99.         $this->mdo_filetype = ($docinfo['lp_type'== 'folder' 'xxx');
  100.  
  101.         $this->mdo_url =  get_course_web($this->mdo_course['path'.
  102.             '/scorm/' $this->mdo_path . '/index.php';
  103.     }
  104. }
  105.  
  106. }
  107. ?>

Documentation generated on Thu, 12 Jun 2008 14:06:13 -0500 by phpDocumentor 1.4.1