You are here

public function SiteAuditCheckExtensionsDev::getResultWarn in Site Audit 7

Same name and namespace in other branches
  1. 8.2 Check/Extensions/Dev.php \SiteAuditCheckExtensionsDev::getResultWarn()

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

Overrides SiteAuditCheckAbstract::getResultWarn

1 call to SiteAuditCheckExtensionsDev::getResultWarn()
SiteAuditCheckExtensionsDev::getResultInfo in Check/Extensions/Dev.php
Implements \SiteAudit\Check\Abstract\getResultInfo().

File

Check/Extensions/Dev.php, line 48
Contains \SiteAudit\Check\Extensions\Dev.

Class

SiteAuditCheckExtensionsDev
Class SiteAuditCheckExtensionsDev.

Code

public function getResultWarn() {
  $ret_val = dt('The following development modules(s) are currently enabled: @list', array(
    '@list' => implode(', ', array_keys($this->registry['extensions_dev'])),
  ));
  $show_table = TRUE;
  if (site_audit_env_is_dev()) {
    $show_table = FALSE;
  }
  if (drush_get_option('detail')) {
    if (drush_get_option('html')) {
      if ($show_table) {
        $ret_val .= '<br/>';
        $ret_val .= '<table class="table table-condensed">';
        $ret_val .= '<thead><tr><th>' . dt('Name') . '</th><th>' . dt('Reason') . '</th></thead>';
        $ret_val .= '<tbody>';
        foreach ($this->registry['extensions_dev'] as $row) {
          $ret_val .= '<tr><td>' . implode('</td><td>', $row) . '</td></tr>';
        }
        $ret_val .= '</tbody>';
        $ret_val .= '</table>';
      }
    }
    elseif ($show_table) {
      foreach ($this->registry['extensions_dev'] as $row) {
        $ret_val .= PHP_EOL;
        if (!drush_get_option('json')) {
          $ret_val .= str_repeat(' ', 6);
        }
        $ret_val .= '- ' . $row[0] . ': ' . $row[1];
      }
    }
  }
  return $ret_val;
}