Merging MDL-8823 Made it so you can do require_js after header printed

This commit is contained in:
sam_marshall 2007-03-12 12:18:13 +00:00
parent edfda53d51
commit 787b30c0c2

View file

@ -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 {