forumsearch.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * These files are a complete rework of the forum. The database structure is
  5. * based on phpBB but all the code is rewritten. A lot of new functionalities
  6. * are added:
  7. * - forum categories and forums can be sorted up or down, locked or made invisible
  8. * - consistent and integrated forum administration
  9. * - forum options: are students allowed to edit their post?
  10. * moderation of posts (approval)
  11. * reply only forums (students cannot create new threads)
  12. * multiple forums per group
  13. * - sticky messages
  14. * - new view option: nested view
  15. * - quoting a message.
  16. *
  17. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  18. * @copyright Ghent University
  19. *
  20. * @package chamilo.forum
  21. */
  22. require_once __DIR__.'/../inc/global.inc.php';
  23. // The section (tabs).
  24. $this_section = SECTION_COURSES;
  25. // Notification for unauthorized people.
  26. api_protect_course_script(true);
  27. // Including additional library scripts.
  28. include 'forumfunction.inc.php';
  29. // Are we in a lp ?
  30. $origin = api_get_origin();
  31. // Name of the tool
  32. $nameTools = get_lang('Forums');
  33. if (api_is_in_gradebook()) {
  34. $interbreadcrumb[] = [
  35. 'url' => Category::getUrl(),
  36. 'name' => get_lang('Assessments'),
  37. ];
  38. }
  39. $groupId = api_get_group_id();
  40. if ($origin == 'group') {
  41. $group_properties = GroupManager:: get_group_properties($groupId);
  42. $interbreadcrumb[] = [
  43. 'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(),
  44. 'name' => get_lang('Groups'),
  45. ];
  46. $interbreadcrumb[] = [
  47. 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(),
  48. 'name' => get_lang('Group area').' ('.$group_properties['name'].')',
  49. ];
  50. $interbreadcrumb[] = [
  51. 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?origin='.$origin.'&forum='.intval($_GET['forum']).'&'.api_get_cidreq(),
  52. 'name' => prepare4display($current_forum['forum_title']),
  53. ];
  54. $interbreadcrumb[] = [
  55. 'url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(),
  56. 'name' => get_lang('Search in the Forum'),
  57. ];
  58. } else {
  59. $interbreadcrumb[] = [
  60. 'url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq(),
  61. 'name' => $nameTools,
  62. ];
  63. $nameTools = get_lang('Search in the Forum');
  64. }
  65. // Display the header.
  66. if ($origin == 'learnpath') {
  67. Display::display_reduced_header();
  68. } else {
  69. Display::display_header($nameTools);
  70. }
  71. // Tool introduction
  72. Display::display_introduction_section(TOOL_FORUM);
  73. // Tracking
  74. Event::event_access_tool(TOOL_FORUM);
  75. // Forum search
  76. forum_search();
  77. // Footer
  78. if ($origin != 'learnpath') {
  79. Display :: display_footer();
  80. }