reduced_header.inc.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <?php
  2. /**
  3. ==============================================================================
  4. * This script displays the Dokeos header up to the </head> tag
  5. * IT IS A COPY OF header.inc.php EXCEPT that it doesn't start the body
  6. * output.
  7. *
  8. * @package dokeos.include
  9. ==============================================================================
  10. */
  11. /*----------------------------------------
  12. HEADERS SECTION
  13. --------------------------------------*/
  14. /*
  15. * HTTP HEADER
  16. */
  17. //Give a default value to $charset. Should change to UTF-8 some time in the future.
  18. //This parameter should be set in the platform configuration interface in time.
  19. if(empty($charset))
  20. {
  21. $charset = 'ISO-8859-15';
  22. }
  23. //header('Content-Type: text/html; charset='. $charset)
  24. // or die ("WARNING : it remains some characters before &lt;?php bracket or after ?&gt end");
  25. header('Content-Type: text/html; charset='. $charset);
  26. if ( isset($httpHeadXtra) && $httpHeadXtra )
  27. {
  28. foreach($httpHeadXtra as $thisHttpHead)
  29. {
  30. header($thisHttpHead);
  31. }
  32. }
  33. // Get language iso-code for this page - ignore errors
  34. // The error ignorance is due to the non compatibility of function_exists()
  35. // with the object syntax of Database::get_language_isocode()
  36. @$document_language = Database::get_language_isocode($language_interface);
  37. if(empty($document_language))
  38. {
  39. //if there was no valid iso-code, use the english one
  40. $document_language = 'en';
  41. }
  42. /*
  43. * HTML HEADER
  44. */
  45. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  46. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $document_language; ?>" lang="<?php echo $document_language; ?>">
  47. <head>
  48. <title>
  49. <?php
  50. if(!empty($nameTools))
  51. {
  52. echo $nameTools.' - ';
  53. }
  54. if(!empty($_course['official_code']))
  55. {
  56. echo $_course['official_code'].' - ';
  57. }
  58. echo get_setting('siteName');
  59. ?>
  60. </title>
  61. <?php
  62. /*
  63. * Choose CSS style platform's, user's, course's, or Learning path CSS
  64. */
  65. $platform_theme = api_get_setting('stylesheets'); // plataform's css
  66. $my_style=$platform_theme;
  67. if(api_get_setting('user_selected_theme') == 'true')
  68. {
  69. $useri = api_get_user_info();
  70. $user_theme = $useri['theme'];
  71. if(!empty($user_theme) && $user_theme != $my_style)
  72. {
  73. $my_style = $user_theme; // user's css
  74. }
  75. }
  76. $mycourseid = api_get_course_id();
  77. if (!empty($mycourseid) && $mycourseid != -1)
  78. {
  79. if (api_get_setting('allow_course_theme') == 'true')
  80. {
  81. $mycoursetheme=api_get_course_setting('course_theme');
  82. if (!empty($mycoursetheme) && $mycoursetheme!=-1)
  83. {
  84. if(!empty($mycoursetheme) && $mycoursetheme != $my_style)
  85. {
  86. $my_style = $mycoursetheme; // course's css
  87. }
  88. }
  89. $mycourselptheme=api_get_course_setting('allow_learning_path_theme');
  90. if (!empty($mycourselptheme) && $mycourselptheme!=-1 && $mycourselptheme== 1)
  91. {
  92. global $lp_theme_css; // it comes from the lp_controller.php
  93. global $lp_theme_config; // it comes from the lp_controller.php
  94. if (!empty($lp_theme_css))
  95. {
  96. $theme=$lp_theme_css;
  97. if(!empty($theme) && $theme != $my_style)
  98. {
  99. $my_style = $theme; // LP's css
  100. }
  101. }
  102. }
  103. }
  104. }
  105. if ($lp_theme_log){
  106. $my_style=$platform_theme;
  107. }
  108. // Sets the css reference it is call from lp_nav.php, lp_toc.php, lp_message, lp_log.php
  109. if ($scorm_css_header)
  110. {
  111. if (!empty($my_style))
  112. {
  113. $scorm_css=api_get_path(WEB_CODE_PATH).'css/'.$my_style.'/scorm.css';
  114. $scormfs_css=api_get_path(WEB_CODE_PATH).'css/'.$my_style.'/scormfs.css';
  115. }
  116. else
  117. {
  118. $scorm_css='scorm.css';
  119. $scormfs_css='scormfs.css';
  120. }
  121. if($display_mode == 'fullscreen')
  122. {
  123. $htmlHeadXtra[] = '<style type="text/css" media="screen, projection">
  124. /*<![CDATA[*/
  125. @import "'.$scormfs_css.'";
  126. /*]]>*/
  127. </style>';
  128. }
  129. else
  130. {
  131. $htmlHeadXtra[] = '<style type="text/css" media="screen, projection">
  132. /*<![CDATA[*/
  133. @import "'.$scorm_css.'";
  134. /*]]>*/
  135. </style>';
  136. }
  137. }
  138. if($my_style!='')
  139. {
  140. ?>
  141. <style type="text/css" media="screen, projection">
  142. /*<![CDATA[*/
  143. @import "<?php echo api_get_path(WEB_CODE_PATH); ?>css/<?php echo $my_style;?>/default.css";
  144. /*]]>*/
  145. </style>
  146. <?php
  147. }
  148. ?>
  149. <link rel="top" href="<?php echo api_get_path(WEB_PATH); ?>index.php" title="" />
  150. <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); ?>" />
  151. <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); ?>" />
  152. <link href="http://www.dokeos.com/documentation.php" rel="Help" />
  153. <link href="http://www.dokeos.com/team.php" rel="Author" />
  154. <link href="http://www.dokeos.com" rel="Copyright" />
  155. <link rel="shortcut icon" href="<?php echo api_get_path(WEB_PATH); ?>favicon.ico" type="image/x-icon" />
  156. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
  157. <?php
  158. if ( isset($htmlHeadXtra) && $htmlHeadXtra )
  159. {
  160. foreach($htmlHeadXtra as $this_html_head)
  161. {
  162. echo($this_html_head);
  163. }
  164. }
  165. ?>
  166. </head>