lp_header.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. if (isset($_SESSION['gradebook'])){
  52. $gradebook= $_SESSION['gradebook'];
  53. }
  54. if (!empty($gradebook) && $gradebook=='view') {
  55. $interbreadcrumb[]= array (
  56. 'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
  57. 'name' => get_lang('Gradebook')
  58. );
  59. }
  60. $header_hide_main_div = true;
  61. if($show_link)
  62. {
  63. $interbreadcrumb[]= array ("url"=>"./lp_controller.php?action=list", "name"=> get_lang(ucfirst(TOOL_LEARNPATH)));
  64. }
  65. // else we don't display get_lang(ucfirst(TOOL_LEARNPATH)) in the breadcrumb since the learner accessed it directly from the course homepage
  66. $interbreadcrumb[] = array("url"=>"./lp_controller.php?action=view&lp_id=".$path_id,'name'=>$path_name);
  67. $noPHP_SELF = true;
  68. $lp_theme_css=$_SESSION['oLP']->get_theme();
  69. include('../inc/reduced_header.inc.php');
  70. echo '<div style="font-size:14px;padding-left: 17px;">';
  71. echo '<table ><tr><td>';
  72. echo '<a href="./lp_controller.php?action=return_to_course_homepage" target="_self" onclick="window.parent.API.save_asset();">';
  73. echo '<img src="../img/lp_arrow.gif">';
  74. echo '<a>';
  75. echo '</td><td>';
  76. echo '<a class="link" href="./lp_controller.php?action=return_to_course_homepage" target="_self" onclick="window.parent.API.save_asset();">'.get_lang('CourseHomepageLink').'</a>';
  77. echo '</td></tr><table>';
  78. echo '</div>';
  79. ?>
  80. </body>
  81. </html>