forumsearch.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. // Language files that need to be included.
  23. $language_file = array ('forum', 'group');
  24. // Including the global initialiation file.
  25. require_once '../inc/global.inc.php';
  26. // The section (tabs).
  27. $this_section = SECTION_COURSES;
  28. // Notification for unauthorized people.
  29. api_protect_course_script(true);
  30. // Including additional library scripts.
  31. require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
  32. include_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
  33. include 'forumfunction.inc.php';
  34. include 'forumconfig.inc.php';
  35. // Are we in a lp ?
  36. $origin = '';
  37. if (isset($_GET['origin'])) {
  38. $origin = Security::remove_XSS($_GET['origin']);
  39. }
  40. // Name of the tool
  41. $nameTools = get_lang('ToolForum');
  42. // Breadcrumbs
  43. if (isset($_SESSION['gradebook'])){
  44. $gradebook = $_SESSION['gradebook'];
  45. }
  46. if (!empty($gradebook) && $gradebook == 'view') {
  47. $interbreadcrumb[] = array (
  48. 'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
  49. 'name' => get_lang('ToolGradebook')
  50. );
  51. }
  52. if (!empty ($_GET['gidReq'])) {
  53. $toolgroup = Database::escape_string($_GET['gidReq']);
  54. api_session_register('toolgroup');
  55. }
  56. if ($origin == 'group') {
  57. $_clean['toolgroup']=(int)$_SESSION['toolgroup'];
  58. $group_properties = GroupManager :: get_group_properties($_clean['toolgroup']);
  59. $interbreadcrumb[] = array('url' => '../group/group.php', 'name' => get_lang('Groups'));
  60. $interbreadcrumb[] = array('url' => '../group/group_space.php?gidReq='.$_SESSION['toolgroup'], 'name' => get_lang('GroupSpace').' ('.$group_properties['name'].')');
  61. $interbreadcrumb[] = array('url' => 'viewforum.php?origin='.$origin.'&amp;gidReq='.$_SESSION['toolgroup'].'&amp;forum='.Security::remove_XSS($_GET['forum']), 'name' => prepare4display($current_forum['forum_title']));
  62. $interbreadcrumb[] = array('url' => 'forumsearch.php','name' => get_lang('ForumSearch'));
  63. } else {
  64. $interbreadcrumb[] = array('url' => 'index.php?gradebook='.$gradebook.'', 'name' => $nameTools);
  65. //$interbreadcrumb[] = array('url' => 'forumsearch.php', 'name' => );
  66. $nameTools = get_lang('ForumSearch');
  67. }
  68. // Display the header.
  69. if ($origin == 'learnpath') {
  70. include api_get_path(INCLUDE_PATH).'reduced_header.inc.php';
  71. } else {
  72. Display :: display_header($nameTools);
  73. }
  74. // Display the tool title.
  75. // api_display_tool_title($nameTools);
  76. // Tool introduction
  77. Display::display_introduction_section(TOOL_FORUM);
  78. // Tracking
  79. event_access_tool(TOOL_FORUM);
  80. // Forum search
  81. forum_search();
  82. // Footer
  83. if ($origin != 'learnpath') {
  84. Display :: display_footer();
  85. }