Link.class.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. require_once 'Resource.class.php';
  4. /**
  5. * Class Link
  6. * A WWW-link from the Links-module in a Chamilo-course.
  7. * @author Bart Mollet <bart.mollet@hogent.be>
  8. * @package chamilo.backup
  9. */
  10. class Link extends Coursecopy\Resource
  11. {
  12. /**
  13. * The title
  14. */
  15. public $title;
  16. /**
  17. * The URL
  18. */
  19. public $url;
  20. /**
  21. * The description
  22. */
  23. public $description;
  24. /**
  25. * Id of this links category
  26. */
  27. public $category_id;
  28. /**
  29. * Display link on course homepage
  30. */
  31. public $on_homepage;
  32. /**
  33. * Create a new Link
  34. * @param int $id The id of this link in the Chamilo-course
  35. * @param string $title
  36. * @param string $url
  37. * @param string $description
  38. */
  39. public function __construct(
  40. $id,
  41. $title,
  42. $url,
  43. $description,
  44. $category_id,
  45. $on_homepage
  46. ) {
  47. parent::__construct($id,RESOURCE_LINK);
  48. $this->title = $title;
  49. $this->url = $url;
  50. $this->description = $description;
  51. $this->category_id = $category_id;
  52. $this->on_homepage = $on_homepage;
  53. }
  54. /**
  55. * Show this resource
  56. */
  57. public function show()
  58. {
  59. parent::show();
  60. echo $this->title.' ('.$this->url.')';
  61. }
  62. }