t('Metrics'), 'callback' => 'farm_metrics_dashboard_pane', 'group' => 'metrics', ); } return $panes; } /** * Metrics dashboard callback. */ function farm_metrics_dashboard_pane() { // Load metrics. $metrics = farm_metrics(); // If no metrics are available, show a message. if (empty($metrics)) { return 'No metrics available.'; } // Iterate through the metrics and build rendered metrics. $rendered_metrics = array(); foreach ($metrics as $metric) { $rendered_metrics[] = '
  • ' . $metric['label'] . ' ' . $metric['value'] . '
  • '; } // Build and return the final output. $output = ''; return $output; }