You are here

function thunder_taxonomy_form_taxonomy_overview_terms_alter in Thunder 8.5

Same name and namespace in other branches
  1. 8.2 modules/thunder_taxonomy/thunder_taxonomy.module \thunder_taxonomy_form_taxonomy_overview_terms_alter()
  2. 8.3 modules/thunder_taxonomy/thunder_taxonomy.module \thunder_taxonomy_form_taxonomy_overview_terms_alter()
  3. 8.4 modules/thunder_taxonomy/thunder_taxonomy.module \thunder_taxonomy_form_taxonomy_overview_terms_alter()
  4. 6.2.x modules/thunder_taxonomy/thunder_taxonomy.module \thunder_taxonomy_form_taxonomy_overview_terms_alter()
  5. 6.0.x modules/thunder_taxonomy/thunder_taxonomy.module \thunder_taxonomy_form_taxonomy_overview_terms_alter()
  6. 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 25
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);
    }
  }
}