forumsearch.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. require_once __DIR__.'/../inc/global.inc.php';
  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 = api_get_origin();
  32. // Name of the tool
  33. $nameTools = get_lang('ToolForum');
  34. if (api_is_in_gradebook()) {
  35. $interbreadcrumb[] = array(
  36. 'url' => Category::getUrl(),
  37. 'name' => get_lang('ToolGradebook')
  38. );
  39. }
  40. $groupId = api_get_group_id();
  41. if ($origin == 'group') {
  42. $group_properties = GroupManager :: get_group_properties($groupId);
  43. $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'));
  44. $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), 'name' => get_lang('GroupSpace').' ('.$group_properties['name'].')');
  45. $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']));
  46. $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(), 'name' => get_lang('ForumSearch'));
  47. } else {
  48. $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq(), 'name' => $nameTools);
  49. $nameTools = get_lang('ForumSearch');
  50. }
  51. // Display the header.
  52. if ($origin == 'learnpath') {
  53. Display::display_reduced_header();
  54. } else {
  55. Display :: display_header($nameTools);
  56. }
  57. // Tool introduction
  58. Display::display_introduction_section(TOOL_FORUM);
  59. // Tracking
  60. Event::event_access_tool(TOOL_FORUM);
  61. // Forum search
  62. forum_search();
  63. // Footer
  64. if ($origin != 'learnpath') {
  65. Display :: display_footer();
  66. }