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

Source for file md_mix.php

Documentation is available at md_mix.php

  1. <?php /*                           <!-- md_mix.php for Dokeos metadata/*.php -->
  2.                                                              <!-- 2005/09/20 -->
  3.  
  4. <!-- Copyright (C) 2005 rene.haentjens@UGent.be -  see metadata/md_funcs.php -->
  5.  
  6. */
  7.  
  8. /**
  9. ============================================================================== 
  10. *    Dokeos Metadata: reduced class mdobject for Search, for a Mix of 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_path;
  24.  
  25. var $mdo_url;
  26.  
  27.  
  28. function mdobject($_course$eid)
  29. {
  30.     if (!($dotpos strpos($eid'.'))) return;
  31.     
  32.     $this->mdo_course = $_course$this->mdo_eid = $eid;
  33.     $this->mdo_type = ($type substr($eid0$dotpos));
  34.     $this->mdo_id = ($id substr($eid$dotpos 1));
  35.     
  36.     if ($type == 'Document' || $type == 'Scorm')
  37.     {
  38.         $table $type == 'Scorm' 
  39.             Database::get_course_table(TABLE_SCORMDOC:
  40.             Database::get_course_table(TABLE_DOCUMENT);
  41.     
  42.         if (($dotpos strpos($id'.')))
  43.         {
  44.             $urlp '?sid=' urlencode(substr($id$dotpos+1));
  45.             $id substr($id0$dotpos);
  46.         }
  47.     
  48.         if (($docinfo @mysql_fetch_array(api_sql_query(
  49.                 "SELECT path,comment,filetype FROM 
  50.                  $table WHERE id='
  51.                 addslashes($id"'"__FILE____LINE__))))
  52.         {
  53.             $this->mdo_path =     $docinfo['path'];
  54.             $this->mdo_comment =  $docinfo['comment'];
  55.             $this->mdo_filetype = $docinfo['filetype'];
  56.         
  57.             if ($type == 'Scorm')
  58.             {
  59.                 $this->mdo_base_url =  get_course_web(
  60.                     $this->mdo_course['path''/scorm' $this->mdo_path;
  61.                 $this->mdo_url =  $this->mdo_base_url . '/index.php' $urlp;
  62.             }
  63.             else
  64.             {
  65.                 $this->mdo_url =  api_get_path(WEB_PATH'main/document/' 
  66.                     (($this->mdo_filetype == 'file''download' 'document').'.php?'
  67.                     (($this->mdo_filetype == 'file''doc_url=' 'curdirpath='
  68.                     urlencode($this->mdo_path);
  69.             }
  70.         }
  71.     }
  72.     elseif ($type == 'Link')
  73.     {
  74.         $link_table Database::get_course_table(TABLE_LINK);
  75.         if (($linkinfo @mysql_fetch_array(api_sql_query(
  76.                 "SELECT url,title,description,category_id FROM 
  77.                  $link_table WHERE id='addslashes($id
  78.                 "'"__FILE____LINE__))))
  79.         {
  80.             $this->mdo_url = $linkinfo['url'];
  81.         }
  82.     }
  83. }
  84.  
  85. }
  86. ?>

Documentation generated on Thu, 12 Jun 2008 14:05:57 -0500 by phpDocumentor 1.4.1