header.inc.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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. header('Content-Type: text/html; charset='.api_get_system_encoding());
  13. $navigator_info = api_get_navigator();
  14. //ie6 fix
  15. if ($navigator_info['name'] == 'Internet Explorer' && $navigator_info['version'] == '6') {
  16. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/iepngfix/iepngfix_tilebg.js" type="text/javascript" language="javascript"></script>';
  17. }
  18. if (isset($httpHeadXtra) && $httpHeadXtra) {
  19. foreach ($httpHeadXtra as & $thisHttpHead) {
  20. header($thisHttpHead);
  21. }
  22. }
  23. // Get language iso-code for this page - ignore errors
  24. $document_language = api_get_language_isocode();
  25. /*
  26. * HTML HEADER
  27. */
  28. ?>
  29. <!DOCTYPE html
  30. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  31. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  32. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $document_language; ?>" lang="<?php echo $document_language; ?>">
  33. <head>
  34. <title>
  35. <?php
  36. if (!empty($nameTools)) {
  37. echo $nameTools.' - ';
  38. }
  39. if (!empty($_course['official_code'])) {
  40. echo $_course['official_code'].' - ';
  41. }
  42. echo api_get_setting('siteName');
  43. ?>
  44. </title>
  45. <style type="text/css" media="screen, projection">
  46. /*<![CDATA[*/
  47. <?php
  48. $platform_theme = api_get_setting('stylesheets'); // plataform's css
  49. $my_style = $platform_theme;
  50. if (api_get_setting('user_selected_theme') == 'true') {
  51. $useri = api_get_user_info();
  52. $user_theme = $useri['theme'];
  53. if (!empty($user_theme) && $user_theme != $my_style) {
  54. $my_style = $user_theme; // user's css
  55. }
  56. }
  57. $mycourseid = api_get_course_id();
  58. if (!empty($mycourseid) && $mycourseid != -1) {
  59. if (api_get_setting('allow_course_theme') == 'true') {
  60. $mycoursetheme=api_get_course_setting('course_theme');
  61. if (!empty($mycoursetheme) && $mycoursetheme != -1) {
  62. if (!empty($mycoursetheme) && $mycoursetheme != $my_style) {
  63. $my_style = $mycoursetheme; // course's css
  64. }
  65. }
  66. $mycourselptheme = api_get_course_setting('allow_learning_path_theme');
  67. if (!empty($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
  68. global $lp_theme_css; // it comes from the lp_controller.php
  69. global $lp_theme_config; // it comes from the lp_controller.php
  70. if (!$lp_theme_config) {
  71. if ($lp_theme_css != '') {
  72. $theme = $lp_theme_css;
  73. if (!empty($theme) && $theme != $my_style) {
  74. $my_style = $theme; // LP's css
  75. }
  76. }
  77. }
  78. }
  79. }
  80. }
  81. global $show_learn_path;
  82. if ($show_learn_path) {
  83. $htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'.api_get_path(WEB_CSS_PATH).$my_style.'/learnpath.css"/>';
  84. $htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="dtree.css" />'; //will be moved
  85. $htmlHeadXtra[] = '<script src="dtree.js" type="text/javascript"></script>'; //will be moved
  86. }
  87. if (empty($my_style)) {
  88. $my_style = 'dokeos_classic';
  89. }
  90. echo '@import "'.api_get_path(WEB_CSS_PATH).$my_style.'/default.css";'."\n";
  91. echo '@import "'.api_get_path(WEB_CSS_PATH).$my_style.'/course.css";'."\n";
  92. if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') {
  93. echo 'img, div { behavior: url('.api_get_path(WEB_LIBRARY_PATH).'javascript/iepngfix/iepngfix.htc) } ';
  94. }
  95. ?>
  96. /*]]>*/
  97. </style>
  98. <style type="text/css" media="print">
  99. /*<![CDATA[*/
  100. <?php
  101. echo '@import "'.api_get_path(WEB_CSS_PATH).$my_style.'/print.css";'."\n";
  102. ?>
  103. /*]]>*/
  104. </style>
  105. <link rel="top" href="<?php echo api_get_path(WEB_PATH); ?>index.php" title="" />
  106. <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); ?>" />
  107. <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); ?>" />
  108. <link href="http://www.chamilo.org/documentation.php" rel="Help" />
  109. <link href="http://www.chamilo.org/team.php" rel="Author" />
  110. <link href="http://www.chamilo.org" rel="Copyright" />
  111. <link rel="shortcut icon" href="<?php echo api_get_path(WEB_PATH); ?>favicon.ico" type="image/x-icon" />
  112. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo api_get_system_encoding(); ?>" />
  113. <script type="text/javascript">
  114. //<![CDATA[
  115. // This is a patch for the "__flash__removeCallback" bug, see FS#4378.
  116. if ( ( navigator.userAgent.toLowerCase().indexOf('msie') != -1 ) && ( navigator.userAgent.toLowerCase().indexOf( 'opera' ) == -1 ) )
  117. {
  118. window.attachEvent( 'onunload', function()
  119. {
  120. window['__flash__removeCallback'] = function ( instance, name )
  121. {
  122. try
  123. {
  124. if ( instance )
  125. {
  126. instance[name] = null ;
  127. }
  128. }
  129. catch ( flashEx )
  130. {
  131. }
  132. } ;
  133. }
  134. ) ;
  135. }
  136. //]]>
  137. </script>
  138. <?php
  139. if (isset($htmlHeadXtra) && $htmlHeadXtra) {
  140. foreach ($htmlHeadXtra as & $this_html_head) {
  141. echo $this_html_head;
  142. }
  143. }
  144. if (isset($htmlIncHeadXtra) && $htmlIncHeadXtra) {
  145. foreach ($htmlIncHeadXtra as & $this_html_head) {
  146. include($this_html_head);
  147. }
  148. }
  149. // The following include might be subject to a setting proper to the course or platform.
  150. include api_get_path(LIBRARY_PATH).'javascript/email_links.lib.js.php';
  151. ?>
  152. </head>
  153. <body dir="<?php echo api_get_text_direction(); ?>" <?php
  154. if (defined('DOKEOS_HOMEPAGE') && DOKEOS_HOMEPAGE)
  155. echo 'onload="javascript: if(document.formLogin) { document.formLogin.login.focus(); }"'; ?>>
  156. <div class="skip">
  157. <ul>
  158. <li><a href="#menu"><?php echo get_lang('WCAGGoMenu'); ?></a></li>
  159. <li><a href="#content" accesskey="2"><?php echo get_lang('WCAGGoContent'); ?></a></li>
  160. </ul>
  161. </div>
  162. <?php
  163. // Banner
  164. require_once api_get_path(INCLUDE_PATH).'banner.inc.php';