ScormDocument.class.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php // $Id: ScormDocument.class.php 9246 2006-09-25 13:24:53Z bmol $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2004 Dokeos S.A.
  6. Copyright (c) 2003 Ghent University (UGent)
  7. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  8. Copyright (c) Bart Mollet (bart.mollet@hogent.be)
  9. For a full list of contributors, see "credits.txt".
  10. The full license can be read in "license.txt".
  11. This program is free software; you can redistribute it and/or
  12. modify it under the terms of the GNU General Public License
  13. as published by the Free Software Foundation; either version 2
  14. of the License, or (at your option) any later version.
  15. See the GNU General Public License for more details.
  16. Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
  17. Mail: info@dokeos.com
  18. ==============================================================================
  19. */
  20. require_once 'Resource.class.php';
  21. /**
  22. * ScormDocument class
  23. * @author Olivier Brouckaert <oli.brouckaert@dokeos.com>
  24. * @package dokeos.backup
  25. */
  26. class ScormDocument extends Resource
  27. {
  28. var $path;
  29. var $title;
  30. /**
  31. * Create a new Scorm Document
  32. * @param int $id
  33. * @param string $path
  34. * @param string $title
  35. */
  36. function ScormDocument($id,$path,$title)
  37. {
  38. parent::Resource($id,RESOURCE_SCORM);
  39. $this->path = 'scorm'.$path;
  40. $this->title = $title;
  41. }
  42. /**
  43. * Show this document
  44. */
  45. function show()
  46. {
  47. parent::show();
  48. $path = preg_replace('@^scorm/@', '', $this->path);
  49. echo $path;
  50. if (!empty($this->title) && (api_get_setting('use_document_title') == 'true'))
  51. {
  52. if (strpos($path, $this->title) === false)
  53. {
  54. echo " - ".$this->title;
  55. }
  56. }
  57. }
  58. }