calendar.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. .data_table th
  28. {
  29. font-size: 10px;
  30. }
  31. .data_table td
  32. {
  33. font-size: 10px;
  34. width: 25px;
  35. height: 25px;
  36. }
  37. table.calendar td
  38. {
  39. background-color: #f5f5f5;
  40. text-align: center;
  41. }
  42. .data_table td.selected
  43. {
  44. border: 1px solid #ff0000;
  45. background-color: #FFCECE;
  46. }
  47. .data_table td a
  48. {
  49. width: 25px;
  50. height: 25px;
  51. text-decoration: none;
  52. }
  53. .data_table td a:hover
  54. {
  55. background-color: #ffff00;
  56. }
  57. </style>
  58. <script type="text/javascript">
  59. /* <![CDATA[ */
  60. /* added 2004-06-10 by Michael Keck
  61. * we need this for Backwards-Compatibility and resolving problems
  62. * with non DOM browsers, which may have problems with css 2 (like NC 4)
  63. */
  64. var isDOM = (typeof(document.getElementsByTagName) != 'undefined'
  65. && typeof(document.createElement) != 'undefined')
  66. ? 1 : 0;
  67. var isIE4 = (typeof(document.all) != 'undefined'
  68. && parseInt(navigator.appVersion) >= 4)
  69. ? 1 : 0;
  70. var isNS4 = (typeof(document.layers) != 'undefined')
  71. ? 1 : 0;
  72. var capable = (isDOM || isIE4 || isNS4)
  73. ? 1 : 0;
  74. // Uggly fix for Opera and Konqueror 2.2 that are half DOM compliant
  75. if (capable) {
  76. if (typeof(window.opera) != 'undefined') {
  77. var browserName = ' ' + navigator.userAgent.toLowerCase();
  78. if ((browserName.indexOf('konqueror 7') == 0)) {
  79. capable = 0;
  80. }
  81. } else if (typeof(navigator.userAgent) != 'undefined') {
  82. var browserName = ' ' + navigator.userAgent.toLowerCase();
  83. if ((browserName.indexOf('konqueror') > 0) && (browserName.indexOf('konqueror/3') == 0)) {
  84. capable = 0;
  85. }
  86. } // end if... else if...
  87. } // end if
  88. /* ]]> */
  89. </script>
  90. <script>
  91. /* <![CDATA[ */
  92. var month_names = new Array(
  93. <?php
  94. foreach($MonthsLong as $index => $month)
  95. {
  96. echo '"'.$month.'",';
  97. }
  98. ?>
  99. "");
  100. var day_names = new Array(
  101. <?php
  102. foreach($DaysShort as $index => $day)
  103. {
  104. echo '"'.$day.'",';
  105. }
  106. ?>
  107. "");
  108. /* ]]> */
  109. </script>
  110. </head>
  111. <body dir="<?php echo api_get_text_direction(); ?>" onLoad="javascript: initCalendar();">
  112. <div id="calendar_data"></div>
  113. <div id="clock_data"></div>
  114. </body>
  115. </html>