summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/graphs.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-10-27 13:38:50 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-10-27 13:38:50 +0000
commitef76479c1aeefa6f7920473f8be38292dfdbc837 (patch)
treeea973e1f148d051ba0260099464d48efe7a37e1a /frontends/php/include/graphs.inc.php
parentedf199a4f93b92945ef8a0f0a92730e4ec4f378e (diff)
downloadzabbix-ef76479c1aeefa6f7920473f8be38292dfdbc837.tar.gz
zabbix-ef76479c1aeefa6f7920473f8be38292dfdbc837.tar.xz
zabbix-ef76479c1aeefa6f7920473f8be38292dfdbc837.zip
- developed multitemplate system (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3388 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/graphs.inc.php')
-rw-r--r--frontends/php/include/graphs.inc.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php
index 20219ee9..7f41d831 100644
--- a/frontends/php/include/graphs.inc.php
+++ b/frontends/php/include/graphs.inc.php
@@ -422,7 +422,7 @@
return $result;
}
- function delete_template_graphs($hostid, $templateid = null, $unlink_mode = false)
+ function delete_template_graphs($hostid, $templateid = null /* array format 'arr[id]=name' */, $unlink_mode = false)
{
$db_graphs = get_graphs_by_hostid($hostid);
while($db_graph = DBfetch($db_graphs))
@@ -433,7 +433,12 @@
if($templateid != null)
{
$tmp_graph = get_graph_by_graphid($db_graph["templateid"]);
- if($tmp_graph["hostid"] != $templateid)
+ if(is_array($templateid))
+ {
+ if(!isset($templateid[$tmp_graph["hostid"]]))
+ continue;
+ }
+ elseif($tmp_graph["hostid"] != $templateid)
continue;
}
@@ -451,12 +456,18 @@
}
}
- function copy_template_graphs($hostid, $templateid = null, $copy_mode = false)
+ function copy_template_graphs($hostid, $templateid = null /* array format 'arr[id]=name' */, $copy_mode = false)
{
if($templateid == null)
{
- $host = get_host_by_hostid($hostid);
- $templateid = $host["templateid"];
+ $templateid = get_templates_by_hostid($hostid);
+ }
+
+ if(is_array($templateid))
+ {
+ foreach($templateid as $id => $name)
+ copy_template_graphs($hostid, $id, $copy_mode); // attention recursion
+ return;
}
$db_graphs = get_graphs_by_hostid($templateid);