calendar.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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 = api_get_language_isocode($language_interface);
  32. header('Content-Type: text/html; charset='. api_get_system_encoding());
  33. ?>
  34. <!DOCTYPE html
  35. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  36. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  37. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $iso_lang; ?>" lang="<?php echo $iso_lang; ?>">
  38. <head>
  39. <title>Calendar</title>
  40. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo api_get_system_encoding(); ?>">
  41. <style type="text/css">
  42. /*<![CDATA[*/
  43. @import "<?php echo api_get_path(WEB_CODE_PATH); ?>css/<?php echo api_get_setting('stylesheets'); ?>/default.css";
  44. .data_table th
  45. {
  46. font-size: 10px;
  47. }
  48. .data_table td
  49. {
  50. font-size: 10px;
  51. width: 25px;
  52. height: 25px;
  53. }
  54. table.calendar td
  55. {
  56. background-color: #f5f5f5;
  57. text-align: center;
  58. }
  59. .data_table td.selected
  60. {
  61. border: 1px solid #ff0000;
  62. background-color: #FFCECE;
  63. }
  64. .data_table td a
  65. {
  66. width: 25px;
  67. height: 25px;
  68. text-decoration: none;
  69. }
  70. .data_table td a:hover
  71. {
  72. background-color: #ffff00;
  73. }
  74. </style>
  75. <script type="text/javascript">
  76. /* <![CDATA[ */
  77. /* added 2004-06-10 by Michael Keck
  78. * we need this for Backwards-Compatibility and resolving problems
  79. * with non DOM browsers, which may have problems with css 2 (like NC 4)
  80. */
  81. var isDOM = (typeof(document.getElementsByTagName) != 'undefined'
  82. && typeof(document.createElement) != 'undefined')
  83. ? 1 : 0;
  84. var isIE4 = (typeof(document.all) != 'undefined'
  85. && parseInt(navigator.appVersion) >= 4)
  86. ? 1 : 0;
  87. var isNS4 = (typeof(document.layers) != 'undefined')
  88. ? 1 : 0;
  89. var capable = (isDOM || isIE4 || isNS4)
  90. ? 1 : 0;
  91. // Uggly fix for Opera and Konqueror 2.2 that are half DOM compliant
  92. if (capable) {
  93. if (typeof(window.opera) != 'undefined') {
  94. var browserName = ' ' + navigator.userAgent.toLowerCase();
  95. if ((browserName.indexOf('konqueror 7') == 0)) {
  96. capable = 0;
  97. }
  98. } else if (typeof(navigator.userAgent) != 'undefined') {
  99. var browserName = ' ' + navigator.userAgent.toLowerCase();
  100. if ((browserName.indexOf('konqueror') > 0) && (browserName.indexOf('konqueror/3') == 0)) {
  101. capable = 0;
  102. }
  103. } // end if... else if...
  104. } // end if
  105. /* ]]> */
  106. </script>
  107. <script type="text/javascript" src="tbl_change.js"></script>
  108. <script type="text/javascript">
  109. /* <![CDATA[ */
  110. var month_names = new Array(
  111. <?php
  112. foreach($MonthsLong as $index => $month)
  113. {
  114. echo '"'.$month.'",';
  115. }
  116. ?>
  117. "");
  118. var day_names = new Array(
  119. <?php
  120. foreach($DaysShort as $index => $day)
  121. {
  122. echo '"'.$day.'",';
  123. }
  124. ?>
  125. "");
  126. /* ]]> */
  127. </script>
  128. </head>
  129. <body dir="<?php echo api_get_text_direction(); ?>" onLoad="javascript: initCalendar();">
  130. <div id="calendar_data"></div>
  131. <div id="clock_data"></div>
  132. </body>
  133. </html>