ToolIntro.class.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. require_once 'Resource.class.php';
  4. /**
  5. * A WWW-link from the Links-module in a Chamilo-course.
  6. * @author Bart Mollet <bart.mollet@hogent.be>
  7. * @package chamilo.backup
  8. */
  9. class ToolIntro extends Resource
  10. {
  11. var $id;
  12. /**
  13. * intro text
  14. */
  15. var $intro_text;
  16. /**
  17. * Create a new text introduction
  18. * @param int $id The id of this tool introduction in the Chamilo-course
  19. * @param string $intro_text
  20. */
  21. public function __construct($id, $intro_text)
  22. {
  23. parent::__construct($id, RESOURCE_TOOL_INTRO);
  24. $this->id = $id;
  25. $this->intro_text = $intro_text;
  26. }
  27. /**
  28. * Show this resource
  29. */
  30. function show()
  31. {
  32. parent::show();
  33. switch ($this->id)
  34. {
  35. case TOOL_DOCUMENT:
  36. $lang_id = 'Documents';
  37. break;
  38. case TOOL_CALENDAR_EVENT:
  39. $lang_id = 'Agenda';
  40. break;
  41. case TOOL_LINK:
  42. $lang_id = 'Links';
  43. break;
  44. case TOOL_LEARNPATH:
  45. $lang_id = 'LearningPath';
  46. break;
  47. case TOOL_ANNOUNCEMENT:
  48. $lang_id = 'Announcements';
  49. break;
  50. case TOOL_FORUM:
  51. $lang_id = 'Forums';
  52. break;
  53. case TOOL_DROPBOX:
  54. $lang_id = 'Dropbox';
  55. break;
  56. case TOOL_QUIZ:
  57. $lang_id = 'Exercises';
  58. break;
  59. case TOOL_USER:
  60. $lang_id = 'Users';
  61. break;
  62. case TOOL_GROUP:
  63. $lang_id = 'Group';
  64. break;
  65. case TOOL_WIKI:
  66. $lang_id = 'Wiki';
  67. break;
  68. case TOOL_STUDENTPUBLICATION:
  69. $lang_id = 'StudentPublications';
  70. break;
  71. case TOOL_COURSE_HOMEPAGE:
  72. $lang_id = 'CourseHomepageLink';
  73. break;
  74. case TOOL_GLOSSARY:
  75. $lang_id = 'Glossary';
  76. break;
  77. case TOOL_NOTEBOOK:
  78. $lang_id = 'Notebook';
  79. break;
  80. default:
  81. $lang_id = ucfirst($this->id); // This is a wild guess.
  82. }
  83. echo '<strong>'.get_lang($lang_id, '').':</strong><br />';
  84. echo $this->intro_text;
  85. }
  86. }