Made it so you can call require_js after header printed (bug 8823)

This commit is contained in:
sam_marshall 2007-03-09 12:52:35 +00:00
parent 521296f5b8
commit 0e9d0c0b85

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 {