Link.class.php 1.1 KB

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