header_frame.inc.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?php
  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. * Header of each frame of the Online conference tool
  22. *
  23. * @author Olivier Brouckaert
  24. * @package dokeos.online
  25. ==============================================================================
  26. */
  27. if(!defined('FRAME'))
  28. {
  29. exit();
  30. }
  31. $bodyXtra='';
  32. if(FRAME == 'hidden1')
  33. {
  34. $bodyXtra='onload="javascript:'.($isMaster?'saveDocumentURL();':'getDocumentURL(); updateStreaming();').' updateChat(); updateConnected(); setTimeout(\'submitHiddenForm();\',5000);"';
  35. }
  36. elseif(FRAME == 'htmlarea')
  37. {
  38. if($isMaster)
  39. {
  40. $bodyXtra='onload="javascript:setTimeout(\'saveHTMLareaContent();\',3000);"';
  41. }
  42. }
  43. elseif(FRAME == 'master' || FRAME == 'streaming')
  44. {
  45. if($isMaster)
  46. {
  47. $bodyXtra='scroll="no"';
  48. }
  49. }
  50. elseif(FRAME == 'message')
  51. {
  52. $bodyXtra='onload="javascript:eventMessage();"';
  53. }
  54. ?>
  55. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  56. <html>
  57. <head>
  58. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  59. <title>Online Conference</title>
  60. <?php
  61. if(FRAME != 'htmlarea' || $isMaster)
  62. {
  63. ?>
  64. <link rel="stylesheet" type="text/css" href="../css/online.css">
  65. <?php
  66. }
  67. ?>
  68. <script type="text/javascript">
  69. /* <![CDATA[ */
  70. function saveDocumentURL()
  71. {
  72. document.formHidden.document.value=parent.online_working_area.location.href;
  73. }
  74. function getDocumentURL()
  75. {
  76. currentDocument=parent.online_working_area.location.href;
  77. newDocument=document.formHidden.document.value;
  78. if(currentDocument != newDocument)
  79. {
  80. parent.online_working_area.location.href=newDocument;
  81. }
  82. }
  83. function updateChat()
  84. {
  85. if('<?php echo $chat_size_old; ?>' != '<?php echo $chat_size_new; ?>')
  86. {
  87. parent.online_chat.location.href='online_chat.php?size=<?php echo $chat_size_new; ?>#bottom';
  88. }
  89. }
  90. function updateConnected()
  91. {
  92. if('<?php echo $connected_old; ?>' != '<?php echo $connected_new; ?>')
  93. {
  94. parent.online_whoisonline.location.href='online_whoisonline.php?size=<?php echo $connected_new; ?>';
  95. }
  96. }
  97. function updateStreaming()
  98. {
  99. if('<?php echo $streaming_old; ?>' != '<?php echo $streaming_new; ?>')
  100. {
  101. parent.online_master.location.href='online_master.php?md5=<?php echo $streaming_new; ?>';
  102. }
  103. }
  104. function submitHiddenForm()
  105. {
  106. document.formHidden.submit();
  107. }
  108. function saveHTMLareaContent()
  109. {
  110. document.formHTMLarea.onsubmit();
  111. document.formHTMLarea.submit();
  112. setTimeout('saveHTMLareaContent();',3000);
  113. }
  114. function eventMessage()
  115. {
  116. <?php if($chat_size): ?>
  117. parent.online_hidden1.document.formHidden.chat_size_old.value='<?php echo $chat_size; ?>';
  118. parent.online_chat.location.href='online_chat.php?size=<?php echo $chat_size; ?>#bottom';
  119. <?php endif; ?>
  120. document.formMessage.message.focus();
  121. }
  122. /* ]]> */
  123. </script>
  124. </head>
  125. <body <?php echo $bodyXtra; ?> >