ToolIntro.class.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Tool intro 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 ToolIntro extends Resource
  17. {
  18. var $id;
  19. /**
  20. * intro text
  21. */
  22. var $intro_text;
  23. /**
  24. * Create a new text introduction
  25. * @param int $id The id of this tool introduction in the Chamilo-course
  26. * @param string $intro_text
  27. */
  28. function ToolIntro($id, $intro_text)
  29. {
  30. parent::Resource($id,RESOURCE_TOOL_INTRO);
  31. $this->id = $id;
  32. $this->intro_text = $intro_text;
  33. }
  34. /**
  35. * Show this resource
  36. */
  37. function show()
  38. {
  39. parent::show();
  40. switch ($this->id)
  41. {
  42. case TOOL_DOCUMENT:
  43. $lang_id = 'Documents';
  44. break;
  45. case TOOL_CALENDAR_EVENT:
  46. $lang_id = 'Agenda';
  47. break;
  48. case TOOL_LINK:
  49. $lang_id = 'Links';
  50. break;
  51. case TOOL_LEARNPATH:
  52. $lang_id = 'LearningPath';
  53. break;
  54. case TOOL_ANNOUNCEMENT:
  55. $lang_id = 'Announcements';
  56. break;
  57. case TOOL_FORUM:
  58. $lang_id = 'Forums';
  59. break;
  60. case TOOL_DROPBOX:
  61. $lang_id = 'Dropbox';
  62. break;
  63. case TOOL_QUIZ:
  64. $lang_id = 'Exercises';
  65. break;
  66. case TOOL_USER:
  67. $lang_id = 'Users';
  68. break;
  69. case TOOL_GROUP:
  70. $lang_id = 'Group';
  71. break;
  72. case TOOL_WIKI:
  73. $lang_id = 'Wiki';
  74. break;
  75. case TOOL_STUDENTPUBLICATION:
  76. $lang_id = 'StudentPublications';
  77. break;
  78. case TOOL_COURSE_HOMEPAGE:
  79. $lang_id = 'CourseHomepageLink';
  80. break;
  81. case TOOL_GLOSSARY:
  82. $lang_id = 'Glossary';
  83. break;
  84. case TOOL_NOTEBOOK:
  85. $lang_id = 'Notebook';
  86. break;
  87. default:
  88. $lang_id = ucfirst($this->id); // This is a wild guess.
  89. }
  90. echo '<strong>'.get_lang($lang_id, '').':</strong><br />';
  91. echo $this->intro_text;
  92. }
  93. }