* @copyright (C) Adam Armstrong * */ // Sections are printed in the order they exist in $config['graph_sections'] // Graphs are printed in the order they exist in $config['graph_types'] $link_array = ['page' => 'device', 'device' => $device['device_id'], 'tab' => 'munin']; foreach (dbFetchRows("SELECT * FROM munin_plugins WHERE device_id = ? ORDER BY mplug_category, mplug_type", [$device['device_id']]) as $mplug) { # if (strlen($mplug['mplug_category']) == 0) { $mplug['mplug_category'] = "general"; } else { } $graph_enable[$mplug['mplug_category']][$mplug['mplug_type']]['id'] = $mplug['mplug_id']; $graph_enable[$mplug['mplug_category']][$mplug['mplug_type']]['title'] = $mplug['mplug_title']; $graph_enable[$mplug['mplug_category']][$mplug['mplug_type']]['plugin'] = $mplug['mplug_type']; } $navbar['brand'] = "Munin"; $navbar['class'] = "navbar-narrow"; foreach ($graph_enable as $section => $nothing) { if (isset($graph_enable) && is_array($graph_enable[$section])) { $type = strtolower($section); if (!$vars['group']) { $vars['group'] = $type; } if ($vars['group'] == $type) { $navbar['options'][$type]['class'] = "active"; } $navbar['options'][$type]['url'] = generate_url(['page' => 'device', 'device' => $device['device_id'], 'tab' => 'munin', 'group' => $type]); $navbar['options'][$type]['text'] = escape_html(ucwords($section)); } } print_navbar($navbar); $graph_enable = $graph_enable[$vars['group']]; echo generate_box_open(); echo '