You are here

function tvi_form_taxonomy_vocabulary_form_alter in Taxonomy Views Integrator 8

Implements hook_form_BASE_FORM_ID_alter().

File

./tvi.module, line 201
Allow views to be used instead of default taxonomy term page behavior.

Code

function tvi_form_taxonomy_vocabulary_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
  $entity = $form_state
    ->getBuildInfo()['callback_object']
    ->getEntity();
  if ($entity
    ->id() !== NULL && Drupal::currentUser()
    ->hasPermission('define view for vocabulary ' . $entity
    ->id())) {
    _tvi_settings_form($form, $form_state, $entity);
  }
}