]> git.mjollnir.org Git - moodle.git/commitdiff
'added handling of CSS constants - MDL-6798'
authorurs_hunkler <urs_hunkler>
Mon, 8 Jan 2007 18:35:28 +0000 (18:35 +0000)
committerurs_hunkler <urs_hunkler>
Mon, 8 Jan 2007 18:35:28 +0000 (18:35 +0000)
lib/weblib.php

index 0f221f51fb370d57a743e39e5eb322f36b492dfd..441a4ac7a2f46b80d7babfa8bb3fe4d87bed5f55 100644 (file)
@@ -2562,11 +2562,25 @@ function style_sheet_setup($lastmodified=0, $lifetime=300, $themename='', $force
         echo ' **************************************/'."\n\n";
 
 
-    /// 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";
+        /// check if csscobstants is set
+        if (!empty($THEME->cssconstants)) {
+            require_once("$CFG->libdir/cssconstants.php");
+            /// Actually collect all the files in order.
+            $css = '';
+            foreach ($files as $file) {
+                $css .= '/***** '.$file[1].' start *****/'."\n\n";
+                $css .= file_get_contents($file[0].'/'.$file[1]);
+                $ccs .= '/***** '.$file[1].' end *****/'."\n\n";
+            }
+            /// replace css_constants with their values
+            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";
+            }
         }
     }