header.inc.php 4.1 KB

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