Example #1
0
function large_node($item)
{
    global $abs, $view, $colon, $dashes;
    $ob = array();
    // our local copy
    $uri = $abs . $item['data']['link'];
    if ($view['vlinkv'] != 0) {
        $uri = $abs . "view.php?viewid=" . $view['vlinkv'];
    }
    $link = $view['vclick'];
    if ($link == "disabled") {
        $l = "<a href=#>";
    } else {
        if ($link == "standard") {
            $l = "<a href=\"" . $uri . "\">";
        } else {
            if ($link == "frametop") {
                $l = "<a href=\"" . $uri . "\" target=_top>";
            } else {
                if ($link == "newwindow") {
                    $l = "<a href=\"" . $uri . "\" target=top>";
                } else {
                    $l = "<a href=#>";
                }
            }
        }
    }
    if ($item['icolour'] == 1) {
        $col = true;
    } else {
        $col = false;
    }
    if ($col) {
        switch ($item['data']['status']) {
            case -1:
                $c = "#a0a0a0";
                break;
            case 0:
                $c = "green";
                break;
            case 1:
                $c = "orange";
                break;
            case 2:
                $c = "red";
                break;
            default:
                $c = "black";
                break;
        }
    } else {
        $c = "#a0a0a0";
    }
    $ss = "width: 250; border: dotted 1px " . $c . ";";
    $ob[] = "<table style=\"" . $ss . "\">";
    if ($item['igraphic'] == 1) {
        $is = "<img src=\"" . $abs . "images/lights/a" . $item['data']['status'] . ".png\">&nbsp;";
    } else {
        if ($item['igraphic'] > 0) {
            $is = "<img src=\"" . $abs . "icons/" . NodeIcon($item['data']['nodeid']) . "\">&nbsp;";
        } else {
            $is = "&nbsp;";
        }
    }
    $ob[] = "<tr><td align=left valign=center>";
    $ob[] = $l;
    if ($item['icolour'] == 1) {
        $ob[] = "<b class=\"al" . $item['data']['status'] . "\">";
    }
    $out = $item['data']['name'];
    if ($item['itextstatus'] == 1) {
        $out .= $colon . " " . oText($item['data']['status']);
    }
    $ob[] = $out . "</a>";
    if ($item['icolour'] == 1) {
        $ob[] = "</b>";
    }
    $ob[] = "</td><td align=right valign=center>";
    $ob[] = $is;
    $ob[] = "</td></tr>";
    // detail like tests etc...
    if ($item['idetail'] > 0) {
        $ob[] = "<tr><td colspan=2 align=left valign=top>";
        $a = 0;
        foreach ($item['data']['detail'] as $dline) {
            $a++;
            $ob[] = "&nbsp;-&nbsp;";
            if ($item['icolour'] == 1) {
                $ob[] = "<b class=\"al" . $dline['status'] . "\">";
            }
            $out = $dline['item'];
            if ($item['itextstatus'] == 1) {
                $out .= $colon . " " . oText($dline['status']);
            }
            $ob[] = $out;
            if ($item['icolour'] == 1) {
                $ob[] = "</b>";
            }
            $ob[] = "<br>";
        }
        $ob[] = "</td></tr>";
        //if ($a>0) $ob[]="<br>";
    }
    $ob[] = "</table>";
    return $ob;
}
Example #2
0
function np_big($nodeid,$nodename="",$nodedesc="",$nodeicon="")
{
global $NATS;
if ($nodedesc=="") $nodedesc="&nbsp;";
if ($nodeicon=="") $nodeicon=NodeIcon($nodeid);
$al=$NATS->NodeAlertLevel($nodeid);
echo "<table class=\"npbig-al".$al."\">";
echo "<tr><td align=left valign=top>";
echo "<table class=\"nicetable\" width=300>";
echo "<tr><td align=right>Node Name :";
if ($nodename=="") $nodename=$nodeid;
echo "</td><td align=left><a href=node.php?nodeid=".$nodeid.">".$nodename."</a></td></tr>";
echo "<tr><td align=right>Description :";
echo "</td><td align=left>".$nodedesc."</td></tr>";
echo "<tr><td align=right>Status :</td><td align=left>";
echo "<b class=\"al".$al."\">".oText($al)."</b></td></tr>";
echo "</table></td>";
//echo "<td align=left valign=top align=right width=60>";
//echo "<img src=icons/".GroupIcon($groupid).">";
//echo "</td>";
echo "</tr>";
echo "</table>";
}
Example #3
0
function np_big($nodeid, $nodename = "", $nodedesc = "", $nodeicon = "", $jslink = false)
{
    global $NATS;
    if ($nodedesc == "") {
        $nodedesc = "&nbsp;";
    }
    if ($nodeicon == "") {
        $nodeicon = NodeIcon($nodeid);
    }
    $al = $NATS->NodeAlertLevel($nodeid);
    echo "<table class=\"npbig-al" . $al . "\">";
    echo "<tr><td align=left valign=top>";
    echo "<table class=\"nicetable\" width=300>";
    echo "<tr><td align=right>" . $NATS->Lang->Item("node.name") . " :";
    if ($nodename == "") {
        $nodename = $nodeid;
    }
    echo "</td><td align=left>";
    if ($jslink) {
        echo "<a href=\"javascript:nodeClick('" . $nodeid . "');\">";
    } else {
        echo "<a href=node.php?nodeid=" . $nodeid . ">";
    }
    echo $nodename . "</a></td></tr>";
    echo "<tr><td align=right>" . $NATS->Lang->Item("description") . " :";
    echo "</td><td align=left>" . $nodedesc . "</td></tr>";
    echo "<tr><td align=right>" . $NATS->Lang->item("status") . " :</td><td align=left>";
    echo "<b class=\"al" . $al . "\">" . oText($al) . "</b></td></tr>";
    echo "</table></td>";
    //echo "<td align=left valign=top align=right width=60>";
    //echo "<img src=icons/".GroupIcon($groupid).">";
    //echo "</td>";
    echo "</tr>";
    echo "</table>";
}