[svn r19572] Minor - Fixed bug of loop when you add a section like first item in a learning path - see FS#3988

skala
Cristian Fasanando 17 years ago
parent 53c2e44505
commit 1e3118a924
  1. 4
      main/newscorm/lp_controller.php
  2. 18
      main/newscorm/lp_view.php

@ -724,10 +724,10 @@ switch($action)
else else
{ {
if($debug > 0){error_log('New LP - Trying to set current item to ' . $_REQUEST['item_id'], 0);} if($debug > 0){error_log('New LP - Trying to set current item to ' . $_REQUEST['item_id'], 0);}
/*if ( !empty($_REQUEST['item_id']) ) if ( !empty($_REQUEST['item_id']) )
{ {
$_SESSION['oLP']->set_current_item($_REQUEST['item_id']); $_SESSION['oLP']->set_current_item($_REQUEST['item_id']);
}*/ }
require('lp_view.php'); require('lp_view.php');
} }
break; break;

@ -79,23 +79,9 @@ $htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript">
$_SESSION['oLP']->error = ''; $_SESSION['oLP']->error = '';
$lp_type = $_SESSION['oLP']->get_type(); $lp_type = $_SESSION['oLP']->get_type();
$lp_item_id = $_SESSION['oLP']->get_current_item_id();
if (api_is_anonymous()) {
$lp_item_id = $_SESSION['oLP']->get_first_item_id();
if ( $lp_item_id != 0)
$_SESSION['oLP']->set_current_item($lp_item_id); // already done by lp_controller.php
else
$lp_item_id = $_SESSION['oLP']->get_current_item_id();
} else {
//$lp_item_id = $_SESSION['oLP']->get_current_item_id();
$lp_item_id = $_SESSION['oLP']->get_first_item_id();
}
//$lp_item_id = $_SESSION['oLP']->get_current_item_id();
//$lp_item_id = learnpath::escape_string($_GET['item_id']); //$lp_item_id = learnpath::escape_string($_GET['item_id']);
$_SESSION['oLP']->set_current_item($lp_item_id); // already done by lp_controller.php //$_SESSION['oLP']->set_current_item($lp_item_id); // already done by lp_controller.php
//Prepare variables for the test tool (just in case) - honestly, this should disappear later on //Prepare variables for the test tool (just in case) - honestly, this should disappear later on
$_SESSION['scorm_view_id'] = $_SESSION['oLP']->get_view_id(); $_SESSION['scorm_view_id'] = $_SESSION['oLP']->get_view_id();

Loading…
Cancel
Save