function scorm_get_toc($user,$scorm,$toclink=TOCJSLINK,$currentorg='',$scoid='',$mode='normal',$attempt='',$play=false, $tocheader=false) {
global $CFG, $DB, $PAGE, $OUTPUT;
- $strexpand = get_string('expcoll','scorm');
$modestr = '';
if ($mode == 'browse') {
$modestr = '&mode='.$mode;
$i--;
}
if (($i == 0) && ($sco->parent != $currentorg)) {
- $style = '';
- if (isset($_COOKIE['hide:SCORMitem'.$sco->id])) {
- $style = ' style="display: none;"';
- }
- //$result->toc .= "\t\t<li><ul id='s$sublist' class='$liststyle'$style>\n";
$result->toc .= "\t\t><ul>\n";
$level++;
} else {
if ($nextisvisible && ($nextsco !== false) && ($sco->parent != $nextsco->parent) &&
(($level==0) || (($level>0) && ($nextsco->parent == $sco->identifier)))) {
$sublist++;
- $icon = 'minus';
- if (isset($_COOKIE['hide:SCORMitem'.$nextsco->id])) {
- $icon = 'plus';
- }
-// $result->toc .= "\t\t".'<li><a href="javascript:expandCollide(\'img'.$sublist.'\',\'s'.$sublist.'\','.$nextsco->id.');">'.
-// '<img id="img'.$sublist.'" src="'.$OUTPUT->pix_url($icon, 'scorm').'" alt="'.$strexpand.'" title="'.$strexpand.'"/></a>';
- } else if ($isvisible) {
-// $result->toc .= "\t\t".'<li><img src="'.$OUTPUT->pix_url('spacer', 'scorm').'" alt="" />';
}
if (empty($sco->title)) {
$sco->title = $sco->identifier;
}
if (!empty($sco->launch)) {
if ($isvisible) {
- $startbold = '';
- $endbold = '';
$score = '';
if (empty($scoid) && ($mode != 'normal')) {
$scoid = $sco->id;
}
if ($sco->id == $scoid) {
- $startbold = '<b>';
- $endbold = '</b>';
$findnext = true;
- $shownext = isset($sco->next) ? $sco->next : 0;
- $showprev = isset($sco->prev) ? $sco->prev : 0;
}
if (($nextid == 0) && (scorm_count_launchable($scorm->id,$currentorg) > 1) && ($nextsco!==false) && (!$findnext)) {
if ($sco->id == $scoid) {
$result->prerequisites = false;
}
- //$result->toc .= $statusicon.' '.format_string($sco->title)."\n";
if ($play) {
// should be disabled
$result->toc .= '<span>'.$statusicon.' '.format_string($sco->title).'</span>';
- }
- else {
+ } else {
$result->toc .= $statusicon.' '.format_string($sco->title)."\n";
}
}
return $result;
}
-
-