forumsearch.php 2.9 KB

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