'device',
    'device' => $device['device_id'],
    'tab'    => 'graphs',
);
$bg = '#ffffff';
echo '
';
print_optionbar_start();
echo "Graphs » ";
foreach (dbFetchRows('SELECT * FROM device_graphs WHERE device_id = ? ORDER BY graph', array($device['device_id'])) as $graph) {
    $section = $config['graph_types']['device'][$graph['graph']]['section'];
    if ($section != '') {
        $graph_enable[$section][$graph['graph']] = $graph['graph'];
    }
}
// These are standard graphs we should have for all systems
$graph_enable['poller']['poller_perf'] = 'device_poller_perf';
if (can_ping_device($attribs) === true) {
    $graph_enable['poller']['ping_perf']   = 'device_ping_perf';
}
$sep = '';
foreach ($graph_enable as $section => $nothing) {
    if (isset($graph_enable) && is_array($graph_enable[$section])) {
        $type = strtolower($section);
        if (!$vars['group']) {
            $vars['group'] = $type;
        }
        echo $sep;
        if ($vars['group'] == $type) {
            echo '';
        }
        $sep = ' | ';
    }
}
unset($sep);
print_optionbar_end();
$graph_enable = $graph_enable[$vars['group']];
// foreach ($config['graph_types']['device'] as $graph => $entry)
foreach ($graph_enable as $graph => $entry) {
    $graph_array = array();
    if ($graph_enable[$graph]) {
        $graph_title         = $config['graph_types']['device'][$graph]['descr'];
        $graph_array['type'] = 'device_'.$graph;
        include 'includes/print-device-graph.php';
    }
}
$pagetitle[] = 'Graphs';