MDL-21403 hardcoded JS legacy code should not use new $PAGE->requires-> api, switching to html_writer instead
This commit is contained in:
@@ -727,8 +727,8 @@ class securewindow_access_rule extends quiz_access_rule_base {
|
||||
echo "window.open('$attempturl', '$window', '$this->windowoptions');", '" />';
|
||||
|
||||
/// JavaScript to reveal the button.
|
||||
echo $PAGE->requires->js('/mod/quiz/quiz.js')->asap();
|
||||
echo $PAGE->requires->js_function_call('reveal_start_button')->asap();
|
||||
echo html_writer::script('', $CFG->wwwroot.'/mod/quiz/quiz.js');
|
||||
echo html_writer::script(js_writer::function_call('reveal_start_button'));
|
||||
|
||||
/// A noscript tag to explains that this quiz only works with JavaScript enabled.
|
||||
echo '<noscript>';
|
||||
|
||||
@@ -56,8 +56,8 @@ class quiz_grading_report extends quiz_default_report {
|
||||
|
||||
$this->cm = $cm;
|
||||
|
||||
echo $PAGE->requires->js('/lib/overlib/overlib.js')->asap();
|
||||
echo $PAGE->requires->js('/lib/overlib/overlib_cssstyle.js')->asap();
|
||||
echo html_writer::script('', $CFG->wwwroot.'/lib/overlib/overlib.js');
|
||||
echo html_writer::script('', $CFG->wwwroot.'/lib/overlib/overlib_cssstyle.js');
|
||||
|
||||
$this->print_header_and_tabs($cm, $course, $quiz, $reportmode="grading");
|
||||
|
||||
|
||||
@@ -312,9 +312,9 @@
|
||||
}
|
||||
$name = 'scorm_'.$name;
|
||||
|
||||
echo $PAGE->requires->js_function_call('scorm_resize')->asap();
|
||||
echo $PAGE->requires->js('/mod/scorm/player.js')->asap();
|
||||
echo $PAGE->requires->js_function_call('scorm_openpopup', Array("loadSCO.php?id=".$cm->id.$scoidpop, p($name), p($scorm->options), p($scorm->width), p($scorm->height)))->asap();
|
||||
echo html_writer::script(js_writer::function_call('scorm_resize'));
|
||||
echo html_writer::script('', $CFG->wwwroot.'/mod/scorm/player.js');
|
||||
echo html_writer::script(js_writer::function_call('scorm_openpopup', Array("loadSCO.php?id=".$cm->id.$scoidpop, $name, $scorm->options, $scorm->width, $scorm->height)));
|
||||
?>
|
||||
<noscript>
|
||||
<iframe id="main" class="scoframe" src="loadSCO.php?id=<?php echo $cm->id.$scoidstr.$modestr ?>">
|
||||
|
||||
@@ -307,8 +307,9 @@ class embedded_cloze_qtype extends default_questiontype {
|
||||
// The regex will recognize text snippets of type {#X}
|
||||
// where the X can be any text not containg } or white-space characters.
|
||||
|
||||
echo $PAGE->requires->js('/lib/overlib/overlib.js')->asap();
|
||||
echo $PAGE->requires->js('/lib/overlib/overlib_cssstyle.js')->asap();
|
||||
// TODO: stop using overlib, use YUI instead
|
||||
echo html_writer::script('', $CFG->wwwroot.'/lib/overlib/overlib.js');
|
||||
echo html_writer::script('', $CFG->wwwroot.'/lib/overlib/overlib_cssstyle.js');
|
||||
|
||||
while (preg_match('~\{#([^[:space:]}]*)}~', $qtextremaining, $regs)) {
|
||||
$qtextsplits = explode($regs[0], $qtextremaining, 2);
|
||||
|
||||
Reference in New Issue
Block a user