SCORM MDL-21333 modify way link appears if popup does not load to prevent SCORM from loading and not being able to communicate with API - thanks to Matteo Scaramuccia for report/fix

This commit is contained in:
Dan Marsden 2010-06-24 01:22:25 +00:00
parent 5435ff2777
commit be9187302c
2 changed files with 14 additions and 2 deletions

View File

@ -186,6 +186,18 @@
}
}, 1000);
}
removelink();
}
function removelink() {
try {
if (window.opener.document.getElementById('altpopuplink')) {
window.opener.document.getElementById('altpopuplink').style.display='none';
} else {
window.opener.document.all['altpopuplink'].style.display='none';
}
} catch(error) {
// nothing to be done
}
}
//]]>
</script>

View File

@ -342,8 +342,8 @@
</noscript>
<?php
//Added incase javascript popups are blocked
$link = '<a href="'.$CFG->wwwroot.'/mod/scorm/loadSCO.php?id='.$cm->id.$scoidstr.$modestr.'" target="new">'.get_string('popupblockedlinkname','scorm').'</a>';
echo $OUTPUT->box(get_string('popupblocked','scorm',$link));
$link = '<a href="'.$CFG->wwwroot.'/mod/scorm/loadSCO.php?id='.$cm->id.$scoidstr.$modestr.'" target="_blank">'.get_string('popupblockedlinkname','scorm').'</a>';
echo $OUTPUT->box(get_string('popupblocked','scorm',$link), 'generalbox', 'altpopuplink');
}
} else {
echo $OUTPUT->box(get_string('noprerequisites','scorm'));