aiccBlock.class.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Container for the aiccResource class that deals with elemens from AICC Course Structure file
  5. * @package chamilo.learnpath
  6. * @author Yannick Warnier <ywarnier@beeznest.org>
  7. * @license GNU/GPL
  8. */
  9. /**
  10. * Class defining the Block elements in an AICC Course Structure file
  11. *
  12. */
  13. require_once 'learnpathItem.class.php';
  14. class aiccBlock extends learnpathItem{
  15. public $identifier = '';
  16. public $members = array();
  17. /**
  18. * Class constructor. Depending of the type of construction called ('db' or 'manifest'), will create a scormResource
  19. * object from database records or from the array given as second param
  20. * @param string Type of construction needed ('db' or 'config', default = 'config')
  21. * @param mixed Depending on the type given, DB id for the lp_item or parameters array
  22. */
  23. function aiccBlock($type='config',$params) {
  24. if(isset($params))
  25. {
  26. switch($type){
  27. case 'db':
  28. //TODO implement this way of object creation
  29. return false;
  30. case 'config': //do the same as the default
  31. default:
  32. foreach($params as $a => $value)
  33. {
  34. switch($a)
  35. {
  36. case 'system_id':
  37. $this->identifier = strtolower($value);
  38. break;
  39. case 'member':
  40. if(strstr($value,',')!==false){
  41. $temp = split(',',$value);
  42. foreach($temp as $val){
  43. if(!empty($val)){
  44. $this->members[] = $val;
  45. }
  46. }
  47. }
  48. break;
  49. }
  50. }
  51. return true;
  52. }
  53. }
  54. return false;
  55. }
  56. }
  57. ?>