forumsearch.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?php // $Id: document.php 16494 2008-10-10 22:07:36Z yannoo $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2004-2008 Dokeos SPRL
  6. Copyright (c) 2003 Ghent University (UGent)
  7. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  8. Copyright (c) various contributors
  9. For a full list of contributors, see "credits.txt".
  10. The full license can be read in "license.txt".
  11. This program is free software; you can redistribute it and/or
  12. modify it under the terms of the GNU General Public License
  13. as published by the Free Software Foundation; either version 2
  14. of the License, or (at your option) any later version.
  15. See the GNU General Public License for more details.
  16. Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
  17. Mail: info@dokeos.com
  18. ==============================================================================
  19. */
  20. /**
  21. * These files are a complete rework of the forum. The database structure is
  22. * based on phpBB but all the code is rewritten. A lot of new functionalities
  23. * are added:
  24. * - forum categories and forums can be sorted up or down, locked or made invisible
  25. * - consistent and integrated forum administration
  26. * - forum options: are students allowed to edit their post?
  27. * moderation of posts (approval)
  28. * reply only forums (students cannot create new threads)
  29. * multiple forums per group
  30. * - sticky messages
  31. * - new view option: nested view
  32. * - quoting a message
  33. *
  34. * @Author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  35. * @Copyright Ghent University
  36. * @Copyright Patrick Cool
  37. *
  38. * @package dokeos.forum
  39. */
  40. // name of the language file that needs to be included
  41. $language_file = array (
  42. 'forum',
  43. 'group'
  44. );
  45. // including the global dokeos file
  46. require ('../inc/global.inc.php');
  47. // the section (tabs)
  48. $this_section=SECTION_COURSES;
  49. // notice for unauthorized people.
  50. api_protect_course_script(true);
  51. // including additional library scripts
  52. require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
  53. include_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
  54. include('forumfunction.inc.php');
  55. include('forumconfig.inc.php');
  56. //are we in a lp ?
  57. $origin = '';
  58. if (isset($_GET['origin'])) {
  59. $origin = Security::remove_XSS($_GET['origin']);
  60. }
  61. // name of the tool
  62. $nameTools=get_lang('Forum');
  63. // breadcrumbs
  64. if (isset($_SESSION['gradebook'])){
  65. $gradebook= $_SESSION['gradebook'];
  66. }
  67. if (!empty($gradebook) && $gradebook=='view') {
  68. $interbreadcrumb[]= array (
  69. 'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
  70. 'name' => get_lang('Gradebook')
  71. );
  72. }
  73. if (!empty ($_GET['gidReq'])) {
  74. $toolgroup = Database::escape_string($_GET['gidReq']);
  75. api_session_register('toolgroup');
  76. }
  77. if (!empty($_SESSION['toolgroup'])) {
  78. $_clean['toolgroup']=(int)$_SESSION['toolgroup'];
  79. $group_properties = GroupManager :: get_group_properties($_clean['toolgroup']);
  80. $interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups'));
  81. $interbreadcrumb[] = array ("url" => "../group/group_space.php?gidReq=".$_SESSION['toolgroup'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')');
  82. $interbreadcrumb[] = array ("url" => "viewforum.php?origin=".$origin."&amp;gidReq=".$_SESSION['toolgroup']."&amp;forum=".Security::remove_XSS($_GET['forum']),"name" => prepare4display($current_forum['forum_title']));
  83. $interbreadcrumb[]=array('url' => 'forumsearch.php','name' => get_lang('ForumSearch'));
  84. } else {
  85. $interbreadcrumb[]=array('url' => 'index.php?gradebook='.$gradebook.'','name' => $nameTools);
  86. $interbreadcrumb[]=array('url' => 'forumsearch.php','name' => get_lang('ForumSearch'));
  87. }
  88. // Display the header
  89. if ($origin=='learnpath') {
  90. include(api_get_path(INCLUDE_PATH).'reduced_header.inc.php');
  91. } else {
  92. Display :: display_header($nameTools);
  93. }
  94. // Display the tool title
  95. // api_display_tool_title($nameTools);
  96. // Tool introduction
  97. Display::display_introduction_section(TOOL_FORUM);
  98. // tracking
  99. event_access_tool(TOOL_FORUM);
  100. // forum search
  101. forum_search();
  102. // footer
  103. if ($origin!='learnpath') {
  104. Display :: display_footer();
  105. }