You are here

function theme_status_report in Drupal 6

Same name and namespace in other branches
  1. 5 modules/system/system.module \theme_status_report()
  2. 7 modules/system/system.admin.inc \theme_status_report()

Theme requirements status report.

Parameters

$requirements: An array of requirements.

Related topics

1 theme call to theme_status_report()
system_status in modules/system/system.admin.inc
Menu callback: displays the site status report. Can also be used as a pure check.

File

modules/system/system.admin.inc, line 2007
Admin page callbacks for the system module.

Code

function theme_status_report($requirements) {
  $i = 0;
  $output = '<table class="system-status-report">';
  foreach ($requirements as $requirement) {
    if (empty($requirement['#type'])) {
      $class = ++$i % 2 == 0 ? 'even' : 'odd';
      $classes = array(
        REQUIREMENT_INFO => 'info',
        REQUIREMENT_OK => 'ok',
        REQUIREMENT_WARNING => 'warning',
        REQUIREMENT_ERROR => 'error',
      );
      $class = $classes[isset($requirement['severity']) ? (int) $requirement['severity'] : 0] . ' ' . $class;

      // Output table row(s)
      if (!empty($requirement['description'])) {
        $output .= '<tr class="' . $class . ' merge-down"><th>' . $requirement['title'] . '</th><td>' . $requirement['value'] . '</td></tr>';
        $output .= '<tr class="' . $class . ' merge-up"><td colspan="2">' . $requirement['description'] . '</td></tr>';
      }
      else {
        $output .= '<tr class="' . $class . '"><th>' . $requirement['title'] . '</th><td>' . $requirement['value'] . '</td></tr>';
      }
    }
  }
  $output .= '</table>';
  return $output;
}