reduced_header.inc.php 4.9 KB

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