aiccResource.class.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php //$id:$
  2. /**
  3. * Container for the aiccResource class that deals with elemens from AICC Descriptor file
  4. * @package dokeos.learnpath
  5. * @author Yannick Warnier <ywarnier@beeznest.org>
  6. * @license GNU/GPL - See Dokeos license directory for details
  7. */
  8. /**
  9. * Class defining the elements from an AICC Descriptor file
  10. */
  11. class aiccResource {
  12. var $identifier = '';
  13. var $title = '';
  14. var $description = '';
  15. var $developer_id = '';
  16. /**
  17. * Class constructor. Depending of the type of construction called ('db' or 'manifest'), will create a scormResource
  18. * object from database records or from the array given as second param
  19. * @param string Type of construction needed ('db' or 'config', default = 'config')
  20. * @param mixed Depending on the type given, DB id for the lp_item or parameters array
  21. */
  22. function aiccResource($type='config',$params) {
  23. if(isset($params))
  24. {
  25. switch($type){
  26. case 'db':
  27. //TODO implement this way of object creation
  28. return false;
  29. case 'config': //do the same as the default
  30. default:
  31. foreach($params as $a => $value)
  32. {
  33. switch($a)
  34. {
  35. case 'system_id':
  36. $this->identifier = strtolower($value);
  37. break;
  38. case 'title':
  39. $this->title = $value;
  40. case 'description':
  41. $this->description = $value;
  42. break;
  43. case 'developer_id':
  44. $this->developer_id = $value;
  45. break;
  46. }
  47. }
  48. return true;
  49. }
  50. }
  51. return false;
  52. }
  53. }
  54. ?>