forumsearch.php 2.8 KB

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