lp_content.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php //$id: $
  2. /**
  3. * Script that displays an error message when no content could be loaded
  4. * @package dokeos.learnpath
  5. * @author Yannick Warnier <ywarnier@beeznest.org>
  6. */
  7. /**
  8. * Nothing very interesting
  9. */
  10. if(empty($lp_controller_touched)){
  11. header('location: lp_controller.php?action=content&lp_id='.$_REQUEST['lp_id'].'&item_id='.$_REQUEST['item_id']);
  12. }
  13. $_SESSION['oLP']->error = '';
  14. $lp_type = $_SESSION['oLP']->get_type();
  15. $lp_item_id = $_SESSION['oLP']->get_current_item_id();
  16. /**
  17. * Get a link to the corresponding document
  18. */
  19. $src = '';
  20. switch($lp_type){
  21. case 1:
  22. $_SESSION['oLP']->stop_previous_item();
  23. $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
  24. if($prereq_check === true){
  25. $src = $_SESSION['oLP']->get_link('http',$lp_item_id);
  26. $_SESSION['oLP']->start_current_item(); //starts time counter manually if asset
  27. }else{
  28. $src = 'blank.php';
  29. }
  30. break;
  31. case 2:
  32. case 3:
  33. //save old if asset
  34. $_SESSION['oLP']->stop_previous_item(); //save status manually if asset
  35. $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
  36. if($prereq_check === true){
  37. $src = $_SESSION['oLP']->get_link('http',$lp_item_id);
  38. $_SESSION['oLP']->start_current_item(); //starts time counter manually if asset
  39. }else{
  40. $src = 'blank.php';
  41. }
  42. break;
  43. case 4:
  44. break;
  45. }
  46. $_SESSION['oLP']->set_previous_item($lp_item_id);
  47. // Define the 'doc.inc.php' as language file
  48. $nameTools = $_SESSION['oLP']->get_name();
  49. $interbreadcrumb[]= array ("url"=>"./lp_list.php", "name"=> get_lang('Doc'));
  50. //update global setting to avoid displaying right menu
  51. $save_setting = get_setting("show_navigation_menu");
  52. global $_setting;
  53. $_setting['show_navigation_menu'] = false;
  54. if($debug>0){error_log('New LP - Loading '.$src.' into lp_content.php',0);}
  55. header("Location: $src");
  56. ?>