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 12:29:26 +00:00 committed by kordan
parent fe0bc2e0be
commit 73c932022f

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