public function ContentVocabularies::getResultInfo in Site Audit 8.3
.
Overrides SiteAuditCheckBase::getResultInfo
1 call to ContentVocabularies::getResultInfo()
- ContentVocabularies::getResultWarn in src/
Plugin/ SiteAuditCheck/ ContentVocabularies.php - .
File
- src/
Plugin/ SiteAuditCheck/ ContentVocabularies.php, line 28
Class
- ContentVocabularies
- Provides the ContentVocabularies Check.
Namespace
Drupal\site_audit\Plugin\SiteAuditCheckCode
public function getResultInfo() {
if (!isset($this->registry->vocabulary_counts)) {
return $this
->t('The taxonomy module is not enabled.');
}
if (empty($this->registry->vocabulary_counts)) {
if ($this->options['detail']) {
return $this
->t('No vocabularies exist.');
}
return '';
}
$ret_val = '';
$table_rows = [];
foreach ($this->registry->vocabulary_counts as $vocabulary => $count) {
$table_rows[] = [
$vocabulary,
$count,
];
}
$header = [
$this
->t('Vocabulary'),
$this
->t('Terms'),
];
return [
'#theme' => 'table',
'#class' => 'table-condensed',
'#header' => $header,
'#rows' => $table_rows,
];
}