calendar.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <?php //$Id: calendar.php 21101 2009-05-30 14:56:54Z iflorespaz $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2004-2008 Dokeos SPRL
  6. Copyright (c) 2003-2005 Ghent University (UGent)
  7. Copyright (c) various contributors
  8. For a full list of contributors, see "credits.txt".
  9. The full license can be read in "license.txt".
  10. This program is free software; you can redistribute it and/or
  11. modify it under the terms of the GNU General Public License
  12. as published by the Free Software Foundation; either version 2
  13. of the License, or (at your option) any later version.
  14. See the GNU General Public License for more details.
  15. Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
  16. Mail: info@dokeos.com
  17. ==============================================================================
  18. */
  19. $language_file = 'agenda';
  20. require_once dirname(__FILE__).'/../inc/global.inc.php';
  21. //session
  22. if(isset($_GET['id_session']))
  23. $_SESSION['id_session'] = Security::remove_XSS($_GET['id_session']);
  24. // the variables for the days and the months
  25. // Defining the shorts for the days
  26. $DaysShort = api_get_week_days_short();
  27. // Defining the days of the week to allow translation of the days
  28. $DaysLong = api_get_week_days_long();
  29. // Defining the months of the year to allow translation of the months
  30. $MonthsLong = api_get_months_long();
  31. @ $iso_lang = Database :: get_language_isocode($language_interface);
  32. if (empty ($iso_lang) )
  33. {
  34. //if there was no valid iso-code, use the english one
  35. $iso_lang = 'en';
  36. }
  37. ?>
  38. <!DOCTYPE html
  39. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  40. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  41. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $iso_lang; ?>" lang="<?php echo $iso_lang; ?>">
  42. <head>
  43. <title>Calendar</title>
  44. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>">
  45. <style type="text/css">
  46. /*<![CDATA[*/
  47. @import "<?php echo api_get_path(WEB_CODE_PATH); ?>css/<?php echo api_get_setting('stylesheets'); ?>/default.css";
  48. .data_table th
  49. {
  50. font-size: 10px;
  51. }
  52. .data_table td
  53. {
  54. font-size: 10px;
  55. width: 25px;
  56. height: 25px;
  57. }
  58. table.calendar td
  59. {
  60. background-color: #f5f5f5;
  61. text-align: center;
  62. }
  63. .data_table td.selected
  64. {
  65. border: 1px solid #ff0000;
  66. background-color: #FFCECE;
  67. }
  68. .data_table td a
  69. {
  70. width: 25px;
  71. height: 25px;
  72. text-decoration: none;
  73. }
  74. .data_table td a:hover
  75. {
  76. background-color: #ffff00;
  77. }
  78. </style>
  79. <script type="text/javascript">
  80. /* <![CDATA[ */
  81. /* added 2004-06-10 by Michael Keck
  82. * we need this for Backwards-Compatibility and resolving problems
  83. * with non DOM browsers, which may have problems with css 2 (like NC 4)
  84. */
  85. var isDOM = (typeof(document.getElementsByTagName) != 'undefined'
  86. && typeof(document.createElement) != 'undefined')
  87. ? 1 : 0;
  88. var isIE4 = (typeof(document.all) != 'undefined'
  89. && parseInt(navigator.appVersion) >= 4)
  90. ? 1 : 0;
  91. var isNS4 = (typeof(document.layers) != 'undefined')
  92. ? 1 : 0;
  93. var capable = (isDOM || isIE4 || isNS4)
  94. ? 1 : 0;
  95. // Uggly fix for Opera and Konqueror 2.2 that are half DOM compliant
  96. if (capable) {
  97. if (typeof(window.opera) != 'undefined') {
  98. var browserName = ' ' + navigator.userAgent.toLowerCase();
  99. if ((browserName.indexOf('konqueror 7') == 0)) {
  100. capable = 0;
  101. }
  102. } else if (typeof(navigator.userAgent) != 'undefined') {
  103. var browserName = ' ' + navigator.userAgent.toLowerCase();
  104. if ((browserName.indexOf('konqueror') > 0) && (browserName.indexOf('konqueror/3') == 0)) {
  105. capable = 0;
  106. }
  107. } // end if... else if...
  108. } // end if
  109. /* ]]> */
  110. </script>
  111. <script type="text/javascript" src="tbl_change.js"></script>
  112. <script type="text/javascript">
  113. /* <![CDATA[ */
  114. var month_names = new Array(
  115. <?php
  116. foreach($MonthsLong as $index => $month)
  117. {
  118. echo '"'.$month.'",';
  119. }
  120. ?>
  121. "");
  122. var day_names = new Array(
  123. <?php
  124. foreach($DaysShort as $index => $day)
  125. {
  126. echo '"'.$day.'",';
  127. }
  128. ?>
  129. "");
  130. /* ]]> */
  131. </script>
  132. </head>
  133. <body onLoad="javascript: initCalendar();">
  134. <div id="calendar_data"></div>
  135. <div id="clock_data"></div>
  136. </body>
  137. </html>