MDL-41878 JavaScript: Add an alias for Moodle in the YUI loader
This commit is contained in:
@@ -219,11 +219,11 @@ class page_requirements_manager {
|
||||
$configname = $this->YUI_config->set_config_source('lib/yui/config/moodle.js');
|
||||
$this->YUI_config->add_group('moodle', array(
|
||||
'name' => 'moodle',
|
||||
'base' => $CFG->httpswwwroot . '/theme/yui_combo.php'.$sep.'moodle/'.$jsrev.'/',
|
||||
'base' => $CFG->httpswwwroot . '/theme/yui_combo.php' . $sep . 'm/' . $jsrev . '/',
|
||||
'combine' => $this->yui3loader->combine,
|
||||
'comboBase' => $CFG->httpswwwroot . '/theme/yui_combo.php'.$sep,
|
||||
'ext' => false,
|
||||
'root' => 'moodle/'.$jsrev.'/', // Add the rev to the root path so that we can control caching.
|
||||
'root' => 'm/'.$jsrev.'/', // Add the rev to the root path so that we can control caching.
|
||||
'patterns' => array(
|
||||
'moodle-' => array(
|
||||
'group' => 'moodle',
|
||||
|
||||
@@ -81,6 +81,9 @@ foreach ($parts as $part) {
|
||||
}
|
||||
//debug($bits);
|
||||
$version = array_shift($bits);
|
||||
if ($version === 'm') {
|
||||
$version = 'moodle';
|
||||
}
|
||||
if ($version === 'moodle') {
|
||||
if (count($bits) <= 3) {
|
||||
// This is an invalid module load attempt.
|
||||
|
||||
@@ -40,6 +40,9 @@ if ($slashargument = min_get_slash_argument()) {
|
||||
$etag = sha1($path);
|
||||
$parts = explode('/', $path);
|
||||
$version = array_shift($parts);
|
||||
if ($version === 'm') {
|
||||
$version = 'moodle';
|
||||
}
|
||||
if ($version == 'moodle' && count($parts) >= 3) {
|
||||
$frankenstyle = array_shift($parts);
|
||||
$module = array_shift($parts);
|
||||
|
||||
Reference in New Issue
Block a user