You are here

public function SiteAuditCheckBlockCacheReport::getResultInfo in Site Audit 7

Implements \SiteAudit\Check\Abstract\getResultInfo().

Overrides SiteAuditCheckAbstract::getResultInfo

File

Check/Block/CacheReport.php, line 34
Contains \SiteAudit\Check\Block\CacheReport.

Class

SiteAuditCheckBlockCacheReport
Class SiteAuditCheckBlockCacheReport.

Code

public function getResultInfo() {
  if (drush_get_option('html')) {
    $ret_val = '<table class="table table-condensed">';
    $ret_val .= '<thead><tr><th>' . dt('Module') . '</th><th>' . dt('Block') . '</th><th>' . dt('State') . '</th></tr></thead>';
    $ret_val .= '<tbody>';
    foreach ($this->registry['blocks'] as $block) {
      $ret_val .= '<tr>';
      $ret_val .= '<td>' . $block['module'] . '</td>';
      $ret_val .= '<td>' . $block['info'] . '</td>';
      $ret_val .= '<td>' . $block['state'] . '</td>';
      $ret_val .= '</tr>';
    }
    $ret_val .= '</tbody>';
    $ret_val .= '</table>';
  }
  else {
    $ret_val = dt('Module - Info: State') . PHP_EOL;
    if (!drush_get_option('json')) {
      $ret_val .= str_repeat(' ', 4);
    }
    $ret_val .= '--------------------';
    foreach ($this->registry['blocks'] as $block) {
      $ret_val .= PHP_EOL;
      if (!drush_get_option('json')) {
        $ret_val .= str_repeat(' ', 4);
      }
      $ret_val .= "{$block['module']} - {$block['info']}: {$block['state']}";
    }
  }
  return $ret_val;
}