support file template array
authorChristian Weiske <cweiske@cweiske.de>
Sun, 13 Jul 2014 11:05:11 +0000 (13:05 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Sun, 13 Jul 2014 11:05:36 +0000 (13:05 +0200)
htmlreport/gen-html.php

index 8969e0d49810be9470b5274947fa2800ff7bdeb9..61c94ec47ec7e52f26c8e71713eacbfee5cd47a8 100755 (executable)
@@ -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) {