CourseCopyLearnpath.class.php 3.8 KB

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