ScormDocument.class.php 864 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * SCORM document backup script
  5. * @package chamilo.backup
  6. */
  7. /**
  8. * Code
  9. */
  10. require_once 'Resource.class.php';
  11. /**
  12. * ScormDocument class
  13. * @author Olivier Brouckaert <oli.brouckaert@dokeos.com>
  14. * @package chamilo.backup
  15. */
  16. class ScormDocument extends Resource
  17. {
  18. var $path;
  19. var $title;
  20. /**
  21. * Create a new Scorm Document
  22. * @param int $id
  23. * @param string $path
  24. * @param string $title
  25. */
  26. function ScormDocument($id,$path,$title)
  27. {
  28. parent::Resource($id,RESOURCE_SCORM);
  29. $this->path = 'scorm'.$path;
  30. $this->title = $title;
  31. }
  32. /**
  33. * Show this document
  34. */
  35. function show()
  36. {
  37. parent::show();
  38. $path = preg_replace('@^scorm/@', '', $this->path);
  39. echo $path;
  40. if (!empty($this->title)) {
  41. if (strpos($path, $this->title) === false) {
  42. echo " - ".$this->title;
  43. }
  44. }
  45. }
  46. }