dokeos-include
[ class tree: dokeos-include ] [ index: dokeos-include ] [ all elements ]

Source for file header.inc.php

Documentation is available at header.inc.php

  1. <?php
  2. /**
  3. ==============================================================================
  4. *    This script displays the Dokeos header.
  5. *
  6. *    @package dokeos.include
  7. ==============================================================================
  8. */
  9.  
  10. /*----------------------------------------
  11.               HEADERS SECTION
  12.   --------------------------------------*/
  13.  
  14. /*
  15.  * HTTP HEADER
  16.  */
  17.  
  18. //Give a default value to $charset. Should change to UTF-8 some time in the future.
  19. //This parameter should be set in the platform configuration interface in time.
  20. $charset api_get_setting('platform_charset');
  21. if(empty($charset))
  22. {
  23.     $charset 'ISO-8859-15';
  24. }
  25.  
  26. //header('Content-Type: text/html; charset='. $charset)
  27. //    or die ("WARNING : it remains some characters before &lt;?php bracket or after ?&gt end");
  28.  
  29. header('Content-Type: text/html; charset='$charset);
  30. if isset($httpHeadXtra&& $httpHeadXtra )
  31. {
  32.     foreach($httpHeadXtra as $thisHttpHead)
  33.     {
  34.         header($thisHttpHead);
  35.     }
  36. }
  37.  
  38. // Get language iso-code for this page - ignore errors
  39. // The error ignorance is due to the non compatibility of function_exists()
  40. // with the object syntax of Database::get_language_isocode()
  41. @$document_language Database::get_language_isocode($language_interface);
  42. if(empty($document_language))
  43. {
  44.   //if there was no valid iso-code, use the english one
  45.   $document_language 'en';
  46. }
  47.  
  48. /*
  49.  * HTML HEADER
  50.  */
  51.  
  52. ?>
  53. <!DOCTYPE html
  54.      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  55.      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  56. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $document_language?>" lang="<?php echo $document_language?>">
  57. <head>
  58. <title>
  59. <?php
  60. if(!empty($nameTools))
  61. {
  62.     echo $nameTools.' - ';
  63. }
  64.  
  65. if(!empty($_course['official_code']))
  66. {
  67.     echo $_course['official_code'].' - ';
  68. }
  69.  
  70. echo get_setting('siteName');
  71.     
  72. ?>
  73. </title>
  74. <style type="text/css" media="screen, projection">
  75. /*<![CDATA[*/
  76. <?php
  77.  
  78. $platform_themeapi_get_setting('stylesheets');     // plataform's css
  79. $my_style=$platform_theme;
  80.  
  81. if(api_get_setting('user_selected_theme'== 'true'
  82. {        
  83.     $useri api_get_user_info();
  84.     $user_theme $useri['theme'];
  85.     if(!empty($user_theme&& $user_theme != $my_style)
  86.     {
  87.         $my_style $user_theme;                    // user's css
  88.     }
  89. }
  90. $mycourseid api_get_course_id();
  91. if (!empty($mycourseid&& $mycourseid != -1
  92. {    
  93.     if (api_get_setting('allow_course_theme'== 'true'
  94.     {    
  95.         $mycoursetheme=api_get_course_setting('course_theme');
  96.                     
  97.         if (!empty($mycoursetheme&& $mycoursetheme!=-1)         
  98.         {                            
  99.             if(!empty($mycoursetheme&& $mycoursetheme != $my_style)
  100.             {                
  101.                 $my_style $mycoursetheme;        // course's css
  102.             }            
  103.         }
  104.                 
  105.         $mycourselptheme=api_get_course_setting('allow_learning_path_theme');
  106.         if (!empty($mycourselptheme&& $mycourselptheme!=-&& $mycourselptheme== 1)         
  107.         {    
  108.             
  109.             global $lp_theme_css//  it comes from the lp_controller.php 
  110.             global $lp_theme_config// it comes from the lp_controller.php
  111.                                             
  112.             if (!$lp_theme_config)                                                         
  113.             {
  114.                 if ($lp_theme_css!=''
  115.                 {                
  116.                     $theme=$lp_theme_css;                        
  117.                     if(!empty($theme&& $theme != $my_style)
  118.                     {                                
  119.                         $my_style $theme;     // LP's css
  120.                     }
  121.                 }                
  122.             }
  123.         }
  124.     }
  125. }
  126.  
  127. global $show_learn_path;
  128.  
  129. if ($show_learn_path
  130. {
  131.     $htmlHeadXtra['<link rel="stylesheet" type="text/css" href="'.api_get_path(WEB_CODE_PATH).'css/'.$my_style.'/learnpath.css"/>';
  132.     $htmlHeadXtra["<link rel='stylesheet' type='text/css' href='dtree.css' />"//will be moved
  133.     $htmlHeadXtra["<script src='dtree.js' type='text/javascript'></script>"//will be moved        
  134. }
  135.  
  136. $my_code_path api_get_path(WEB_CODE_PATH);
  137. if(empty($my_style))
  138. {
  139.     $my_style 'dokeos_classic';
  140. }
  141. echo '@import "'.$my_code_path.'css/'.$my_style.'/default.css";'."\n";
  142. echo '@import "'.$my_code_path.'css/'.$my_style.'/course.css";'."\n";
  143. ?>
  144. /*]]>*/
  145. </style>
  146. <style type="text/css" media="print">
  147. /*<![CDATA[*/
  148. <?php
  149.   echo '@import "'.$my_code_path.'css/'.$my_style.'/print.css";'."\n";
  150. ?>
  151. /*]]>*/
  152. </style>
  153.  
  154. <link rel="top" href="<?php echo api_get_path(WEB_PATH)?>index.php" title="" />
  155. <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)?>" />
  156. <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)?>" />
  157. <link href="http://www.dokeos.com/documentation.php" rel="Help" />
  158. <link href="http://www.dokeos.com/team.php" rel="Author" />
  159. <link href="http://www.dokeos.com" rel="Copyright" />
  160. <link rel="shortcut icon" href="<?php echo api_get_path(WEB_PATH)?>favicon.ico" type="image/x-icon" />
  161. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
  162. <?php
  163. if isset($htmlHeadXtra&& $htmlHeadXtra )
  164. {
  165.     foreach($htmlHeadXtra as $this_html_head)
  166.     {
  167.         echo($this_html_head);
  168.     }
  169. }
  170. if isset($htmlIncHeadXtra&& $htmlIncHeadXtra )
  171. {
  172.     foreach($htmlIncHeadXtra as $this_html_head)
  173.     {
  174.         include($this_html_head);
  175.     }
  176. }
  177. //the following include might be subject to a setting proper to the course or platform
  178. include(api_get_path(LIBRARY_PATH).'/javascript/email_links.lib.js.php');
  179. ?>
  180.  
  181. </head>
  182. <body dir="<?php echo  $text_dir ?><?php
  183.  if(defined('DOKEOS_HOMEPAGE'&& DOKEOS_HOMEPAGE)
  184.  echo 'onload="javascript:if(document.formLogin) { document.formLogin.login.focus(); }"'?>>
  185. <div class="skip">
  186. <ul>
  187. <li><a href="#menu"><?php echo get_lang('WCAGGoMenu') )?></a></li>
  188. <li><a href="#content" accesskey="2"><?php echo get_lang('WCAGGoContent') )?></a></li>
  189. </ul>
  190. </div>
  191.         
  192. <!-- #outerframe container to control some general layout of all pages -->
  193. <div id="outerframe">
  194.  
  195. <?php                        
  196. //  Banner
  197. include(api_get_path(INCLUDE_PATH)."banner.inc.php");

Documentation generated on Thu, 12 Jun 2008 13:38:33 -0500 by phpDocumentor 1.4.1