calendar.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. $language_file = 'agenda';
  4. require_once dirname(__FILE__).'/../inc/global.inc.php';
  5. //session
  6. if(isset($_GET['id_session']))
  7. $_SESSION['id_session'] = Security::remove_XSS($_GET['id_session']);
  8. // the variables for the days and the months
  9. // Defining the shorts for the days
  10. $DaysShort = api_get_week_days_short();
  11. // Defining the days of the week to allow translation of the days
  12. $DaysLong = api_get_week_days_long();
  13. // Defining the months of the year to allow translation of the months
  14. $MonthsLong = api_get_months_long();
  15. $iso_lang = api_get_language_isocode($language_interface);
  16. header('Content-Type: text/html; charset='. api_get_system_encoding());
  17. ?>
  18. <!DOCTYPE html
  19. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  20. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  21. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $iso_lang; ?>" lang="<?php echo $iso_lang; ?>">
  22. <head>
  23. <title>Calendar</title>
  24. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo api_get_system_encoding(); ?>">
  25. <style type="text/css">
  26. /*<![CDATA[*/
  27. @import "<?php echo api_get_path(WEB_CODE_PATH); ?>css/<?php echo api_get_setting('stylesheets'); ?>/default.css";
  28. .data_table th
  29. {
  30. font-size: 10px;
  31. }
  32. .data_table td
  33. {
  34. font-size: 10px;
  35. width: 25px;
  36. height: 25px;
  37. }
  38. table.calendar td
  39. {
  40. background-color: #f5f5f5;
  41. text-align: center;
  42. }
  43. .data_table td.selected
  44. {
  45. border: 1px solid #ff0000;
  46. background-color: #FFCECE;
  47. }
  48. .data_table td a
  49. {
  50. width: 25px;
  51. height: 25px;
  52. text-decoration: none;
  53. }
  54. .data_table td a:hover
  55. {
  56. background-color: #ffff00;
  57. }
  58. </style>
  59. <script type="text/javascript">
  60. /* <![CDATA[ */
  61. /* added 2004-06-10 by Michael Keck
  62. * we need this for Backwards-Compatibility and resolving problems
  63. * with non DOM browsers, which may have problems with css 2 (like NC 4)
  64. */
  65. var isDOM = (typeof(document.getElementsByTagName) != 'undefined'
  66. && typeof(document.createElement) != 'undefined')
  67. ? 1 : 0;
  68. var isIE4 = (typeof(document.all) != 'undefined'
  69. && parseInt(navigator.appVersion) >= 4)
  70. ? 1 : 0;
  71. var isNS4 = (typeof(document.layers) != 'undefined')
  72. ? 1 : 0;
  73. var capable = (isDOM || isIE4 || isNS4)
  74. ? 1 : 0;
  75. // Uggly fix for Opera and Konqueror 2.2 that are half DOM compliant
  76. if (capable) {
  77. if (typeof(window.opera) != 'undefined') {
  78. var browserName = ' ' + navigator.userAgent.toLowerCase();
  79. if ((browserName.indexOf('konqueror 7') == 0)) {
  80. capable = 0;
  81. }
  82. } else if (typeof(navigator.userAgent) != 'undefined') {
  83. var browserName = ' ' + navigator.userAgent.toLowerCase();
  84. if ((browserName.indexOf('konqueror') > 0) && (browserName.indexOf('konqueror/3') == 0)) {
  85. capable = 0;
  86. }
  87. } // end if... else if...
  88. } // end if
  89. /* ]]> */
  90. </script>
  91. <script type="text/javascript" src="tbl_change.js"></script>
  92. <script type="text/javascript">
  93. /* <![CDATA[ */
  94. var month_names = new Array(
  95. <?php
  96. foreach($MonthsLong as $index => $month)
  97. {
  98. echo '"'.$month.'",';
  99. }
  100. ?>
  101. "");
  102. var day_names = new Array(
  103. <?php
  104. foreach($DaysShort as $index => $day)
  105. {
  106. echo '"'.$day.'",';
  107. }
  108. ?>
  109. "");
  110. /* ]]> */
  111. </script>
  112. </head>
  113. <body dir="<?php echo api_get_text_direction(); ?>" onLoad="javascript: initCalendar();">
  114. <div id="calendar_data"></div>
  115. <div id="clock_data"></div>
  116. </body>
  117. </html>