reduced_header.inc.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. @$document_language = api_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. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  44. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $document_language; ?>" lang="<?php echo $document_language; ?>">
  45. <head>
  46. <title>
  47. <?php
  48. if(!empty($nameTools))
  49. {
  50. echo $nameTools.' - ';
  51. }
  52. if(!empty($_course['official_code']))
  53. {
  54. echo $_course['official_code'].' - ';
  55. }
  56. echo api_get_setting('siteName');
  57. ?>
  58. </title>
  59. <?php
  60. /*
  61. * Choose CSS style platform's, user's, course's, or Learning path CSS
  62. */
  63. $platform_theme = api_get_setting('stylesheets'); // plataform's css
  64. $my_style=$platform_theme;
  65. if(api_get_setting('user_selected_theme') == 'true')
  66. {
  67. $useri = api_get_user_info();
  68. $user_theme = $useri['theme'];
  69. if(!empty($user_theme) && $user_theme != $my_style)
  70. {
  71. $my_style = $user_theme; // user's css
  72. }
  73. }
  74. $mycourseid = api_get_course_id();
  75. if (!empty($mycourseid) && $mycourseid != -1)
  76. {
  77. if (api_get_setting('allow_course_theme') == 'true')
  78. {
  79. $mycoursetheme=api_get_course_setting('course_theme');
  80. if (!empty($mycoursetheme) && $mycoursetheme!=-1)
  81. {
  82. if(!empty($mycoursetheme) && $mycoursetheme != $my_style)
  83. {
  84. $my_style = $mycoursetheme; // course's css
  85. }
  86. }
  87. $mycourselptheme=api_get_course_setting('allow_learning_path_theme');
  88. if (!empty($mycourselptheme) && $mycourselptheme!=-1 && $mycourselptheme== 1)
  89. {
  90. global $lp_theme_css; // it comes from the lp_controller.php
  91. global $lp_theme_config; // it comes from the lp_controller.php
  92. if (!empty($lp_theme_css))
  93. {
  94. $theme=$lp_theme_css;
  95. if(!empty($theme) && $theme != $my_style)
  96. {
  97. $my_style = $theme; // LP's css
  98. }
  99. }
  100. }
  101. }
  102. }
  103. if (!empty($lp_theme_log)){
  104. $my_style=$platform_theme;
  105. }
  106. // Sets the css reference it is call from lp_nav.php, lp_toc.php, lp_message, lp_log.php
  107. if (!empty($scorm_css_header))
  108. {
  109. if (!empty($my_style))
  110. {
  111. $scorm_css=api_get_path(WEB_CODE_PATH).'css/'.$my_style.'/scorm.css';
  112. $scormfs_css=api_get_path(WEB_CODE_PATH).'css/'.$my_style.'/scormfs.css';
  113. }
  114. else
  115. {
  116. $scorm_css='scorm.css';
  117. $scormfs_css='scormfs.css';
  118. }
  119. if(!empty($display_mode) && $display_mode == 'fullscreen')
  120. {
  121. $htmlHeadXtra[] = '<style type="text/css" media="screen, projection">
  122. /*<![CDATA[*/
  123. @import "'.$scormfs_css.'";
  124. /*]]>*/
  125. </style>';
  126. }
  127. else
  128. {
  129. $htmlHeadXtra[] = '<style type="text/css" media="screen, projection">
  130. /*<![CDATA[*/
  131. @import "'.$scorm_css.'";
  132. /*]]>*/
  133. </style>';
  134. }
  135. }
  136. if($my_style!='')
  137. {
  138. ?>
  139. <style type="text/css" media="screen, projection">
  140. /*<![CDATA[*/
  141. @import "<?php echo api_get_path(WEB_CODE_PATH); ?>css/<?php echo $my_style;?>/default.css";
  142. /*]]>*/
  143. </style>
  144. <?php
  145. }
  146. ?>
  147. <link rel="top" href="<?php echo api_get_path(WEB_PATH); ?>index.php" title="" />
  148. <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,$charset); ?>" />
  149. <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,$charset); ?>" />
  150. <link href="http://www.dokeos.com/documentation.php" rel="Help" />
  151. <link href="http://www.dokeos.com/team.php" rel="Author" />
  152. <link href="http://www.dokeos.com" rel="Copyright" />
  153. <link rel="shortcut icon" href="<?php echo api_get_path(WEB_PATH); ?>favicon.ico" type="image/x-icon" />
  154. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
  155. <script type="text/javascript">
  156. //<![CDATA[
  157. // This is a patch for the "__flash__removeCallback" bug, see FS#4378.
  158. if ( ( navigator.userAgent.toLowerCase().indexOf('msie') != -1 ) && ( navigator.userAgent.toLowerCase().indexOf( 'opera' ) == -1 ) )
  159. {
  160. window.attachEvent( 'onunload', function()
  161. {
  162. window['__flash__removeCallback'] = function ( instance, name )
  163. {
  164. try
  165. {
  166. if ( instance )
  167. {
  168. instance[name] = null ;
  169. }
  170. }
  171. catch ( flashEx )
  172. {
  173. }
  174. } ;
  175. }
  176. ) ;
  177. }
  178. //]]>
  179. </script>
  180. <?php
  181. if ( isset($htmlHeadXtra) && $htmlHeadXtra )
  182. {
  183. foreach($htmlHeadXtra as $this_html_head)
  184. {
  185. echo($this_html_head);
  186. }
  187. }
  188. ?>
  189. </head>