From 40a9112d1b841b0ac60de102bd7e0a06c3aed070 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sun, 13 Jul 2014 13:05:11 +0200 Subject: support file template array --- htmlreport/gen-html.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'htmlreport/gen-html.php') 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) { -- cgit v1.2.3