. * * @package LibreNMS * @link http://librenms.org * @copyright 2017 Tony Murray * @author Tony Murray */ use LibreNMS\Device\WirelessSensor; $sensors = dbFetchColumn('SELECT `sensor_class` FROM `wireless_sensors` GROUP BY `sensor_class`'); $valid_wireless_types = array_intersect_key(WirelessSensor::getTypes(), array_flip($sensors)); $class = $vars['metric']; if (!$class) { $class = key($valid_wireless_types); // get current type in array (should be the first) } if (!$vars['view']) { $vars['view'] = "nographs"; } $link_array = array('page' => 'wireless'); $pagetitle[] = "Wireless"; print_optionbar_start('', ''); echo('Wireless » '); $sep = ''; foreach ($valid_wireless_types as $type => $details) { echo($sep); if ($class == $type) { echo(""); } echo(generate_link($details['short'], $link_array, array('metric'=> $type, 'view' => $vars['view']))); if ($class == $type) { echo(""); } $sep = ' | '; } unset($sep); echo('
'); if ($vars['view'] == "graphs") { echo(''); } echo(generate_link("Graphs", $link_array, array('metric'=> $class, 'view' => "graphs"))); if ($vars['view'] == "graphs") { echo(''); } echo(' | '); if ($vars['view'] != "graphs") { echo(''); } echo(generate_link("No Graphs", $link_array, array('metric'=> $class, 'view' => "nographs"))); if ($vars['view'] != "graphs") { echo(''); } echo('
'); print_optionbar_end(); if (isset($valid_wireless_types[$class])) { $graph_type = 'wireless_' . $class; $unit = $valid_wireless_types[$class]['unit']; include $config['install_dir'] . '/html/pages/wireless/sensors.inc.php'; } else { echo("No sensors of type " . $class . " found."); }