header.inc.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * This script displays the Chamilo header.
  5. *
  6. * @package chamilo.include
  7. */
  8. /* HEADERS SECTION */
  9. /*
  10. * HTTP HEADER
  11. */
  12. // Server mode indicator.
  13. if (api_is_platform_admin()) {
  14. if (api_get_setting('server_type') == 'test') {
  15. $mtime = microtime();
  16. $mtime = explode(" ",$mtime);
  17. $mtime = $mtime[1] + $mtime[0];
  18. $starttime = $mtime;
  19. $_SESSION['page_start_time_execution'] = $starttime;
  20. }
  21. }
  22. header('Content-Type: text/html; charset='.api_get_system_encoding());
  23. $navigator_info = api_get_navigator();
  24. //ie6 fix
  25. if ($navigator_info['name'] == 'Internet Explorer' && $navigator_info['version'] == '6') {
  26. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/iepngfix/iepngfix_tilebg.js" type="text/javascript" language="javascript"></script>';
  27. }
  28. if (isset($httpHeadXtra) && $httpHeadXtra) {
  29. foreach ($httpHeadXtra as & $thisHttpHead) {
  30. header($thisHttpHead);
  31. }
  32. }
  33. // Get language iso-code for this page - ignore errors
  34. $document_language = api_get_language_isocode();
  35. /*
  36. * HTML HEADER
  37. */
  38. ?>
  39. <!DOCTYPE html
  40. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  41. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  42. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $document_language; ?>" lang="<?php echo $document_language; ?>">
  43. <head>
  44. <title>
  45. <?php
  46. $title_list[] = api_get_setting('siteName');
  47. $title_list[] = $nameTools;
  48. $title_list[] = $_course['official_code'];
  49. $title_string = '';
  50. for($i=0; $i<count($title_list);$i++) {
  51. if (!empty($title_list[$i])) {
  52. $title_string .=$title_list[$i];
  53. if (isset($title_list[$i+1])) {
  54. $title_string .=' - ';
  55. }
  56. }
  57. }
  58. echo $title_string;
  59. ?>
  60. </title>
  61. <style type="text/css" media="screen, projection">
  62. /*<![CDATA[*/
  63. <?php
  64. $platform_theme = api_get_setting('stylesheets');
  65. $my_style = api_get_visual_theme();
  66. global $show_learn_path;
  67. if ($show_learn_path) {
  68. $htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'.api_get_path(WEB_CSS_PATH).$my_style.'/learnpath.css"/>';
  69. $htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="dtree.css" />'; //will be moved
  70. $htmlHeadXtra[] = '<script src="dtree.js" type="text/javascript"></script>'; //will be moved
  71. }
  72. echo '@import "'.api_get_path(WEB_CSS_PATH).$my_style.'/default.css";'."\n";
  73. echo '@import "'.api_get_path(WEB_CSS_PATH).$my_style.'/course.css";'."\n";
  74. if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') {
  75. echo 'img, div { behavior: url('.api_get_path(WEB_LIBRARY_PATH).'javascript/iepngfix/iepngfix.htc) } ';
  76. }
  77. ?>
  78. /*]]>*/
  79. </style>
  80. <style type="text/css" media="print">
  81. /*<![CDATA[*/
  82. <?php
  83. echo '@import "'.api_get_path(WEB_CSS_PATH).$my_style.'/print.css";'."\n";
  84. ?>
  85. /*]]>*/
  86. </style>
  87. <script src="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/jquery.js" type="text/javascript" ></script>
  88. <script src="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/thickbox.js" type="text/javascript" ></script>
  89. <link rel="stylesheet" href="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/thickbox.css" type="text/css" media="projection, screen" />
  90. <link rel="top" href="<?php echo api_get_path(WEB_PATH); ?>index.php" title="" />
  91. <link rel="courses" href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/courses.php" title="<?php echo api_htmlentities(get_lang('OtherCourses'), ENT_QUOTES); ?>" />
  92. <link rel="profil" href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/profile.php" title="<?php echo api_htmlentities(get_lang('ModifyProfile'), ENT_QUOTES); ?>" />
  93. <link href="http://www.chamilo.org/documentation.php" rel="Help" />
  94. <link href="http://www.chamilo.org/team.php" rel="Author" />
  95. <link href="http://www.chamilo.org" rel="Copyright" />
  96. <link rel="shortcut icon" href="<?php echo api_get_path(WEB_PATH); ?>favicon.ico" type="image/x-icon" />
  97. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo api_get_system_encoding(); ?>" />
  98. <script src= "<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/jquery.menu.js" type="text/javascript"></script>
  99. <?php if (!empty($help)) { ?>
  100. <ul id="navigation">
  101. <li class="help"> <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>help/help.php?open=Home&height=400&width=600", class="thickbox" title="<?php echo get_lang('Help'); ?>"></a> </li>
  102. <li class="report"> <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>help/help.php?open=Home&height=400&width=600", class="thickbox" title="<?php echo get_lang('Help'); ?>"></a> </li>
  103. <li class="student"> <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>help/help.php?open=Home&height=400&width=600", class="thickbox" title="<?php echo get_lang('Help'); ?>"></a> </li>
  104. <li class="user-online"> <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>help/help.php?open=Home&height=400&width=600", class="thickbox" title="<?php echo get_lang('Help'); ?>"></a> </li>
  105. <li class="user-connect"> <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>help/help.php?open=Home&height=400&width=600", class="thickbox" title="<?php echo get_lang('Help'); ?>"></a> </li>
  106. <li class="student-connect"> <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>help/help.php?open=Home&height=400&width=600", class="thickbox" title="<?php echo get_lang('Help'); ?>"></a> </li>
  107. </ul>
  108. <?php } ?>
  109. <script type="text/javascript">
  110. //<![CDATA[
  111. // This is a patch for the "__flash__removeCallback" bug, see FS#4378.
  112. if ( ( navigator.userAgent.toLowerCase().indexOf('msie') != -1 ) && ( navigator.userAgent.toLowerCase().indexOf( 'opera' ) == -1 ) )
  113. {
  114. window.attachEvent( 'onunload', function()
  115. {
  116. window['__flash__removeCallback'] = function ( instance, name )
  117. {
  118. try
  119. {
  120. if ( instance )
  121. {
  122. instance[name] = null ;
  123. }
  124. }
  125. catch ( flashEx )
  126. {
  127. }
  128. } ;
  129. }
  130. ) ;
  131. }
  132. //]]>
  133. </script>
  134. <?php
  135. if (isset($htmlHeadXtra) && $htmlHeadXtra) {
  136. foreach ($htmlHeadXtra as & $this_html_head) {
  137. echo $this_html_head;
  138. }
  139. }
  140. if (isset($htmlIncHeadXtra) && $htmlIncHeadXtra) {
  141. foreach ($htmlIncHeadXtra as & $this_html_head) {
  142. include($this_html_head);
  143. }
  144. }
  145. // The following include might be subject to a setting proper to the course or platform.
  146. include api_get_path(LIBRARY_PATH).'javascript/email_links.lib.js.php';
  147. ?>
  148. </head>
  149. <body dir="<?php echo api_get_text_direction(); ?>" <?php
  150. if (defined('DOKEOS_HOMEPAGE') && DOKEOS_HOMEPAGE)
  151. echo 'onload="javascript: if(document.formLogin) { document.formLogin.login.focus(); }"'; ?>>
  152. <div class="skip">
  153. <ul>
  154. <li><a href="#menu"><?php echo get_lang('WCAGGoMenu'); ?></a></li>
  155. <li><a href="#content" accesskey="2"><?php echo get_lang('WCAGGoContent'); ?></a></li>
  156. </ul>
  157. </div>
  158. <?php
  159. // Banner
  160. require_once api_get_path(INCLUDE_PATH).'banner.inc.php';