forumsearch.php 2.9 KB

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