Merge branch 'maint/7.0'
[ninja.git] / application / views / hypermap / xml.php
blob5fb9247e3b770a7f1d9cb714c480565768423187
1 <?php defined('SYSPATH') OR die('No direct access allowed.');
3 header('Content-Type: text/xml; charset=UTF-8');
4 echo '<?xml version="1.0" encoding="UTF-8" ?>'; echo "\n"; ?>
5 <!DOCTYPE GraphXML SYSTEM "<?php echo $dtd; ?>">
6 <GraphXML xmlns:xlink="http://www.w3.org/1999/xlink">
7 <graph>
9 <style>
10 <line tag="node" class="main" colour="#ffffff"/>
11 <line tag="node" class="child_node" colour="blue"/>
12 <line tag="node" class="nagios_node" colour="red"/>
13 <line tag="node" class="relation_node" colour="green"/>
14 <line tag="node" class="hs0" colour="#219421"/>
15 <line tag="node" class="hs1" colour="#F83838"/>
16 <line tag="node" class="hs2" colour="#F83838"/>
17 <line tag="edge" class="secondary_edge" colour="blue" linestyle="dashed"/>
18 </style>
19 <node class="nagios_node" name="0">
20 <label><?php echo sprintf(_('%s Process'), Kohana::config('config.product_name')) ?></label>
21 </node>
22 <?php
23 foreach ($hosts as $node) {
24 $title_str = sprintf(_('Host: %s Status: %s (Click for detail)'), $node['name'], Current_status_Model::status_text($node['state'], $node['has_been_checked']));
25 echo sprintf("<node class=\"hs%u\" name=\"%s\"><label>%s</label><dataref><ref xlink:show=\"replace\" xlink:href=\"extinfo/details?host=%s\" xlink:title=\"%s\"/></dataref></node>\n",
26 $node['state'], $node['name'], $node['name'], urlencode($node['name']), $title_str);
29 foreach ($host_parents as $host => $parents) {
30 foreach ($parents as $parent) {
31 echo '<edge source="'.$parent.'" target="'.$host.'"/>';
35 foreach ($no_parents as $host) {
36 echo '<edge source="0" target="'.$host.'"/>';
39 </graph>
40 </GraphXML>