$title = Util::htmlentities($title) . " <font style=\"font-weight:normal;font-size:80%\">(" . count($hg) . " " . _("hosts") . ")</font>"; $tooltip = $macv; $li = "key:'{$mac_key}', url:'{$mac_url}', icon:'../../pixmaps/theme/mac.png', isLazy:true, title:'{$title}', tooltip:'{$tooltip}'\n"; $buffer .= ($j > $from ? "," : "") . "{ {$li} }\n"; } $j++; } if ($j > $to) { $li = "key:'macs', page:'{$nextpage}', isFolder:true, isLazy:true, icon:'../../pixmaps/theme/mac.png', title:'" . _("next") . " {$maxresults} " . _("MAC/Vendor") . "'"; $buffer .= ",{ {$li} }\n"; } $buffer .= "]"; } } else { if (preg_match("/mac_(.*)/", $key, $found)) { if ($hg_list = Host_mac::get_mac_vendor_list($conn, $ossim_hosts, $filter)) { $k = 0; $html = ""; $length_hn = 20; uasort($hg_list, 'cmpf'); $buffer .= "["; foreach ($hg_list[$found[1]] as $ip => $host_name) { if ($k >= $from && $k < $to) { $host_key = utf8_encode($key . $k); $host_name = $host_name == $ip || $host_name == '' ? "" : utf8_encode($host_name); $aux_hname = strlen($host_name) > $length_hn ? substr($host_name, 0, $length_hn) . "..." : $host_name; $title = $host_name == "" ? $ip : "{$ip} <font style=\"font-size:80%\">(" . Util::htmlentities($aux_hname) . ")</font>"; $tooltip = $host_name == "" ? $ip : $ip . " (" . Util::htmlentities($host_name) . ")"; $html .= "{ key:'{$host_key}', url:'{$ip}', icon:'../../pixmaps/theme/host.png', title:'{$title}', tooltip:'{$tooltip}'},\n"; } $k++;