You are here

prod_check.theme.inc in Production check & Production monitor 6

Same filename and directory in other branches
  1. 7 includes/prod_check.theme.inc

File

includes/prod_check.theme.inc
View source
<?php

/**
 * Theme requirements status report.
 *
 * @param $requirements
 *   An array of requirements.
 * @ingroup themeable
 */
function theme_prod_check_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(
        PROD_CHECK_REQUIREMENT_INFO => 'info',
        PROD_CHECK_REQUIREMENT_OK => 'ok',
        PROD_CHECK_REQUIREMENT_WARNING => 'warning',
        PROD_CHECK_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;
}

/**
 * Theme database status page.
 *
 * @param $title
 *   Title to display.
 * @param $status
 *   String with status summary.
 * @param $details
 *   Associative array of associative arrays containing detailed status info.
 * @ingroup themeable
 */
function theme_prod_check_dbstatus($title, $status, $details) {
  $output = '';

  // DB system and version.
  $output .= '<h2>' . $title . '</h2>';

  // Basic status info.
  $output .= '<p>' . $status . '</p><p>&nbsp;</p>';

  // Add detailed statuses.
  foreach ($details as $type) {
    if ($type) {
      $caption = '<h2>' . $type['title'] . '</h2>';
      $output .= theme('table', $type['header'], $type['rows'], array(), $caption);
    }
  }
  return $output;
}

Functions

Namesort descending Description
theme_prod_check_dbstatus Theme database status page.
theme_prod_check_status_report Theme requirements status report.