mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Made it so you can call require_js after header printed (bug 8823)
This commit is contained in:
parent
521296f5b8
commit
0e9d0c0b85
@ -35,6 +35,14 @@ function require_js($lib='') {
|
||||
$libpath = ajax_get_lib($lib);
|
||||
if (array_search($libpath, $loadlibs) === false) {
|
||||
$loadlibs[] = $libpath;
|
||||
// If this is called after header, then we print it right away
|
||||
// as otherwise nothing will ever happen!
|
||||
if (defined('HEADER_PRINTED')) {
|
||||
$realloadlibs=$loadlibs;
|
||||
$loadlibs=array($libpath);
|
||||
print require_js();
|
||||
$loadlibs=$realloadlibs;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user