MDL-31242 Prevent redefinition of MOODLE_INTERNAL when loading multiple YUI modules from Moodle

This commit is contained in:
Andrew Robert Nicols
2012-01-18 15:38:55 +01:00
committed by Eloy Lafuente (stronk7)
parent 7fb7e9835a
commit 2f76f1019e
+4 -2
View File
@@ -74,8 +74,10 @@ foreach ($parts as $part) {
$version = array_shift($bits);
if ($version == 'moodle') {
//TODO: this is a ugly hack because we should not load any libs here!
define('MOODLE_INTERNAL', true);
require_once($CFG->libdir.'/moodlelib.php');
if (!defined('MOODLE_INTERNAL')) {
define('MOODLE_INTERNAL', true);
require_once($CFG->libdir.'/moodlelib.php');
}
$revision = (int)array_shift($bits);
if ($revision === -1) {
// Revision -1 says please don't cache the JS