MDL-36888 theme: allow the use of SVG in CSS background images.

This commit is contained in:
Sam Hemelryk
2012-12-03 09:20:06 +13:00
parent 47dfbd9eb3
commit 383b89a1e2
3 changed files with 75 additions and 24 deletions
+8 -1
View File
@@ -32,6 +32,7 @@ $themename = min_optional_param('theme', 'standard', 'SAFEDIR');
$type = min_optional_param('type', '', 'SAFEDIR');
$subtype = min_optional_param('subtype', '', 'SAFEDIR');
$sheet = min_optional_param('sheet', '', 'SAFEDIR');
$usesvg = (bool)min_optional_param('svg', '1', 'INT');
if (!defined('THEME_DESIGNER_CACHE_LIFETIME')) {
define('THEME_DESIGNER_CACHE_LIFETIME', 4); // this can be also set in config.php
@@ -47,9 +48,15 @@ if (file_exists("$CFG->dirroot/theme/$themename/config.php")) {
// no gzip compression when debugging
$candidatesheet = "$CFG->cachedir/theme/$themename/designer.ser";
if ($usesvg) {
$candidatesheet = "$CFG->cachedir/theme/$themename/designer.ser";
} else {
// Add to the sheet name, one day we'll be able to just drop this.
$candidatesheet = "$CFG->cachedir/theme/$themename/designer_nosvg.ser";
}
if (!file_exists($candidatesheet)) {
css_send_css_not_found();
}