You are here

function perfmon_reviewed in Performance monitor 7

Same name and namespace in other branches
  1. 8 perfmon.module \perfmon_reviewed()

Main page output.

1 call to perfmon_reviewed()
perfmon_page in ./perfmon.pages.inc
Page callback for run & review.

File

./perfmon.pages.inc, line 39
@todo: Enter file description here. @todo: Add hook_help for all tests.

Code

function perfmon_reviewed($testlist, $tests) {
  $items = array();
  $last_run = variable_get('perfmon_last_run', '');
  $date = !empty($last_run) ? format_date($last_run) : '';
  $header = t('Review results from last run !date', array(
    '!date' => $date,
  ));
  $desc = t("Here you can review the results from the last run of the testlist. You can run the testlist again by expanding the fieldset above.");
  foreach ($tests as $test) {

    // Skip this iteration if the result has no matching item in the testlist.
    if (!isset($testlist[$test['testname']])) {
      continue;
    }
    $message = $testlist[$test['testname']]['title'];
    $title = t('OK');
    $class = 'ok';
    $bold = FALSE;
    if ($test['testname'] == 'config') {
      $bold = TRUE;
    }
    $items[] = array(
      'title' => $title,
      'bold' => $bold,
      'value' => $test['result'],
      'class' => $class,
      'message' => $message,
      'help_link' => l(t('Details'), 'admin/reports/perfmon/help/' . $test['testname']),
    );
  }
  $output = theme('perfmon_reviewed', array(
    'items' => $items,
    'header' => $header,
    'description' => $desc,
  ));

  // @todo #markup?
  return array(
    '#markup' => $output,
  );
}