MDL-21170 migrated code to new M.util.image_url() function that returns correct theme images

This commit is contained in:
Petr Skoda
2010-01-22 10:34:09 +00:00
parent ef502357f4
commit bca0975478
4 changed files with 31 additions and 25 deletions

View File

@@ -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!!!!!!!