forumsearch.php 3.2 KB

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