Merge branch 'm20_MDL-26176_cleanup' of github.com:danmarsden/moodle
[moodle.git] / mod / scorm / datamodels / scorm_12lib.php
index a2bb032..b8ac6f2 100644 (file)
@@ -109,14 +109,12 @@ function scorm_eval_prerequisites($prerequisites, $usertracks) {
 function scorm_get_toc($user,$scorm,$toclink=TOCJSLINK,$currentorg='',$scoid='',$mode='normal',$attempt='',$play=false, $tocheader=false) {
     global $CFG, $DB, $PAGE, $OUTPUT;
 
 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;
     }
 
     $result = new stdClass();
     $modestr = '';
     if ($mode == 'browse') {
         $modestr = '&mode='.$mode;
     }
 
     $result = new stdClass();
-    //$result->toc = "<ul id='s0' class='$liststyle'>\n";
     if ($tocheader) {
         $result->toc = '<div id="scorm_layout">';
         $result->toc .= '<div id="scorm_toc">';
     if ($tocheader) {
         $result->toc = '<div id="scorm_layout">';
         $result->toc .= '<div id="scorm_toc">';
@@ -193,15 +191,7 @@ function scorm_get_toc($user,$scorm,$toclink=TOCJSLINK,$currentorg='',$scoid='',
                         $i--;
                     }
                     if (($i == 0) && ($sco->parent != $currentorg)) {
                         $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";
                         $result->toc .= "\t\t<ul>\n";
-
-
-
                         $level++;
                     } else {
                         $result->toc .= $closelist;
                         $level++;
                     } else {
                         $result->toc .= $closelist;
@@ -224,21 +214,12 @@ function scorm_get_toc($user,$scorm,$toclink=TOCJSLINK,$currentorg='',$scoid='',
             }
             if ($nextisvisible && ($nextsco !== false) && ($sco->parent != $nextsco->parent) && (($level==0) || (($level>0) && ($nextsco->parent == $sco->identifier)))) {
                 $sublist++;
             }
             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 .= '<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 .= '<img src="'.$OUTPUT->pix_url('spacer', 'scorm').'" alt="" />';
             }
             if (empty($sco->title)) {
                 $sco->title = $sco->identifier;
             }
             if (!empty($sco->launch)) {
                 if ($isvisible) {
             }
             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;
                     $score = '';
                     if (empty($scoid) && ($mode != 'normal')) {
                         $scoid = $sco->id;
@@ -277,11 +258,7 @@ function scorm_get_toc($user,$scorm,$toclink=TOCJSLINK,$currentorg='',$scoid='',
                         }
                     }
                     if ($sco->id == $scoid) {
                         }
                     }
                     if ($sco->id == $scoid) {
-                        $startbold = '<b>';
-                        $endbold = '</b>';
                         $findnext = true;
                         $findnext = true;
-                        $shownext = isset($sco->next) ? $sco->next : 0;
-                        $showprev = isset($sco->previous) ? $sco->previous : 0;
                     }
 
                     if (($nextid == 0) && (scorm_count_launchable($scorm->id,$currentorg) > 1) && ($nextsco!==false) && (!$findnext)) {
                     }
 
                     if (($nextid == 0) && (scorm_count_launchable($scorm->id,$currentorg) > 1) && ($nextsco!==false) && (!$findnext)) {
@@ -314,8 +291,7 @@ function scorm_get_toc($user,$scorm,$toclink=TOCJSLINK,$currentorg='',$scoid='',
                         if ($play) {
                             // should be disabled
                             $result->toc .= '<span>'.$statusicon.'&nbsp;'.format_string($sco->title).'</span>';
                         if ($play) {
                             // should be disabled
                             $result->toc .= '<span>'.$statusicon.'&nbsp;'.format_string($sco->title).'</span>';
-                        }
-                        else {
+                        } else {
                             $result->toc .= $statusicon.'&nbsp;'.format_string($sco->title)."\n";
                         }
                     }
                             $result->toc .= $statusicon.'&nbsp;'.format_string($sco->title)."\n";
                         }
                     }
@@ -358,7 +334,6 @@ function scorm_get_toc($user,$scorm,$toclink=TOCJSLINK,$currentorg='',$scoid='',
     }
 
 
     }
 
 
-
     if ($scorm->hidetoc == 0) {
         $PAGE->requires->data_for_js('scormdata', array(
                 'plusicon' => $OUTPUT->pix_url('plus', 'scorm'),
     if ($scorm->hidetoc == 0) {
         $PAGE->requires->data_for_js('scormdata', array(
                 'plusicon' => $OUTPUT->pix_url('plus', 'scorm'),
@@ -372,5 +347,3 @@ function scorm_get_toc($user,$scorm,$toclink=TOCJSLINK,$currentorg='',$scoid='',
 
     return $result;
 }
 
     return $result;
 }
-
-