当前位置: 首页>>代码示例>>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;未经允许,请勿转载。