當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Host::get_property_values方法代碼示例

本文整理匯總了PHP中Host::get_property_values方法的典型用法代碼示例。如果您正苦於以下問題:PHP Host::get_property_values方法的具體用法?PHP Host::get_property_values怎麽用?PHP Host::get_property_values使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Host的用法示例。


在下文中一共展示了Host::get_property_values方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _

    $buffer .= "[ {title: '" . _("Asset by Property") . "', isFolder: true, key:'main', icon:'../../pixmaps/theme/any.png', expand:true, children:[\n";
    $icons = array("software" => "software", "operating-system" => "host_os", "cpu" => "cpu", "service" => "ports", "memory" => "ram", "department" => "host_group", "macaddress" => "mac", "workgroup" => "net_group", "role" => "server_role", "acl" => "acl", "storage" => "storage", "route" => "route");
    foreach ($props as $prop) {
        $png = $icons[strtolower($prop["name"])];
        $png = empty($png) ? "folder" : $png;
        if (count(Host::get_property_values($conn, $prop["id"])) > 0) {
            $buffer .= "{ key:'p" . $prop["id"] . "', isFolder:true, isLazy:true, expand:false, icon:'../../pixmaps/theme/{$png}.png', title:'" . _($prop["description"]) . "' },\n";
        } else {
            $buffer .= "{ icon:'../../pixmaps/theme/{$png}.png', title:'" . _($prop["name"]) . "' },\n";
        }
    }
    $buffer .= "{ key:'all', isFolder:true, isLazy:true, icon:'../../pixmaps/theme/host_add.png', title:'" . _("All Hosts") . "' }\n";
    $buffer .= "] } ]";
} else {
    if (preg_match("/p(.*)/", $key, $found)) {
        $value_list = Host::get_property_values($conn, $found[1]);
        $j = 0;
        if (intval($found[1]) != 7) {
            foreach ($value_list as $v) {
                if ($j >= $from && $j < $to) {
                    $value = strlen($v["value"]) > $length_name ? substr($v["value"], 0, $length_name) . "..." : $v["value"];
                    $title = $value . " <font style=\"font-weight:normal;font-size:80%\">(" . $v["total"] . ")</font>";
                    $tooltip = $v["value"] . " (" . $v["total"] . ")";
                    $buffer .= "{ key:'cclass_" . $found[1] . "_" . md5($v["value"]) . "', isLazy:true , title:'{$title}', tooltip:'{$tooltip}', isFolder:true},";
                }
                $j++;
            }
        } else {
            foreach ($value_list as $v) {
                if ($j >= $from && $j < $to) {
                    $vendor = strlen($v["vendor"]) > $length_name ? substr($v["vendor"], 0, $length_name) . "..." : $v["vendor"];
開發者ID:jhbsz,項目名稱:ossimTest,代碼行數:31,代碼來源:asset_by_property_tree_wl.php


注:本文中的Host::get_property_values方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。