From: Christian Weiske Date: Sun, 13 Jul 2014 11:05:11 +0000 (+0200) Subject: support file template array X-Git-Tag: v1.0.0~5 X-Git-Url: https://git.cweiske.de/usb-wde1-tools.git/commitdiff_plain/40a9112d1b841b0ac60de102bd7e0a06c3aed070 support file template array --- diff --git a/htmlreport/gen-html.php b/htmlreport/gen-html.php index 8969e0d..61c94ec 100755 --- a/htmlreport/gen-html.php +++ b/htmlreport/gen-html.php @@ -12,6 +12,13 @@ if (!function_exists('rrd_lastupdate')) { exit(2); } +if (!is_array($filetemplate)) { + $filetemplate = array_combine( + array_keys($names), + array_fill(0, count($names), $filetemplate) + ); +} + $data = array(); foreach ($names as $id => $name) { $data[$id]['name'] = $name; @@ -20,7 +27,7 @@ foreach ($names as $id => $name) { str_replace( array('{item}', '{id}'), array($item, $id), - $filetemplate + $filetemplate[$id] ) ); if ($lu === false) {