]> git.mjollnir.org Git - moodle.git/commitdiff
Reworked styles.php to make it more programmatic with an accurate lastmodified date
authormoodler <moodler>
Tue, 25 Jan 2005 14:40:15 +0000 (14:40 +0000)
committermoodler <moodler>
Tue, 25 Jan 2005 14:40:15 +0000 (14:40 +0000)
theme/standard/styles.php

index 09c6b8b585efc95e6e17fb41499730f4dcf3355d..e0fdd20ed51882f131aac5c16f50e146c028ae9c 100644 (file)
@@ -4,6 +4,13 @@
 /// up any necessary variables, and lets us include raw CSS files.
 /// The output of this script should be a completely standard CSS file.
 
+
+/// These are the stylesheets this theme uses
+    $subsheets = array('styles_layout.css', 'styles_fonts.css', 'styles_color.css', 'styles_moz.css');
+
+
+/// There should be no need to touch the following
+
     if (!isset($themename)) {
         $themename = NULL;
     }
     $nomoodlecookie = true;
     require_once("../../config.php");
 
-    $themeurl = style_sheet_setup(filemtime("styles.php"), 600, $themename);
+    $lastmodified = filemtime('styles.php');
 
-    include('styles_layout.css');
-    include('styles_fonts.css');
-    include('styles_color.css');
-    include('styles_moz.css');
+    foreach ($subsheets as $subsheet) {
+        $lastmodifiedsub = filemtime($subsheet);
+        if ($lastmodifiedsub > $lastmodified) {
+            $lastmodified = $lastmodifiedsub;
+        }
+    }
+
+    $themeurl = style_sheet_setup($lastmodifiedsub, 600, $themename);
+
+    foreach ($subsheets as $subsheet) {
+        include_once($subsheet);
+    }
 
 ?>