|
|
|
@ -2569,7 +2569,7 @@ class learnpath { |
|
|
|
|
* Uses the table generated by get_toc() and returns an HTML-formatted string ready to display |
|
|
|
|
* @return string HTML TOC ready to display |
|
|
|
|
*/ |
|
|
|
|
function get_html_toc() |
|
|
|
|
/*function get_html_toc() |
|
|
|
|
{ |
|
|
|
|
if($this->debug>0){error_log('New LP - In learnpath::get_html_toc()',0);} |
|
|
|
|
$list = $this->get_toc(); |
|
|
|
@ -2627,7 +2627,97 @@ class learnpath { |
|
|
|
|
} |
|
|
|
|
$html .= "</div>\n"; |
|
|
|
|
return $html; |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Uses the table generated by get_toc() and returns an HTML-formatted string ready to display |
|
|
|
|
* @return string HTML TOC ready to display |
|
|
|
|
*/ |
|
|
|
|
function get_html_toc() |
|
|
|
|
{ |
|
|
|
|
if($this->debug>0){error_log('New LP - In learnpath::get_html_toc()',0);} |
|
|
|
|
$list = $this->get_toc(); |
|
|
|
|
//echo $this->current; |
|
|
|
|
//$parent = $this->items[$this->current]->get_parent(); |
|
|
|
|
//if(empty($parent)){$parent = $this->ordered_items[$this->items[$this->current]->get_previous_index()];} |
|
|
|
|
$html = '<div class="inner_lp_toc">'."\n" ; |
|
|
|
|
// " onchange=\"javascript:document.getElementById('toc_$parent').focus();\">\n"; |
|
|
|
|
require_once('resourcelinker.inc.php'); |
|
|
|
|
|
|
|
|
|
//temp variables |
|
|
|
|
$mycurrentitemid = $this->get_current_item_id(); |
|
|
|
|
|
|
|
|
|
foreach($list as $item) |
|
|
|
|
{ |
|
|
|
|
if($this->debug>2){error_log('New LP - learnpath::get_html_toc(): using item '.$item['id'],0);} |
|
|
|
|
//TODO complete this |
|
|
|
|
$icon_name = array('not attempted' => 'notattempted.png', |
|
|
|
|
'incomplete' => 'incomplete.png', |
|
|
|
|
'failed' => 'failed.png', |
|
|
|
|
'completed' => 'completed.png', |
|
|
|
|
'passed' => 'passed.png', |
|
|
|
|
'succeeded' => 'succeeded.png', |
|
|
|
|
'browsed' => 'completed.png'); |
|
|
|
|
|
|
|
|
|
$style = 'scorm_item'; |
|
|
|
|
if($item['id'] == $this->current){ |
|
|
|
|
$style = 'scorm_item_highlight'; |
|
|
|
|
} |
|
|
|
|
//the anchor will let us center the TOC on the currently viewed item &^D |
|
|
|
|
|
|
|
|
|
if($item['type']!='dokeos_module' AND $item['type']!='dokeos_chapter'){ |
|
|
|
|
|
|
|
|
|
$html .= '<a name="atoc_'.$item['id'].'" /><div class="'.$style.'" style="padding-left: '.($item['level']*2).'em; padding-right:'.($item['level']/2).'em" id="toc_'.$item['id'].'" >' . |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
|
|
$html .= '<div class="'.$style.'" style="padding-left: '.($item['level']*2).'em; padding-right:'.($item['level']*2).'em" id="toc_'.$item['id'].'" >' . |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//$title = htmlspecialchars($item['title'],ENT_QUOTES,$this->encoding); |
|
|
|
|
$title = $item['title']; |
|
|
|
|
if(empty($title)){ |
|
|
|
|
$title = rl_get_resource_name(api_get_course_id(),$this->get_id(),$item['id']); |
|
|
|
|
$title = htmlspecialchars($title,ENT_QUOTES,$this->encoding); |
|
|
|
|
} |
|
|
|
|
if(empty($title))$title = '-'; |
|
|
|
|
|
|
|
|
|
if($item['type']!='dokeos_chapter' and $item['type']!='dir' AND $item['type']!='dokeos_module'){ |
|
|
|
|
//$html .= "<a href='lp_controller.php?".api_get_cidReq()."&action=content&lp_id=".$this->get_id()."&item_id=".$item['id']."' target='lp_content_frame_name'>".$title."</a>" ; |
|
|
|
|
$url = $this->get_link('http',$item['id']); |
|
|
|
|
//$html .= '<a href="'.$url.'" target="content_name" onclick="top.load_item('.$item['id'].',\''.$url.'\');">'.$title.'</a>' ; |
|
|
|
|
//$html .= '<a href="" onclick="top.load_item('.$item['id'].',\''.$url.'\');return false;">'.$title.'</a>' ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$html .= '<a href="" onclick="dokeos_xajax_handler.switch_item(' . |
|
|
|
|
$mycurrentitemid.',' . |
|
|
|
|
$item['id'].');' . |
|
|
|
|
'return false;" ><img align="absbottom" width="13" height="13" src="img/lp_document.png"> '.$title.'</a>' ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
elseif($item['type']=='dokeos_module'){ |
|
|
|
|
$html .= "<img align='absbottom' width='13' height='13' src='img/lp_dokeos_module.png'> ".$title; |
|
|
|
|
} |
|
|
|
|
elseif($item['type']=='dokeos_chapter'){ |
|
|
|
|
$html .= "<img align='absbottom' width='13' height='13' src='img/lp_dokeos_chapter.png'> ".$title; |
|
|
|
|
} |
|
|
|
|
elseif($item['type']=='dir'){ |
|
|
|
|
$html .= $title; |
|
|
|
|
} |
|
|
|
|
$html .= "<img id='toc_img_".$item['id']."' src='".$icon_name[$item['status']]."' alt='".substr($item['status'],0,1)."' /></div>\n"; |
|
|
|
|
} |
|
|
|
|
$html .= "</div>\n"; |
|
|
|
|
return $html; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Gets the user-friendly message stored in $this->message |
|
|
|
|
* @return string Message |
|
|
|
|