From 7290d995370564616fe7b7b374edfc3b6aa61182 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 25 Jan 2005 14:40:15 +0000 Subject: [PATCH] Reworked styles.php to make it more programmatic with an accurate lastmodified date --- theme/standard/styles.php | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/theme/standard/styles.php b/theme/standard/styles.php index 09c6b8b585..e0fdd20ed5 100644 --- a/theme/standard/styles.php +++ b/theme/standard/styles.php @@ -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; } @@ -11,11 +18,19 @@ $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); + } ?> -- 2.39.5