aiccObjective.class.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. require_once 'learnpathItem.class.php';
  4. /**
  5. * Class aiccObjective
  6. * Class defining the Block elements in an AICC Course Structure file.
  7. * Container for the aiccResource class that deals with elemens from AICC Objectives file
  8. * @package chamilo.learnpath
  9. * @author Yannick Warnier <ywarnier@beeznest.org>
  10. * @license GNU/GPL
  11. */
  12. class aiccObjective extends learnpathItem
  13. {
  14. public $identifier = '';
  15. public $members = array();
  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 aiccObjective($type = 'config', $params)
  23. {
  24. if (isset($params)) {
  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. switch ($a) {
  33. case 'system_id':
  34. $this->identifier = strtolower($value);
  35. break;
  36. case 'member':
  37. if (strstr($value, ',') !== false) {
  38. $temp = explode(',', $value);
  39. foreach ($temp as $val) {
  40. if (!empty($val)) {
  41. $this->members[] = $val;
  42. }
  43. }
  44. }
  45. break;
  46. }
  47. }
  48. return true;
  49. }
  50. }
  51. return false;
  52. }
  53. }