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

Source for file lp_header.php

Documentation is available at lp_header.php

  1. <?php //$id: $
  2. /**
  3.  * Script that displays the header frame for lp_view.php
  4.  * @package dokeos.learnpath
  5.  * @author Yannick Warnier <ywarnier@beeznest.org>
  6.  */
  7. /**
  8.  * Script
  9.  */
  10. //flag to allow for anonymous user - needs to be set before global.inc.php
  11. $use_anonymous true;
  12. // name of the language file that needs to be included 
  13. $language_file["scormdocument";
  14. require_once('back_compat.inc.php');
  15. require_once('learnpath.class.php');
  16. require_once('scorm.class.php');
  17. require_once('aicc.class.php');
  18. if(isset($_SESSION['lpobject'])){
  19.     $temp $_SESSION['lpobject'];
  20.     $_SESSION['oLP'unserialize($temp);
  21. }
  22. $path_name $_SESSION['oLP']->get_name();
  23. $path_id $_SESSION['oLP']->get_id();
  24. // use the flag set in lp_view.php to check if this script has been loaded
  25. // as a frame of lp_view.php. Otherwise, redirect to lp_controller
  26. if(!isset($_SESSION['loaded_lp_view']|| $_SESSION['loaded_lp_view']==false)
  27. {
  28.     header('location: lp_controller.php?'.api_get_cidreq().'&action=view&item_id='.$path_id);
  29. }
  30. //unset the flag as it has been used already
  31. $_SESSION['loaded_lp_view'false;
  32. // Check if the learnpaths list should be accessible to the user
  33. $show_link true;
  34. if(!api_is_allowed_to_edit()) //if the user has no edit permission (simple user)
  35. {
  36.     $course_tool_table Database::get_course_table(TABLE_TOOL_LIST);
  37.     $result api_sql_query("SELECT * FROM $course_tool_table WHERE name='learnpath'",__FILE__,__LINE__);
  38.     if(Database::num_rows($result)>0)
  39.     {
  40.         $row Database::fetch_array($result);
  41.         if($row['visibility'== '0'//if the tool is *not* visible
  42.         {
  43.             $show_link false;
  44.         }
  45.     }
  46.     else
  47.     {
  48.         $show_link false;
  49.     }
  50. }
  51.  
  52. $header_hide_main_div true;
  53. if($show_link)
  54. {
  55.     $interbreadcrumb[]array ("url"=>"./lp_controller.php?action=list""name"=> get_lang(ucfirst(TOOL_LEARNPATH)));
  56. }
  57. // else we don't display get_lang(ucfirst(TOOL_LEARNPATH)) in the breadcrumb since the learner accessed it directly from the course homepage
  58. $interbreadcrumb[array("url"=>"./lp_controller.php?action=view&lp_id=".$path_id,'name'=>$path_name);
  59. $noPHP_SELF true;
  60. $lp_theme_css=$_SESSION['oLP']->get_theme();
  61. include('../inc/reduced_header.inc.php');
  62. echo '<a class="link" href="./lp_controller.php?action=return_to_course_homepage" target="_top" onclick="window.parent.API.save_asset();">'.get_lang('CourseHomepageLink').'</a>';
  63. ?>
  64. </body>
  65. </html>

Documentation generated on Thu, 12 Jun 2008 14:02:49 -0500 by phpDocumentor 1.4.1