From: urs_hunkler Date: Sat, 23 Jun 2007 12:21:59 +0000 (+0000) Subject: Add an option $CFG->CSSEdit or $THEME->CSSEdit to Moodle. If one of both is set to... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d0c92410ef8014fac6fa520e50d6555f2a314475;p=moodle.git Add an option $CFG->CSSEdit or $THEME->CSSEdit to Moodle. If one of both is set to true, Moodle does not write all CSS code in one single CSS file but adds CSS @include to the theme CSS file to load all single CSS files. These single CSS files can then be interactively edited and saved with CSSEdit. It's like Firebug with direct saving your changes. --- diff --git a/lib/weblib.php b/lib/weblib.php index 129487a47a..6604a6af7c 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2920,10 +2920,22 @@ function style_sheet_setup($lastmodified=0, $lifetime=300, $themename='', $force echo replace_cssconstants($css); } else { /// Actually output all the files in order. - foreach ($files as $file) { - echo '/***** '.$file[1].' start *****/'."\n\n"; - @include_once($file[0].'/'.$file[1]); - echo '/***** '.$file[1].' end *****/'."\n\n"; + if (empty($CFG->CSSEdit) && empty($THEME->CSSEdit)) { + foreach ($files as $file) { + echo '/***** '.$file[1].' start *****/'."\n\n"; + @include_once($file[0].'/'.$file[1]); + echo '/***** '.$file[1].' end *****/'."\n\n"; + } + } else { + foreach ($files as $file) { + echo '/* @group '.$file[1].' */'."\n\n"; + if (strstr($file[1], '.css') !== FALSE) { + echo '@import url("'.$CFG->themewww.'/'.$file[1].'");'."\n\n"; + } else { + @include_once($file[0].'/'.$file[1]); + } + echo '/* @end */'."\n\n"; + } } } }