chat.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?php // $Id: chat.php 22201 2009-07-17 19:57:03Z cfasanando $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2004 Dokeos S.A.
  6. Copyright (c) 2003 Ghent University (UGent)
  7. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  8. Copyright (c) Olivier Brouckaert
  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: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  17. ==============================================================================
  18. */
  19. /**
  20. ==============================================================================
  21. * Frameset of the Chat tool
  22. *
  23. * @author Olivier Brouckaert
  24. * @package dokeos.chat
  25. ==============================================================================
  26. */
  27. $language_file = array ('chat');
  28. include('../inc/global.inc.php');
  29. $nameTools=get_lang('Chat');
  30. if ($_GET["origin"] != 'whoisonline') {
  31. api_protect_course_script(true);
  32. }
  33. else
  34. {
  35. $origin = $_SESSION['origin'];
  36. $target = $_SESSION['target'];
  37. $_SESSION['origin']=$_GET["origin"];
  38. $_SESSION['target']=$_GET["target"];
  39. }
  40. /* ==============================================================================
  41. TRACKING
  42. ============================================================================== */
  43. event_access_tool(TOOL_CHAT);
  44. header('Content-Type: text/html; charset='. $charset);
  45. /*
  46. * Choose CSS style (platform's, user's, or course's)
  47. */
  48. $platform_theme = api_get_setting('stylesheets'); // plataform's css
  49. $my_style=$platform_theme;
  50. if(api_get_setting('user_selected_theme') == 'true')
  51. {
  52. $useri = api_get_user_info();
  53. $user_theme = $useri['theme'];
  54. if(!empty($user_theme) && $user_theme != $my_style)
  55. {
  56. $my_style = $user_theme; // user's css
  57. }
  58. }
  59. $mycourseid = api_get_course_id();
  60. if (!empty($mycourseid) && $mycourseid != -1)
  61. {
  62. if (api_get_setting('allow_course_theme') == 'true')
  63. {
  64. $mycoursetheme=api_get_course_setting('course_theme');
  65. if (!empty($mycoursetheme) && $mycoursetheme!=-1)
  66. {
  67. if(!empty($mycoursetheme) && $mycoursetheme != $my_style)
  68. {
  69. $my_style = $mycoursetheme; // course's css
  70. }
  71. }
  72. }
  73. $open_chat_window=api_get_course_setting('allow_open_chat_window');
  74. }
  75. if (api_get_setting('show_navigation_menu')!='false') {
  76. $footer_size = 20;
  77. } else {
  78. switch($my_style){
  79. case 'dokeos_classic' :
  80. $footer_size = 48;
  81. break;
  82. case 'academica' :
  83. $footer_size = 140;
  84. break;
  85. case 'silver_line' :
  86. $footer_size = 60;
  87. break;
  88. case 'baby_orange' :
  89. $footer_size = 120;
  90. break;
  91. case 'public_admin' :
  92. $footer_size =90;
  93. break;
  94. default :
  95. $footer_size = 48;
  96. break;
  97. }
  98. }
  99. $cidreq=$_GET['cidReq'];
  100. echo '<html><head>';
  101. echo '<meta http-equiv="Content-Type" content="text/html; charset='.$charset.'" />';
  102. echo'<title>'.get_lang('Chat').' - '.$mycourseid.' - '.api_get_setting('siteName').'</title>';
  103. if (empty($open_chat_window))
  104. {
  105. echo'<frameset rows="135,*,'.$footer_size.'" border="0" frameborder="0" framespacing="1">';
  106. echo '<frame src="chat_banner.php?cidReq='.$cidreq.'" name="chat_banner" scrolling="no">';
  107. }
  108. if (api_get_setting('show_navigation_menu') == 'false' || !empty($open_chat_window)) {
  109. echo '<frameset cols="165,*,0" border="1" frameborder="1" framespacing="1">';
  110. } else {
  111. echo '<frameset cols="165,*,200" border="1" frameborder="1" framespacing="1">';
  112. }
  113. echo '<frame src="chat_whoisonline.php?cidReq='.$cidreq.'" name="chat_whoisonline" scrolling="auto">';
  114. echo'<frameset rows="25,15" border="1" frameborder="1" framespacing="1">';
  115. echo '<frame src="chat_chat.php?origin='.$_GET["origin"].'&target='.$_GET["target"].'&amp;cidReq='.$cidreq.'" name="chat_chat" scrolling="auto">';
  116. echo '<frame src="chat_message.php?cidReq='.$cidreq.'" name="chat_message" scrolling="no">';
  117. echo '</frameset>';
  118. echo '<frame src="chat_hidden.php?cidReq='.$cidreq.'" name="chat_hidden" >';
  119. echo'</frameset>';
  120. if (api_get_setting('show_navigation_menu')=='false') {
  121. if (empty($open_chat_window))
  122. {
  123. echo '<frame src="chat_footer.php?cidReq='.$cidreq.'" name="chat_footer" scrolling="no">';
  124. echo '</frameset>';
  125. }
  126. }
  127. echo'<noframes></noframes>';
  128. echo '</html>';
  129. ?>