forumsearch.php 3.0 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. 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' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'));
  53. $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), 'name' => get_lang('GroupSpace').' ('.$group_properties['name'].')');
  54. $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?origin='.$origin.'&forum='.intval($_GET['forum']).'&'.api_get_cidreq(), 'name' => prepare4display($current_forum['forum_title']));
  55. $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(),'name' => get_lang('ForumSearch'));
  56. } else {
  57. $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq(), 'name' => $nameTools);
  58. $nameTools = get_lang('ForumSearch');
  59. }
  60. // Display the header.
  61. if ($origin == 'learnpath') {
  62. Display::display_reduced_header();
  63. } else {
  64. Display :: display_header($nameTools);
  65. }
  66. // Tool introduction
  67. Display::display_introduction_section(TOOL_FORUM);
  68. // Tracking
  69. Event::event_access_tool(TOOL_FORUM);
  70. // Forum search
  71. forum_search();
  72. // Footer
  73. if ($origin != 'learnpath') {
  74. Display :: display_footer();
  75. }