header.inc.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?php
  2. /**
  3. ==============================================================================
  4. * This script displays the Dokeos header.
  5. *
  6. * @package dokeos.include
  7. ==============================================================================
  8. */
  9. /*----------------------------------------
  10. HEADERS SECTION
  11. --------------------------------------*/
  12. /*
  13. * HTTP HEADER
  14. */
  15. //Give a default value to $charset. Should change to UTF-8 some time in the future.
  16. //This parameter should be set in the platform configuration interface in time.
  17. if(empty($charset))
  18. {
  19. $charset = 'ISO-8859-15';
  20. }
  21. //header('Content-Type: text/html; charset='. $charset)
  22. // or die ("WARNING : it remains some characters before &lt;?php bracket or after ?&gt end");
  23. header('Content-Type: text/html; charset='. $charset);
  24. if ( isset($httpHeadXtra) && $httpHeadXtra )
  25. {
  26. foreach($httpHeadXtra as $thisHttpHead)
  27. {
  28. header($thisHttpHead);
  29. }
  30. }
  31. // Get language iso-code for this page - ignore errors
  32. // The error ignorance is due to the non compatibility of function_exists()
  33. // with the object syntax of Database::get_language_isocode()
  34. @$document_language = Database::get_language_isocode($language_interface);
  35. if(empty($document_language))
  36. {
  37. //if there was no valid iso-code, use the english one
  38. $document_language = 'en';
  39. }
  40. /*
  41. * HTML HEADER
  42. */
  43. ?>
  44. <!DOCTYPE html
  45. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  46. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  47. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $document_language; ?>" lang="<?php echo $document_language; ?>">
  48. <head>
  49. <title>
  50. <?php
  51. if(!empty($nameTools))
  52. {
  53. echo $nameTools.' - ';
  54. }
  55. if(!empty($_course['official_code']))
  56. {
  57. echo $_course['official_code'].' - ';
  58. }
  59. echo get_setting('siteName');
  60. ?>
  61. </title>
  62. <style type="text/css" media="screen, projection">
  63. /*<![CDATA[*/
  64. <?php
  65. $my_style = api_get_setting('stylesheets');
  66. $my_code_path = api_get_path(WEB_CODE_PATH);
  67. if(empty($my_style)){$my_style = 'default';}
  68. echo '@import "'.$my_code_path.'css/'.$my_style.'/default.css";'."\n";
  69. echo '@import "'.$my_code_path.'css/'.$my_style.'/course.css";'."\n";
  70. ?>
  71. /*]]>*/
  72. </style>
  73. <style type="text/css" media="print">
  74. /*<![CDATA[*/
  75. <?php
  76. echo '@import "'.$my_code_path.'css/'.$my_style.'/print.css";'."\n";
  77. ?>
  78. /*]]>*/
  79. </style>
  80. <link rel="top" href="<?php echo api_get_path(WEB_PATH); ?>index.php" title="" />
  81. <link rel="courses" href="<?php echo api_get_path(WEB_CODE_PATH) ?>auth/courses.php" title="<?php echo htmlentities(get_lang('OtherCourses')); ?>" />
  82. <link rel="profil" href="<?php echo api_get_path(WEB_CODE_PATH) ?>auth/profile.php" title="<?php echo htmlentities(get_lang('ModifyProfile')); ?>" />
  83. <link href="http://www.dokeos.com/documentation.php" rel="Help" />
  84. <link href="http://www.dokeos.com/team.php" rel="Author" />
  85. <link href="http://www.dokeos.com" rel="Copyright" />
  86. <link rel="shortcut icon" href="<?php echo api_get_path(WEB_PATH); ?>favicon.ico" type="image/x-icon" />
  87. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
  88. <?php
  89. if ( isset($htmlHeadXtra) && $htmlHeadXtra )
  90. {
  91. foreach($htmlHeadXtra as $this_html_head)
  92. {
  93. echo($this_html_head);
  94. }
  95. }
  96. if ( isset($htmlIncHeadXtra) && $htmlIncHeadXtra )
  97. {
  98. foreach($htmlIncHeadXtra as $this_html_head)
  99. {
  100. include($this_html_head);
  101. }
  102. }
  103. //the following include might be subject to a setting proper to the course or platform
  104. include(api_get_path(LIBRARY_PATH).'/javascript/email_links.lib.js.php');
  105. ?>
  106. </head>
  107. <body dir="<?php echo $text_dir ?>" <?php
  108. if(defined('DOKEOS_HOMEPAGE') && DOKEOS_HOMEPAGE)
  109. echo 'onload="javascript:if(document.formLogin) { document.formLogin.login.focus(); }"'; ?>>
  110. <div class="skip">
  111. <ul>
  112. <li><a href="#menu"><?php echo ( get_lang('WCAGGoMenu') )?></a></li>
  113. <li><a href="#content" accesskey="2"><?php echo ( get_lang('WCAGGoContent') )?></a></li>
  114. </ul>
  115. </div>
  116. <!-- #outerframe container to control some general layout of all pages -->
  117. <div id="outerframe">
  118. <?php
  119. // Banner
  120. include(api_get_path(INCLUDE_PATH)."banner.inc.php");
  121. ?>