'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', ); $items['admin/reports/munin_api/list/%munin_api_instance'] = array( 'type' => MENU_CALLBACK, 'page callback' => 'munin_api_page_report_instance', 'page arguments' => array(4), '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/list/'. $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) { $title = isset($module['#title']) ? $module['#title'] : t('Info'); drupal_set_title($title); $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; }