<?php
# Page variables
define("PAGE_ID","contactview");
define("PAGE_TITLE","Command object");
define("OBJECTTYPE","command");
define("OBJECTNAME","Command");
require_once("includes/main.inc.php");
include_once("html_wrap/head2.inc.php");
$rowcolor = "";
$object = NULL;
$cntinh = 0;
$objectid = (isset($objectid)) ? $objectid : NULL;
if ($objectid != "") {
$object = $Plugin->GetObjectById($objectid, OBJECTTYPE);
$objectid = (isset($object['__objectid'])) ? $object['__objectid'] : "";
}
$commandname = isset($object[OBJECTTYPE."_name"]) ? $object[OBJECTTYPE."_name"] : $object['name'];
if (!empty($object['name'])) {
$cntinh = NagiosCountInherited(OBJECTTYPE,$object['name']);
}
if (!empty($object['use'])) {
$inhobject = $Plugin->GetObjectByName($object['use'],OBJECTTYPE);
foreach($inhobject as $key => $value) {
$object['++'.$key] = $value;
}
}
foreach ($confobjects[OBJECTTYPE] as $key => $propconf) {
$required = 'label';
$value = $object[$key];
$inhhtml = "";
$show = str_replace(",", ",<br>", $value);
$required = ($propconf[2] == TRUE) ? 'required' : 'label';
$rowcolor = ($rowcolor != "dataOdd") ? "dataOdd" : "dataEven";
$key=ucfirst(str_replace("_", " ", $key));
$rows[$key] = <<<HTML
<tr class="{$rowcolor}">
<td>$key</td>
<td class="$required" with="3"> </td>
<td>
$show
</td>
$inhhtml
</tr>
HTML;
}
?>
<div align="center">
<table cellpadding="3" border="0">
<tr>
<td colspan="3" align="left">
<b> </b>
</td>
</tr>
<tr class="data">
<th colspan="3" class="data">Properties</td>
</tr>
<?
echo implode("\n", $rows);
if ($cntinh > 0) {
print ObjectInheritance($commandname,OBJECTTYPE, FALSE);
}
/*
$userobjs = NagiosObjectUsage($commandname,OBJECTTYPE);
if ($userobjs != NULL) {
print ObjectUsage($commandname, OBJECTTYPE, $userobjs, FALSE);
}
*/
?>
<tr>
<td colspan="3" align="center">
<hr>
</td>
</tr>
<tr>
<td colspan="3" align="center">
<form method="post">
<input type="submit" value="Close" onclick="parent.close('')">
</form>
</td>
</tr>
</table>
</div>
<?
include_once("html_wrap/tail2.inc.php");
?>