mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Better checks for existing files
This commit is contained in:
parent
73cffa5416
commit
730967f2e7
2 changed files with 10 additions and 6 deletions
|
@ -32,11 +32,13 @@
|
||||||
/// Work out the last modified date for this theme
|
/// Work out the last modified date for this theme
|
||||||
|
|
||||||
foreach ($THEME->sheets as $sheet) {
|
foreach ($THEME->sheets as $sheet) {
|
||||||
$sheetmodified = filemtime($sheet.'.css');
|
if (file_exists($sheet.'.css')) {
|
||||||
|
$sheetmodified = @filemtime($sheet.'.css');
|
||||||
if ($sheetmodified > $lastmodified) {
|
if ($sheetmodified > $lastmodified) {
|
||||||
$lastmodified = $sheetmodified;
|
$lastmodified = $sheetmodified;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Print out the entire style sheet
|
/// Print out the entire style sheet
|
||||||
|
|
||||||
|
|
|
@ -27,11 +27,13 @@
|
||||||
/// Work out the last modified date for this theme
|
/// Work out the last modified date for this theme
|
||||||
|
|
||||||
foreach ($THEME->sheets as $sheet) {
|
foreach ($THEME->sheets as $sheet) {
|
||||||
|
if (file_exists($sheet.'.css')) {
|
||||||
$sheetmodified = filemtime($sheet.'.css');
|
$sheetmodified = filemtime($sheet.'.css');
|
||||||
if ($sheetmodified > $lastmodified) {
|
if ($sheetmodified > $lastmodified) {
|
||||||
$lastmodified = $sheetmodified;
|
$lastmodified = $sheetmodified;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Print out the entire style sheet
|
/// Print out the entire style sheet
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue