CourseCopyLearnpath.class.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * A learnpath
  5. * @author Bart Mollet <bart.mollet@hogent.be>
  6. * @package chamilo.backup
  7. */
  8. class CourseCopyLearnpath extends Resource {
  9. /**
  10. * Type of learnpath (can be dokeos (1), scorm (2), aicc (3))
  11. */
  12. var $lp_type;
  13. /**
  14. * The name
  15. */
  16. var $name;
  17. /**
  18. * The reference
  19. */
  20. var $ref;
  21. /**
  22. * The description
  23. */
  24. var $description;
  25. /**
  26. * Path to the learning path files
  27. */
  28. var $path;
  29. /**
  30. * Whether additional commits should be forced or not
  31. */
  32. var $force_commit;
  33. /**
  34. * View mode by default ('embedded' or 'fullscreen')
  35. */
  36. var $default_view_mod;
  37. /**
  38. * Default character encoding
  39. */
  40. var $default_encoding;
  41. /**
  42. * Display order
  43. */
  44. var $display_order;
  45. /**
  46. * Content editor/publisher
  47. */
  48. var $content_maker;
  49. /**
  50. * Location of the content (local or remote)
  51. */
  52. var $content_local;
  53. /**
  54. * License of the content
  55. */
  56. var $content_license;
  57. /**
  58. * Whether to prevent reinitialisation or not
  59. */
  60. var $prevent_reinit;
  61. /**
  62. * JavaScript library used
  63. */
  64. var $js_lib;
  65. /**
  66. * Debug level for this lp
  67. */
  68. var $debug;
  69. /**
  70. * The items
  71. */
  72. var $items;
  73. /**
  74. * The learnpath visibility on the homepage
  75. */
  76. var $visibility;
  77. /**
  78. * Author info
  79. */
  80. var $author;
  81. /**
  82. * Author's image
  83. */
  84. var $preview_image;
  85. /**
  86. * Create a new learnpath
  87. * @param integer ID
  88. * @param integer Type (1,2,3,...)
  89. * @param string $name
  90. * @param string $path
  91. * @param string $ref
  92. * @param string $description
  93. * @param string $content_local
  94. * @param string $default_encoding
  95. * @param string $default_view_mode
  96. * @param bool $prevent_reinit
  97. * @param bool $force_commit
  98. * @param string $content_maker
  99. * @param integer $display_order
  100. * @param string $js_lib
  101. * @param string $content_license
  102. * @param integer $debug
  103. * @param string $visibility
  104. * @param array $items
  105. */
  106. function CourseCopyLearnpath($id,$type,$name, $path,$ref,$description,$content_local,$default_encoding,$default_view_mode,$prevent_reinit,$force_commit,
  107. $content_maker, $display_order,$js_lib,$content_license,$debug, $visibility, $author, $preview_image,
  108. $use_max_score, $autolunch, $created_on, $modified_on, $publicated_on, $expired_on, $session_id, $items) {
  109. parent::Resource($id,RESOURCE_LEARNPATH);
  110. $this->lp_type = $type;
  111. $this->name = $name;
  112. $this->path = $path;
  113. $this->ref = $ref;
  114. $this->description = $description;
  115. $this->content_local = $content_local;
  116. $this->default_encoding = $default_encoding;
  117. $this->default_view_mod = $default_view_mode;
  118. $this->prevent_reinit = $prevent_reinit;
  119. $this->force_commit = $force_commit;
  120. $this->content_maker = $content_maker;
  121. $this->display_order = $display_order;
  122. $this->js_lib = $js_lib;
  123. $this->content_license = $content_license;
  124. $this->debug = $debug;
  125. $this->visibility=$visibility;
  126. $this->use_max_score=$use_max_score;
  127. $this->autolunch=$autolunch;
  128. $this->created_on=$created_on;
  129. $this->modified_on=$modified_on;
  130. $this->publicated_on=$publicated_on;
  131. $this->expired_on=$expired_on;
  132. $this->session_id=$session_id;
  133. $this->author= $author;
  134. $this->preview_image= $preview_image;
  135. $this->items = $items;
  136. }
  137. /**
  138. * Get the items
  139. */
  140. function get_items()
  141. {
  142. return $this->items;
  143. }
  144. /**
  145. * Check if a given resource is used as an item in this chapter
  146. */
  147. function has_item($resource)
  148. {
  149. foreach($this->items as $index => $item) {
  150. if( $item['id'] == $resource->get_id() && $item['type'] == $resource->get_type()) {
  151. return true;
  152. }
  153. }
  154. return false;
  155. }
  156. /**
  157. * Show this learnpath
  158. */
  159. function show() {
  160. parent::show();
  161. echo $this->name;
  162. }
  163. }