dokeos-chat
[ class tree: dokeos-chat ] [ index: dokeos-chat ] [ all elements ]

Source for file header_frame.inc.php

Documentation is available at header_frame.inc.php

  1. <?php // $Id: header_frame.inc.php,v 1.2 2005/05/01 11:49:16 darkden81 Exp $
  2. /*
  3. ==============================================================================
  4.     Dokeos - elearning and course management software
  5.  
  6.     Copyright (c) 2004 Dokeos S.A.
  7.     Copyright (c) 2003 Ghent University (UGent)
  8.     Copyright (c) 2001 Universite catholique de Louvain (UCL)
  9.     Copyright (c) Olivier Brouckaert
  10.  
  11.     For a full list of contributors, see "credits.txt".
  12.     The full license can be read in "license.txt".
  13.  
  14.     This program is free software; you can redistribute it and/or
  15.     modify it under the terms of the GNU General Public License
  16.     as published by the Free Software Foundation; either version 2
  17.     of the License, or (at your option) any later version.
  18.  
  19.     See the GNU General Public License for more details.
  20.  
  21.     Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  22. ==============================================================================
  23. */
  24. /**
  25. ==============================================================================
  26. *    Header of each frame of the Chat tool
  27. *
  28. *    @author Olivier Brouckaert
  29. *   @modified by Denes Nagy
  30. *    @package dokeos.chat
  31. ==============================================================================
  32. */
  33.  
  34. if(!defined('FRAME'))
  35. {
  36.     exit();
  37. }
  38.  
  39. $bodyXtra='';
  40.  
  41. if(FRAME == 'hidden')
  42. {
  43.     $bodyXtra='onload="javascript:updateChat(); updateConnected(); setTimeout(\'submitHiddenForm();\',5000);"';
  44. }
  45. elseif(FRAME == 'message')
  46. {
  47.     $bodyXtra='onload="javascript:eventMessage();"';
  48. }
  49.  
  50.  
  51. /*
  52.  * Choose CSS style (platform's, user's, or course's) 
  53.  */
  54.  
  55. $platform_theme api_get_setting('stylesheets');     // plataform's css
  56. $my_style=$platform_theme;
  57. if(api_get_setting('user_selected_theme'== 'true'
  58. {        
  59.     $useri api_get_user_info();
  60.     $user_theme $useri['theme'];
  61.     if(!empty($user_theme&& $user_theme != $my_style)
  62.     {
  63.         $my_style $user_theme;                    // user's css
  64.     }
  65. }
  66.  
  67. $mycourseid api_get_course_id();
  68.  
  69. if (!empty($mycourseid&& $mycourseid != -1
  70. {    
  71.     if (api_get_setting('allow_course_theme'== 'true'
  72.     {    
  73.         $mycoursetheme=api_get_course_setting('course_theme');            
  74.         if (!empty($mycoursetheme&& $mycoursetheme!=-1)         
  75.         {                            
  76.             if(!empty($mycoursetheme&& $mycoursetheme != $my_style)
  77.             {                
  78.                 $my_style $mycoursetheme;        // course's css
  79.             }            
  80.         }                
  81.     
  82.     }
  83. }
  84.  
  85. if (empty($mycourseid))
  86. {
  87.     // if it is not set $mycourse id we reload the chat_message window in order to hide the
  88.     // textarea to submit a message
  89.     echo '<script type="text/javascript" language="javascript">';
  90.     echo "parent.chat_message.location.href='chat_whoisonline.php';";
  91.     echo '</script>';
  92. }
  93. ?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  94. <html>
  95. <head>
  96. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset;?>">
  97. <title>Chat</title>
  98. <link rel="stylesheet" type="text/css" href="../css/<?php echo $my_style?>/default.css">
  99. <style>
  100.     a{
  101.         font-size: 12px;
  102.     }
  103.     
  104.     .background_submit{
  105.         background: url(../img/chat_little.gif) 2px 2px no-repeat;
  106.         padding: 2px 1px 1px 20px;
  107.     }
  108.     TH{
  109.         font-size: 12px;
  110.     }
  111. </style>
  112.  
  113. <script type="text/javascript" language="javascript">
  114. <!--
  115. function updateChat()
  116. {
  117.     if('<?php echo $chat_size_old?>' != '<?php echo $chat_size_new?>')
  118.     {
  119.         parent.chat_chat.location.href='chat_chat.php?size=<?php echo $chat_size_new?>#bottom';                
  120.     }
  121. }
  122.  
  123. function updateConnected()
  124. {
  125.     if('<?php echo $connected_old?>' != '<?php echo $connected_new?>')
  126.     {
  127.         parent.chat_whoisonline.location.href='chat_whoisonline.php?size=<?php echo $connected_new?>';
  128.     }
  129. }
  130.  
  131. function submitHiddenForm()
  132. {
  133.     document.formHidden.submit();
  134. }
  135.  
  136. function eventMessage()
  137. {
  138.     <?php if($chat_size)?>
  139.     parent.chat_hidden.document.formHidden.chat_size_old.value='<?php echo $chat_size?>';
  140.     parent.chat_chat.location.href='chat_chat.php?size=<?php echo $chat_size?>#bottom';
  141.     <?php endif?>
  142.  
  143.     document.formMessage.message.focus();
  144. }
  145.  
  146. function send_message(evenement){
  147.  
  148.     for (prop in evenement)
  149.     {
  150.         if(prop == 'which') touche = evenement.which; else touche = evenement.keyCode;
  151.     }
  152.     
  153.     if (touche == 13)
  154.     {
  155.         document.formMessage.submit();
  156.     }
  157. }
  158.  
  159. //-->
  160. </script>
  161.  
  162. </head>
  163. <body <?php echo $bodyXtra?> >

Documentation generated on Thu, 12 Jun 2008 13:38:39 -0500 by phpDocumentor 1.4.1