calendar_popup.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <?php
  2. // $Id: calendar_popup.php 20456 2009-05-10 17:27:44Z ivantcholakov $
  3. /*
  4. ==============================================================================
  5. Dokeos - elearning and course management software
  6. Copyright (c) 2004-2005 Dokeos S.A.
  7. Copyright (c) Bart Mollet, Hogeschool Gent
  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, 44 rue des palais, B-1030 Brussels, Belgium
  16. Mail: info@dokeos.com
  17. ==============================================================================
  18. */
  19. $language_file = 'agenda';
  20. require_once dirname(__FILE__).'/../../../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. table.calendar {
  45. width: 100%;
  46. font-size: 12px;
  47. font-family: verdana, arial, helvetica, sans-serif;
  48. }
  49. table.calendar .monthyear
  50. {
  51. background-color: #4171B5;
  52. text-align: center;
  53. color: #ffffff;
  54. font-size:12px;
  55. padding:5px;
  56. margin:10px;
  57. }
  58. table.calendar .daynames {
  59. background-color: #D3DFF1;
  60. text-align: center;
  61. }
  62. table.calendar td
  63. {
  64. width: 25px;
  65. height: 25px;
  66. background-color: #f5f5f5;
  67. text-align: center;
  68. }
  69. table.calendar td.selected
  70. {
  71. border: 1px solid #ff0000;
  72. background-color: #FFCECE;
  73. }
  74. table.calendar td a
  75. {
  76. width: 25px;
  77. height: 25px;
  78. text-decoration: none;
  79. }
  80. table.calendar td a:hover
  81. {
  82. background-color: #ffff00;
  83. }
  84. table.calendar td a div
  85. {
  86. padding:5px;
  87. }
  88. table.calendar td a div:hover
  89. {
  90. background-color: #ffff00;
  91. }
  92. table.calendar .monthyear a {
  93. text-align: center;
  94. /* color: #ffffff; */
  95. }
  96. table.calendar .monthyear a:hover
  97. {
  98. text-align: center;
  99. /*color: #ff0000;*/
  100. /*background-color: #ffff00;*/
  101. }
  102. /*]]>*/
  103. </style>
  104. <script type="text/javascript">
  105. /* <![CDATA[ */
  106. /* added 2004-06-10 by Michael Keck
  107. * we need this for Backwards-Compatibility and resolving problems
  108. * with non DOM browsers, which may have problems with css 2 (like NC 4)
  109. */
  110. var isDOM = (typeof(document.getElementsByTagName) != 'undefined'
  111. && typeof(document.createElement) != 'undefined')
  112. ? 1 : 0;
  113. var isIE4 = (typeof(document.all) != 'undefined'
  114. && parseInt(navigator.appVersion) >= 4)
  115. ? 1 : 0;
  116. var isNS4 = (typeof(document.layers) != 'undefined')
  117. ? 1 : 0;
  118. var capable = (isDOM || isIE4 || isNS4)
  119. ? 1 : 0;
  120. // Uggly fix for Opera and Konqueror 2.2 that are half DOM compliant
  121. if (capable) {
  122. if (typeof(window.opera) != 'undefined') {
  123. var browserName = ' ' + navigator.userAgent.toLowerCase();
  124. if ((browserName.indexOf('konqueror 7') == 0)) {
  125. capable = 0;
  126. }
  127. } else if (typeof(navigator.userAgent) != 'undefined') {
  128. var browserName = ' ' + navigator.userAgent.toLowerCase();
  129. if ((browserName.indexOf('konqueror') > 0) && (browserName.indexOf('konqueror/3') == 0)) {
  130. capable = 0;
  131. }
  132. } // end if... else if...
  133. } // end if
  134. /* ]]> */
  135. </script>
  136. <script src="<?php echo api_get_path(WEB_LIBRARY_PATH).'javascript/calendar/tbl_change.js'; ?>"></script>
  137. <script type="text/javascript">
  138. /* <![CDATA[ */
  139. var month_names = new Array(
  140. <?php
  141. foreach($MonthsLong as $index => $month)
  142. {
  143. echo '"'.$month.'",';
  144. }
  145. ?>
  146. "");
  147. var day_names = new Array(
  148. <?php
  149. foreach($DaysShort as $index => $day)
  150. {
  151. echo '"'.$day.'",';
  152. }
  153. ?>
  154. "");
  155. /* ]]> */
  156. </script>
  157. </head>
  158. <body dir="<?php echo api_get_text_direction(); ?>" onLoad="javascript: initCalendar();">
  159. <div id="calendar_data"></div>
  160. <div id="clock_data"></div>
  161. </body>
  162. </html>