Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reworked styles.php to make it more programmatic with an accurate las…

…tmodified date
  • Loading branch information...
commit 7290d995370564616fe7b7b374edfc3b6aa61182 1 parent 4ff025e
moodler authored
Showing with 20 additions and 5 deletions.
  1. +20 −5 theme/standard/styles.php
View
25 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);
+ }
?>
Please sign in to comment.
Something went wrong with that request. Please try again.