MDL-21403 hardcoded JS legacy code should not use new $PAGE->requires-> api, switching to html_writer instead + improved ufo embedding

This commit is contained in:
Petr Skoda 2010-01-26 10:35:13 +00:00
parent 5668690321
commit 10eaeca808
4 changed files with 21 additions and 22 deletions

View file

@ -3411,3 +3411,12 @@ function print_password_policy() {
}
return $message;
}
function create_ufo_inline($id, $args) {
global $CFG;
// must not use $PAGE, $THEME, $COURSE etc. because the result is cached!
$jsoutput = html_writer::script('', $CFG->wwwroot.'/lib/ufo.js');
$jsoutput .= html_writer::script(js_writer::function_call('M.util.create_UFO_object', array($id, $args)));
return $jsoutput;
}