You are here

function theme_acquia_purge_status_report in Acquia Purge 7

Returns HTML for the status report.

Parameters

array $variables: Requirements array as returned by AcquiaPurgeDiagnostics::get().

See also

theme_status_report()

1 theme call to theme_acquia_purge_status_report()
acquia_purge_form_expire_admin_settings_form_alter in ./acquia_purge.module
Implements hook_form_BASE_FORM_ID_alter().

File

./acquia_purge.admin.inc, line 403
Admin page callbacks and theme functions for the Acquia Purge module.

Code

function theme_acquia_purge_status_report(array $variables) {
  $output = '<table class="system-status-report">';
  $severities = array(
    ACQUIA_PURGE_SEVLEVEL_INFO => array(
      'title' => t('Info'),
      'class' => 'info',
    ),
    ACQUIA_PURGE_SEVLEVEL_OK => array(
      'title' => t('OK'),
      'class' => 'ok',
    ),
    ACQUIA_PURGE_SEVLEVEL_WARNING => array(
      'title' => t('Warning'),
      'class' => 'warning',
    ),
    ACQUIA_PURGE_SEVLEVEL_ERROR => array(
      'title' => t('Error'),
      'class' => 'error',
    ),
  );

  // Require all requirement constants from the installer code.
  include_once DRUPAL_ROOT . '/includes/install.inc';
  foreach ($variables['diagnostics'] as $requirement) {
    if (empty($requirement) || !is_array($requirement)) {
      continue;
    }
    $severity = isset($requirement['severity']) ? (int) $requirement['severity'] : REQUIREMENT_OK;
    $severity = $severities[$severity];

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