function thunder_taxonomy_form_taxonomy_overview_terms_alter in Thunder 6.2.x
Same name and namespace in other branches
- 8.5 modules/thunder_taxonomy/thunder_taxonomy.module \thunder_taxonomy_form_taxonomy_overview_terms_alter()
- 8.2 modules/thunder_taxonomy/thunder_taxonomy.module \thunder_taxonomy_form_taxonomy_overview_terms_alter()
- 8.3 modules/thunder_taxonomy/thunder_taxonomy.module \thunder_taxonomy_form_taxonomy_overview_terms_alter()
- 8.4 modules/thunder_taxonomy/thunder_taxonomy.module \thunder_taxonomy_form_taxonomy_overview_terms_alter()
- 6.0.x modules/thunder_taxonomy/thunder_taxonomy.module \thunder_taxonomy_form_taxonomy_overview_terms_alter()
- 6.1.x modules/thunder_taxonomy/thunder_taxonomy.module \thunder_taxonomy_form_taxonomy_overview_terms_alter()
Implements hook_form_taxonomy_overview_terms_alter().
File
- modules/
thunder_taxonomy/ thunder_taxonomy.module, line 69 - Module for adding custom Infinity base functions.
Code
function thunder_taxonomy_form_taxonomy_overview_terms_alter(&$form, FormStateInterface $formState) {
$form['terms']['#header'] = array_merge(array_slice($form['terms']['#header'], 0, 1, TRUE), [
t('Status'),
], array_slice($form['terms']['#header'], 1, NULL, TRUE));
foreach ($form['terms'] as &$term) {
if (is_array($term) && !empty($term['#term'])) {
$status['status'] = [
'#markup' => $term['#term']->status->value ? t('Published') : t('Unpublished'),
'#type' => 'item',
];
$term = array_slice($term, 0, 1, TRUE) + $status + array_slice($term, 1, NULL, TRUE);
}
}
}