You are here

function theme_monitoring_overview_summary in Monitoring 7

Monitoring overview page summary.

Parameters

array $variables: Theme variables.

Return value

string Formatted output.

1 theme call to theme_monitoring_overview_summary()
monitoring_reports_sensors_overview in ./monitoring.admin.inc
Page callback to output list of sensors.

File

./monitoring.module, line 582
Monitoring bootstrap file.

Code

function theme_monitoring_overview_summary($variables) {
  $output = '<div class="monitoring-overview-summary">';
  $output .= t('<span class="monitoring-summary-time">Request execution time: <strong>@time_non_cachedms</strong> (including cached <strong>@time_totalms</strong>)</span>, <span class="monitoring-summary-ok">&nbsp;</span> @ok OK, <span class="monitoring-summary-info">&nbsp;</span> @info Info, <span class="monitoring-summary-warning">&nbsp;</span> @warning Warning, <span class="monitoring-summary-critical">&nbsp;</span> @critical Critical, <span class="monitoring-summary-unknown">&nbsp;</span> @unknown Unknown', array(
    '@time_total' => $variables['total_execution_time'],
    '@time_non_cached' => $variables['non_cached_execution_time'],
    '@ok' => $variables['status_overview'][SensorResultInterface::STATUS_OK],
    '@info' => $variables['status_overview'][SensorResultInterface::STATUS_INFO],
    '@warning' => $variables['status_overview'][SensorResultInterface::STATUS_WARNING],
    '@critical' => $variables['status_overview'][SensorResultInterface::STATUS_CRITICAL],
    '@unknown' => $variables['status_overview'][SensorResultInterface::STATUS_UNKNOWN],
  ));
  $output .= '</div>';
  if (user_access('monitoring force run')) {
    $output .= '<div class="monitoring-overview-summary-actions-right">' . l(t('Force execute all'), 'monitoring/sensors/force') . '</div>';
  }
  if (!empty($variables['oldest_sensor_label'])) {
    $output .= '<div class="monitoring-overview-summary-actions-right">' . t('Sensor %sensor (%category) cached before %before.', array(
      '%sensor' => $variables['oldest_sensor_label'],
      '%before' => $variables['oldest_sensor_called_before'],
      '%category' => $variables['oldest_sensor_category'],
    )) . '</div>';
  }
  else {
    $output .= '<div class="monitoring-overview-summary-actions-right">' . t('No sensor cached.') . '</div>';
  }
  return $output;
}