mirror of
https://github.com/moodle/moodle.git
synced 2025-07-23 23:31:58 +02:00
MDL-21170 migrated code to new M.util.image_url() function that returns correct theme images
This commit is contained in:
@@ -14,6 +14,29 @@ M.yui.add_module = function(modules) {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Various utility functions
|
||||
*/
|
||||
M.util = {
|
||||
/**
|
||||
* Returns url for images.
|
||||
*/
|
||||
image_url: function(imagename, component) {
|
||||
var url = M.cfg.wwwroot + '/theme/image.php?theme=' + M.cfg.theme + '&image=' + imagename;
|
||||
|
||||
if (M.cfg.themerev > 0) {
|
||||
url = url + '&rev=' + M.cfg.themerev;
|
||||
}
|
||||
|
||||
if (component != '' && component != 'moodle' && component != 'core') {
|
||||
url = url + '&component=' + component;
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function launch_filemanager(options) {
|
||||
Y.use('core_filemanager', function() {
|
||||
var client_id = options.client_id;
|
||||
@@ -1398,21 +1421,6 @@ function frame_breakout(e, properties) {
|
||||
this.setAttribute('target', properties.framename);
|
||||
}
|
||||
|
||||
function get_image_url(imagename, component) {
|
||||
var url = M.cfg.wwwroot + '/theme/image.php?theme=' + M.cfg.theme + '&image=' + imagename;
|
||||
|
||||
if (M.cfg.themerev > 0) {
|
||||
url = url + '&rev=' + M.cfg.themerev;
|
||||
}
|
||||
|
||||
if (component != '' && component != 'moodle' && component != 'core') {
|
||||
url = url + '&component=' + component;
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ===== Deprecated core Javascript functions for Moodle ====
|
||||
// DO NOT USE!!!!!!!
|
||||
|
Reference in New Issue
Block a user