Esempio n. 1
0
            if ($html != "") {
                $buffer .= ($j > 1 ? "," : "") . "{ {$li}, children:[ " . preg_replace("/,\$/", "", $html) . " ] }\n";
            } else {
                $buffer .= ($j > 1 ? "," : "") . "{ {$li} }\n";
            }
            $j++;
        }
        $buffer .= "]";
    }
    $buffer .= "}]";
} else {
    if (preg_match("/pg_(.*)/", $key, $found)) {
        $html = "";
        $buffer .= "[";
        $k = 1;
        $port_list = Port_group_reference::get_list($conn, " where port_group_name = '" . base64_decode($found[1]) . "'");
        foreach ($port_list as $port) {
            $protocol_name = $port->get_protocol_name();
            $protocol_number = $port->get_port_number();
            $html .= "{ key:'{$key}.{$k}', url:'noport', icon:'../../pixmaps/theme/ports.png', title:'</font>{$protocol_number} {$protocol_name}</font>' },";
        }
        if ($html != "") {
            $buffer .= preg_replace("/,\$/", "", $html);
        }
        $buffer .= "]";
    }
}
if ($buffer == "" || $buffer == "[]") {
    $buffer = "[{title:'" . _("No port groups found") . "', noLink:true}]";
}
echo $buffer;