Comment 1 for bug 1416890

Revision history for this message
Aaron Wells (u-aaronw) wrote :

We don't have any immediate plans to do this, but if a person were to implement this, the place to start would be looking at the Theme class in lib/web.php. Currently images are served up with the $THEME->get_url() method, which abstracts out the specific theme to allow for theme inheritance. We'd need to add a second method alongside that abstracts out the file suffix for image files.

See https://wiki.mahara.org/index.php/Customising/Themes/1.10#Core_assets for details on how it currently works.

Cacheing it is a separate issue. Our theme system currently doesn't do any cacheing at all. Every time it's looking for a particular file, it hits the filesystem to find it. I haven't run any tests to see whether this causes us any slowdown, though. I suppose an easy way to test it would be to modify $THEME->get_url() so that it's hardcoded to use the "raw" theme instead of checking for the existence of files.

And the third issue is browser detection. We currently have a library that detects whether you're using a phone or table, but we don't do any browser sniffing beyond that. In fact, in the Mahara README we limit Mahara support to the latest versions of Firefox & Chrome, and the last three releases of IE (currently IE9, 10, and 11). All of those support SVG files: http://caniuse.com/#feat=svg

So, we wouldn't be adding any code to Mahara core to check for browser support for SVGs. But if we did implement the file-format-abstracting system described above, we could add a local/lib.php hook in lib/web.php to allow sites have to support IE8 to customize the process of deciding which file format to use.