ScormDocument.class.php 948 B

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