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

Source for file lp_content.php

Documentation is available at lp_content.php

  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. $debug 0;
  11. if($debug>0){error_log('New lp - In lp_content.php',0);}
  12. if(empty($lp_controller_touched)){
  13.     if($debug>0){error_log('New lp - In lp_content.php - Redirecting to lp_controller',0);}
  14.     header('location: lp_controller.php?action=content&lp_id='.$_REQUEST['lp_id'].'&item_id='.$_REQUEST['item_id']);
  15. }
  16. $_SESSION['oLP']->error '';
  17. $lp_type $_SESSION['oLP']->get_type();
  18. $lp_item_id $_SESSION['oLP']->get_current_item_id();
  19.  
  20. /**
  21.  * Get a link to the corresponding document
  22.  */
  23. $src '';
  24. if($debug>0){error_log('New lp - In lp_content.php - Looking for file url',0);}
  25. switch($lp_type){
  26.     case 1:
  27.         $_SESSION['oLP']->stop_previous_item();
  28.         $prereq_check $_SESSION['oLP']->prerequisites_match($lp_item_id);
  29.         if($prereq_check === true){
  30.             $src $_SESSION['oLP']->get_link('http',$lp_item_id);
  31.             $_SESSION['oLP']->start_current_item()//starts time counter manually if asset
  32.         }else{
  33.             $src 'blank.php?error=prerequisites';
  34.         }        
  35.         break;
  36.     case 2:
  37.     case 3:
  38.         //save old if asset
  39.         $_SESSION['oLP']->stop_previous_item()//save status manually if asset
  40.         $prereq_check $_SESSION['oLP']->prerequisites_match($lp_item_id);
  41.         if($prereq_check === true){
  42.             $src $_SESSION['oLP']->get_link('http',$lp_item_id);
  43.             $_SESSION['oLP']->start_current_item()//starts time counter manually if asset
  44.         }else{
  45.             $src 'blank.php';
  46.         }
  47.         break;
  48.     case 4:
  49.         break;
  50. }
  51. if($debug>0){error_log('New lp - In lp_content.php - File url is '.$src,0);}
  52. $_SESSION['oLP']->set_previous_item($lp_item_id);
  53.  
  54. // Define the 'doc.inc.php' as language file
  55. $nameTools $_SESSION['oLP']->get_name();
  56. $interbreadcrumb[]array ("url"=>"./lp_list.php""name"=> get_lang('Doc'));
  57. //update global setting to avoid displaying right menu
  58. $save_setting get_setting("show_navigation_menu");
  59. global $_setting;
  60. $_setting['show_navigation_menu'false;
  61. if($debug>0){error_log('New LP - In lp_content.php - Loading '.$src,0);}
  62. header("Location: ".urldecode($src));

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