hidetoc == 2) || ($scorm->hidetoc == 1))
$output.='style="width:100%"';
//bugfix: popup cck divs r not closed
if ($popup == 0) {
$output.=">";
}
else {
$output.=">
";
}
// This very big test check if is necessary the "scormtop" div
if (
($mode != 'normal') || // We are not in normal mode so review or browse text will displayed
(
($scorm->hidenav == 0) && // Teacher want to display navigation links
($scorm->hidetoc != 0) && // The buttons has not been displayed
(
(
($sco->previd != 0) && // This is not the first learning object of the package
((!isset($sco->previous)) || ($sco->previous == 0)) // Moodle must manage the previous link
) ||
(
($sco->nextid != 0) && // This is not the last learning object of the package
((!isset($sco->next)) || ($sco->next == 0)) // Moodle must manage the next link
)
)
) || ($scorm->hidetoc == 2) // Teacher want to display toc in a small dropdown menu
) {
$output.='
';
//TODO: Do we need these modes?
$output.= $mode == 'browse' ? '
';
if ($result->prerequisites) {
if ($popup == 0) {
/*
//Insert start time for viewing sco.
$scorm_grades = db_fetch_object(db_query("SELECT * FROM {scorm_grades} WHERE scoid=%d AND userid=%d",$sco->id,$user->uid));
if(!$scorm_grades){
db_query("INSERT INTO {scorm_grades} (scormid,scoid,userid,starttime) VALUES(%d,%d,%d,%d)",$scorm->id,$sco->id,$user->uid,time());
}
else
{
db_query("UPDATE {scorm_grades} SET starttime=%d WHERE scoid=%d and userid=%d",time(),$sco->id,$user->uid);
}*/
$fullurl=$base_path."loadsco?id=".$cm->id.$scoidstr.$modestr;
$output.= "\n";
} else {
//TODO: Improve and test popup
// Clean the name for the window as IE is fussy
$name = ereg_replace("[^A-Za-z0-9]", "", $scorm->name);
if (!$name) {
$name = 'DefaultPlayerWindow';
}
$name = 'scorm_'.$name;
$output.='
';
//Added incase javascript popups are blocked
$link = 'Click here to view SCORM';
//print_simple_box(get_string('popupblocked','scorm',$link),'center');
$output.=$link;
return $output;
}
}
/*else {
print_simple_box(get_string('noprerequisites','scorm'),'center');
}*/
$output.='
'; //toctree and tocbox
$class = ' class="toc"';
} else {
$class = ' class="no-toc"';
}
$output.='';
return $output;
//print_footer('none');
}//End of function player
function scorm_view_display ($scorm) {
global $user;
//if ($scorm->updatefreq == UPDATE_EVERYTIME){
// require_once($CFG->dirroot.'/mod/scorm/lib.php');
$scorm->instance = $scorm->id;
//TODO: Scorm update
//scorm_update_instance($scorm);
//$organization = optional_param('organization', '', PARAM_INT);
//print_simple_box_start('center',$boxwidth);
//$output='
Contents
';
$organization = $scorm->launch;
$result = db_query("SELECT * FROM {scorm_scoes} WHERE scorm= %d AND organization='' AND launch=''",$scorm->id);
$orgs=mysql_num_rows($result);
if ($orgs > 1) {
$output.="