'Munin', 'description' => 'Reports about Munin data collectors and their probes', 'page callback' => 'munin_api_page_report_global', 'access arguments' => array('access site reports'), ); $items['admin/reports/munin_api/list'] = array( 'type' => MENU_DEFAULT_LOCAL_TASK, 'title' => 'General', 'weight' => -1, ); foreach (module_implements('munin_api_info') as $name) { $module = module_invoke($name, 'munin_api_info'); $module = $module[$name]; $items['admin/reports/munin_api/'. $name] = array( 'type' => MENU_LOCAL_TASK, 'title' => $module['#title'], 'description' => $module['#description'], 'page callback' => 'munin_api_page_report_instance', 'page arguments' => array(3), 'access arguments' => array('access site reports'), ); } return $items; } /** * Page callback for Munin report * * @return string */ function munin_api_page_report_global() { $items = module_invoke_all('munin_api_info'); $header = array( t('Module'), t('Description'), t('Stats'), ); $rows = array(); foreach ($items as $name => $item) { $link_title = $item['#title'] ? $item['#title'] : $name; $rows[] = array( l($link_title, 'admin/reports/munin_api/'. $name), isset($item['#description']) ? $item['#description'] : t('<missing>'), count(element_children($item)), ); } $ret = theme('table', $header, $rows); return $ret; } function munin_api_page_report_instance($module) { $module = module_invoke($module, 'munin_api_info'); $module = reset($module); $header = array(t('Name'), t('Description'), t('Type')); $rows = array(); foreach (element_children($module) as $name) { $rows[] = array( $name, isset($module[$name]['#title']) ? $module[$name]['#title'] : t('<missing>'), $module[$name]['#type'], ); } $ret = theme('table', $header, $rows); return $ret; }