= 5 && !safe_empty($result['ip'])) { $name .= ' ('.$result['ip'].')'; } $num_ports = dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE `device_id` = ?", [ $result['device_id'] ]); $descr = ''; if ($result['hostname'] != $result['sysName'] && $result['sysName']) { $descr .= truncate($result['sysName'], $max_len); $descr .= ' | '; } if ($result['location']) { $descr .= $result['location'] . ' | '; } if (strlen($result['purpose'])) { $descr .= $result['purpose'] . ' | '; } $device_search_results[] = array( 'url' => generate_device_url($result), 'name' => $name, 'colour' => $result['html_tab_colour'], // FIXME. this colour removed from humanize_device in r6280 'row_class' => $result['row_class'], 'html_row_class' => $result['html_row_class'], 'icon' => get_device_icon($result), 'data' => [ escape_html($result['hardware'] . ' | ' . $config['os'][$result['os']]['text'] . ' ' . $result['version']), html_highlight(escape_html($descr), $queryString) . $num_ports . ' ports' ], ); } $search_results['devices'] = array('descr' => 'Devices found', 'results' => $device_search_results); } // EOF