mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merging MDL-8823 Made it so you can do require_js after header printed
This commit is contained in:
parent
edfda53d51
commit
787b30c0c2
1 changed files with 8 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue