mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
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:
parent
5668690321
commit
10eaeca808
4 changed files with 21 additions and 22 deletions
|
@ -167,11 +167,8 @@ function resourcelib_embed_mp3($fullurl, $title, $clicktoopen) {
|
|||
</div>
|
||||
OET;
|
||||
|
||||
$PAGE->requires->yui2_lib('dom');
|
||||
$PAGE->requires->js('/lib/ufo.js')->in_head();
|
||||
$PAGE->requires->js('/lib/resourcelib.js')->in_head();
|
||||
$code .= $PAGE->requires->data_for_js('FO', $ufoargs)->asap();
|
||||
$code .= $PAGE->requires->js_function_call('resourcelib_create_UFO_object', array($id))->asap();
|
||||
$PAGE->requires->js('/lib/ufo.js');
|
||||
$code .= $PAGE->requires->js_function_call('M.util.create_UFO_object', array($id, $ufoargs));
|
||||
return $code;
|
||||
}
|
||||
|
||||
|
@ -213,11 +210,8 @@ function resourcelib_embed_flashvideo($fullurl, $title, $clicktoopen) {
|
|||
</div>
|
||||
EOT;
|
||||
|
||||
$PAGE->requires->yui2_lib('dom');
|
||||
$PAGE->requires->js('/lib/ufo.js')->in_head();
|
||||
$PAGE->requires->js('/lib/resourcelib.js')->in_head();
|
||||
$code .= $PAGE->requires->data_for_js('FO', $ufoargs)->asap();
|
||||
$code .= $PAGE->requires->js_function_call('resourcelib_create_UFO_object', array($id))->asap();
|
||||
$PAGE->requires->js('/lib/ufo.js');
|
||||
$code .= $PAGE->requires->js_function_call('M.util.create_UFO_object', array($id, $ufoargs));
|
||||
return $code;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue