From a109d7bba015be9d8ff504efe8dfdaf0d7f0d7ef Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 24 Sep 2020 20:21:38 -0400 Subject: [PATCH] leaflet can't be cache busted so update output_link_if_exists and output_script_if_exists to take a cache_bust flag --- web/skins/classic/includes/functions.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index 8da07b025..d72b611bb 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -39,22 +39,30 @@ function xhtmlHeaders($file, $title) { $baseViewCssPhpFile = getSkinFile('/css/base/views/'.$basename.'.css.php'); $viewCssPhpFile = getSkinFile('/css/'.$css.'/views/'.$basename.'.css.php'); - function output_link_if_exists($files) { + function output_link_if_exists($files, $cache_bust=true) { global $skin; $html = array(); foreach ( $files as $file ) { if ( getSkinFile($file) ) { + if ( $cache_bust ) { $html[] = ''; + } else { + $html[] = ''; + } } } $html[] = ''; // So we ge a trailing \n return implode(PHP_EOL, $html); } - function output_script_if_exists($files) { + function output_script_if_exists($files, $cache_bust=true) { global $skin; $html = array(); foreach ( $files as $file ) { + if ( $cache_bust ) { $html[] = ''; + } else { + $html[] = ''; + } } $html[] = ''; // So we ge a trailing \n return implode(PHP_EOL, $html); @@ -122,7 +130,7 @@ if ( $css != 'base' ) if ( $css != 'base' ) echo output_link_if_exists(array('/css/'.$css.'/views/control.css')); } else if ( $basename == 'monitor' ) { - echo output_link_if_exists(array('/js/leaflet/leaflet.css')); + echo output_link_if_exists(array('js/leaflet/leaflet.css'), false); } ?>