[svn r19655] Logic changes - fixed error message when a chapter is selected, it shows a blank page - partial FS#3909

skala
Cristian Fasanando 17 years ago
parent 28ada05106
commit 05ea78a71c
  1. 6
      main/newscorm/learnpath.class.php
  2. 17
      main/newscorm/lp_content.php

@ -2771,10 +2771,12 @@ class learnpath {
$count = Database::num_rows($result); $count = Database::num_rows($result);
if ($item['type']=='quiz') { if ($item['type']=='quiz') {
if ($item['status']=='completed') { if ($item['status']=='completed') {
$html .= "<img id='toc_img_".$item['id']."' src='".$icon_name[$item['status']]."' alt='".substr($item['status'],0,1)."' />"; $html .= "&nbsp;<img id='toc_img_".$item['id']."' src='".$icon_name[$item['status']]."' alt='".substr($item['status'],0,1)."' width='12' height='12' />";
} }
} else { } else {
$html .= "<img id='toc_img_".$item['id']."' src='".$icon_name[$item['status']]."' alt='".substr($item['status'],0,1)."' />"; if ($item['type']!='dokeos_chapter' && $item['type']!='dokeos_module' && $item['type']!='dir') {
$html .= "&nbsp;<img id='toc_img_".$item['id']."' src='".$icon_name[$item['status']]."' alt='".substr($item['status'],0,1)."' width='12' height='12' />";
}
} }

@ -22,7 +22,21 @@ $lp_item_id = $_SESSION['oLP']->get_current_item_id();
*/ */
$src = ''; $src = '';
if($debug>0){error_log('New lp - In lp_content.php - Looking for file url',0);} if($debug>0){error_log('New lp - In lp_content.php - Looking for file url',0);}
switch($lp_type){
$list = $_SESSION['oLP']->get_toc();
$dokeos_chapter = false;
foreach($list as $toc) {
if ($toc['id']==$lp_item_id && ($toc['type']=='dokeos_chapter' || $toc['type']=='dokeos_module' || $toc['type']=='dir')) {
$dokeos_chapter = true;
}
}
if ($dokeos_chapter) {
$src='blank.php';
} else {
switch($lp_type){
case 1: case 1:
$_SESSION['oLP']->stop_previous_item(); $_SESSION['oLP']->stop_previous_item();
$prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id); $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
@ -47,6 +61,7 @@ switch($lp_type){
break; break;
case 4: case 4:
break; break;
}
} }
if($debug>0){error_log('New lp - In lp_content.php - File url is '.$src,0);} if($debug>0){error_log('New lp - In lp_content.php - File url is '.$src,0);}
$_SESSION['oLP']->set_previous_item($lp_item_id); $_SESSION['oLP']->set_previous_item($lp_item_id);

Loading…
Cancel
Save